aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2011-11-17 01:09:15 +0000
committerAnna Zaks <ganna@apple.com>2011-11-17 01:09:15 +0000
commit8687397a0f5e4c31632959d907f9d9b38d793b1c (patch)
tree86975103ea3d2c76493f44d5a190fb7b60d7ed07
parentf471487ff1e673531543576bc170898c2ab19f41 (diff)
[analyzer] Put CheckerConext::getCalleeName out of line.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144870 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h14
-rw-r--r--lib/StaticAnalyzer/Core/CMakeLists.txt1
-rw-r--r--lib/StaticAnalyzer/Core/CheckerContext.cpp31
3 files changed, 33 insertions, 13 deletions
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h b/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
index d5eb95193e..181ff5d475 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
@@ -143,19 +143,7 @@ public:
}
/// \brief Get the name of the called function (path-sensitive).
- StringRef getCalleeName(const CallExpr *CE) {
- const ProgramState *State = getState();
- const Expr *Callee = CE->getCallee();
- SVal L = State->getSVal(Callee);
-
- const FunctionDecl *funDecl = L.getAsFunctionDecl();
- if (!funDecl)
- return StringRef();
- IdentifierInfo *funI = funDecl->getIdentifier();
- if (!funI)
- return StringRef();
- return funI->getName();
- }
+ StringRef getCalleeName(const CallExpr *CE);
private:
ExplodedNode *addTransitionImpl(const ProgramState *State,
diff --git a/lib/StaticAnalyzer/Core/CMakeLists.txt b/lib/StaticAnalyzer/Core/CMakeLists.txt
index a2c351120e..391a781ab0 100644
--- a/lib/StaticAnalyzer/Core/CMakeLists.txt
+++ b/lib/StaticAnalyzer/Core/CMakeLists.txt
@@ -11,6 +11,7 @@ add_clang_library(clangStaticAnalyzerCore
BugReporter.cpp
BugReporterVisitors.cpp
Checker.cpp
+ CheckerContext.cpp
CheckerHelpers.cpp
CheckerManager.cpp
CheckerRegistry.cpp
diff --git a/lib/StaticAnalyzer/Core/CheckerContext.cpp b/lib/StaticAnalyzer/Core/CheckerContext.cpp
new file mode 100644
index 0000000000..f5bcfa9868
--- /dev/null
+++ b/lib/StaticAnalyzer/Core/CheckerContext.cpp
@@ -0,0 +1,31 @@
+//== CheckerContext.cpp - Context info for path-sensitive checkers-----------=//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines CheckerContext that provides contextual info for
+// path-sensitive checkers.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
+using namespace clang;
+using namespace ento;
+
+StringRef CheckerContext::getCalleeName(const CallExpr *CE) {
+ const ProgramState *State = getState();
+ const Expr *Callee = CE->getCallee();
+ SVal L = State->getSVal(Callee);
+
+ const FunctionDecl *funDecl = L.getAsFunctionDecl();
+ if (!funDecl)
+ return StringRef();
+ IdentifierInfo *funI = funDecl->getIdentifier();
+ if (!funI)
+ return StringRef();
+ return funI->getName();
+}