aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker/CallInliner.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2010-07-19 01:31:21 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2010-07-19 01:31:21 +0000
commitc6238d2786cfd961b94580b3d3675a1b3ff0721c (patch)
tree22875d45e9365f67986a5d837d2c886788f192f5 /lib/Checker/CallInliner.cpp
parent0bbad519aa068206f1e158d5073f72a39fbe83c5 (diff)
Reapply r108617.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108668 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/CallInliner.cpp')
-rw-r--r--lib/Checker/CallInliner.cpp54
1 files changed, 0 insertions, 54 deletions
diff --git a/lib/Checker/CallInliner.cpp b/lib/Checker/CallInliner.cpp
index c47e06c78f..e69de29bb2 100644
--- a/lib/Checker/CallInliner.cpp
+++ b/lib/Checker/CallInliner.cpp
@@ -1,54 +0,0 @@
-//===--- CallInliner.cpp - Transfer function that inlines callee ----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file implements the callee inlining transfer function.
-//
-//===----------------------------------------------------------------------===//
-
-#include "clang/Checker/PathSensitive/CheckerVisitor.h"
-#include "clang/Checker/PathSensitive/GRState.h"
-#include "clang/Checker/Checkers/LocalCheckers.h"
-
-using namespace clang;
-
-namespace {
-class CallInliner : public Checker {
-public:
- static void *getTag() {
- static int x;
- return &x;
- }
-
- virtual bool EvalCallExpr(CheckerContext &C, const CallExpr *CE);
-};
-}
-
-void clang::RegisterCallInliner(GRExprEngine &Eng) {
- Eng.registerCheck(new CallInliner());
-}
-
-bool CallInliner::EvalCallExpr(CheckerContext &C, const CallExpr *CE) {
- const GRState *state = C.getState();
- const Expr *Callee = CE->getCallee();
- SVal L = state->getSVal(Callee);
-
- const FunctionDecl *FD = L.getAsFunctionDecl();
- if (!FD)
- return false;
-
- if (!FD->hasBody(FD))
- return false;
-
- // Now we have the definition of the callee, create a CallEnter node.
- CallEnter Loc(CE, FD, C.getPredecessor()->getLocationContext());
- C.addTransition(state, Loc);
-
- return true;
-}
-