[cfe-commits] r144870 - in /cfe/trunk: include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h lib/StaticAnalyzer/Core/CMakeLists.txt lib/StaticAnalyzer/Core/CheckerContext.cpp
Anna Zaks
ganna at apple.com
Wed Nov 16 17:09:15 PST 2011
Author: zaks
Date: Wed Nov 16 19:09:15 2011
New Revision: 144870
URL: http://llvm.org/viewvc/llvm-project?rev=144870&view=rev
Log:
[analyzer] Put CheckerConext::getCalleeName out of line.
Added:
cfe/trunk/lib/StaticAnalyzer/Core/CheckerContext.cpp
Modified:
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
cfe/trunk/lib/StaticAnalyzer/Core/CMakeLists.txt
Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h?rev=144870&r1=144869&r2=144870&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h Wed Nov 16 19:09:15 2011
@@ -143,19 +143,7 @@
}
/// \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,
Modified: cfe/trunk/lib/StaticAnalyzer/Core/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/CMakeLists.txt?rev=144870&r1=144869&r2=144870&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/CMakeLists.txt (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/CMakeLists.txt Wed Nov 16 19:09:15 2011
@@ -11,6 +11,7 @@
BugReporter.cpp
BugReporterVisitors.cpp
Checker.cpp
+ CheckerContext.cpp
CheckerHelpers.cpp
CheckerManager.cpp
CheckerRegistry.cpp
Added: cfe/trunk/lib/StaticAnalyzer/Core/CheckerContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/CheckerContext.cpp?rev=144870&view=auto
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/CheckerContext.cpp (added)
+++ cfe/trunk/lib/StaticAnalyzer/Core/CheckerContext.cpp Wed Nov 16 19:09:15 2011
@@ -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();
+}
More information about the cfe-commits
mailing list