forked from OSchip/llvm-project
[analyzer] Put CheckerConext::getCalleeName out of line.
llvm-svn: 144870
This commit is contained in:
parent
4f41440cf9
commit
871606d8de
|
@ -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,
|
||||
|
|
|
@ -11,6 +11,7 @@ add_clang_library(clangStaticAnalyzerCore
|
|||
BugReporter.cpp
|
||||
BugReporterVisitors.cpp
|
||||
Checker.cpp
|
||||
CheckerContext.cpp
|
||||
CheckerHelpers.cpp
|
||||
CheckerManager.cpp
|
||||
CheckerRegistry.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();
|
||||
}
|
Loading…
Reference in New Issue