diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-07-10 22:07:52 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-07-10 22:07:52 +0000 |
commit | 852aa0d2c5d2d1faf2d77b5aa3c0848068a342c5 (patch) | |
tree | 479d6107f7b9d49e36af6eecacef6f06004202b2 /include/clang/Analysis/ProgramPoint.h | |
parent | 8d276d38c258dfc572586daf6c0e8f8fce249c0e (diff) |
[analyzer] Make CallEnter, CallExitBegin, and CallExitEnd not be StmtPoints
These ProgramPoints are used in inlining calls,
and not all calls have associated statements anymore.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160021 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Analysis/ProgramPoint.h')
-rw-r--r-- | include/clang/Analysis/ProgramPoint.h | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/include/clang/Analysis/ProgramPoint.h b/include/clang/Analysis/ProgramPoint.h index 4dcf92e7f2..5de06cd3a5 100644 --- a/include/clang/Analysis/ProgramPoint.h +++ b/include/clang/Analysis/ProgramPoint.h @@ -49,12 +49,12 @@ public: PostStoreKind, PostConditionKind, PostLValueKind, + MinPostStmtKind = PostStmtKind, + MaxPostStmtKind = PostLValueKind, PostInitializerKind, CallEnterKind, CallExitBeginKind, CallExitEndKind, - MinPostStmtKind = PostStmtKind, - MaxPostStmtKind = CallExitEndKind, PreImplicitCallKind, PostImplicitCallKind, MinImplicitCallKind = PreImplicitCallKind, @@ -461,11 +461,11 @@ public: }; /// Represents a point when we begin processing an inlined call. -class CallEnter : public StmtPoint { +class CallEnter : public ProgramPoint { public: CallEnter(const Stmt *stmt, const StackFrameContext *calleeCtx, const LocationContext *callerCtx) - : StmtPoint(stmt, calleeCtx, CallEnterKind, callerCtx, 0) {} + : ProgramPoint(stmt, calleeCtx, CallEnterKind, callerCtx, 0) {} const Stmt *getCallExpr() const { return static_cast<const Stmt *>(getData1()); @@ -489,11 +489,11 @@ public: /// - Bind the return value /// - Run Remove dead bindings (to clean up the dead symbols from the callee). /// - CallExitEnd -class CallExitBegin : public StmtPoint { +class CallExitBegin : public ProgramPoint { public: // CallExitBegin uses the callee's location context. - CallExitBegin(const Stmt *S, const LocationContext *L) - : StmtPoint(S, 0, CallExitBeginKind, L, 0) {} + CallExitBegin(const StackFrameContext *L) + : ProgramPoint(0, CallExitBeginKind, L, 0) {} static bool classof(const ProgramPoint *Location) { return Location->getKind() == CallExitBeginKind; @@ -502,11 +502,16 @@ public: /// Represents a point when we finish the call exit sequence (for inlined call). /// \sa CallExitBegin -class CallExitEnd : public StmtPoint { +class CallExitEnd : public ProgramPoint { public: // CallExitEnd uses the caller's location context. - CallExitEnd(const Stmt *S, const LocationContext *L) - : StmtPoint(S, 0, CallExitEndKind, L, 0) {} + CallExitEnd(const StackFrameContext *CalleeCtx, + const LocationContext *CallerCtx) + : ProgramPoint(CalleeCtx, CallExitEndKind, CallerCtx, 0) {} + + const StackFrameContext *getCalleeContext() const { + return static_cast<const StackFrameContext *>(getData1()); + } static bool classof(const ProgramPoint *Location) { return Location->getKind() == CallExitEndKind; |