Skip to content
Snippets Groups Projects
Commit 8687397a authored by Anna Zaks's avatar Anna Zaks
Browse files

[analyzer] Put CheckerConext::getCalleeName out of line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144870 91177308-0d34-0410-b5e6-96231b3b80d8
parent f471487f
No related branches found
No related tags found
No related merge requests found
...@@ -143,19 +143,7 @@ public: ...@@ -143,19 +143,7 @@ public:
} }
/// \brief Get the name of the called function (path-sensitive). /// \brief Get the name of the called function (path-sensitive).
StringRef getCalleeName(const CallExpr *CE) { 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();
}
private: private:
ExplodedNode *addTransitionImpl(const ProgramState *State, ExplodedNode *addTransitionImpl(const ProgramState *State,
......
...@@ -11,6 +11,7 @@ add_clang_library(clangStaticAnalyzerCore ...@@ -11,6 +11,7 @@ add_clang_library(clangStaticAnalyzerCore
BugReporter.cpp BugReporter.cpp
BugReporterVisitors.cpp BugReporterVisitors.cpp
Checker.cpp Checker.cpp
CheckerContext.cpp
CheckerHelpers.cpp CheckerHelpers.cpp
CheckerManager.cpp CheckerManager.cpp
CheckerRegistry.cpp CheckerRegistry.cpp
......
//== 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();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment