aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Checker/PathSensitive
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2010-11-24 13:08:51 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2010-11-24 13:08:51 +0000
commitd706434b0231c76fd9acf30060646a7aa8f69aef (patch)
tree84ea6bde3550736b956941dfe3ed50fb377cf1ee /include/clang/Checker/PathSensitive
parent13cf5e2e223ebfc8ec0459913b2fc9ec1e5fa760 (diff)
Let StackFrameContext represent if the call expr is evaluated as lvalue.
This is required for supporting const reference to temporary objects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120093 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Checker/PathSensitive')
-rw-r--r--include/clang/Checker/PathSensitive/AnalysisManager.h17
-rw-r--r--include/clang/Checker/PathSensitive/GRExprEngine.h11
2 files changed, 18 insertions, 10 deletions
diff --git a/include/clang/Checker/PathSensitive/AnalysisManager.h b/include/clang/Checker/PathSensitive/AnalysisManager.h
index 79d9903890..ce33269da0 100644
--- a/include/clang/Checker/PathSensitive/AnalysisManager.h
+++ b/include/clang/Checker/PathSensitive/AnalysisManager.h
@@ -178,23 +178,24 @@ public:
const StackFrameContext *getStackFrame(AnalysisContext *Ctx,
LocationContext const *Parent,
- Stmt const *S, const CFGBlock *Blk,
- unsigned Idx) {
- return LocCtxMgr.getStackFrame(Ctx, Parent, S, Blk, Idx);
+ const Stmt *S, bool asLValue,
+ const CFGBlock *Blk, unsigned Idx) {
+ return LocCtxMgr.getStackFrame(Ctx, Parent, S, asLValue, Blk, Idx);
}
// Get the top level stack frame.
const StackFrameContext *getStackFrame(Decl const *D,
idx::TranslationUnit *TU) {
- return LocCtxMgr.getStackFrame(AnaCtxMgr.getContext(D, TU), 0, 0, 0, 0);
+ return LocCtxMgr.getStackFrame(AnaCtxMgr.getContext(D, TU), 0, 0, 0, 0, 0);
}
// Get a stack frame with parent.
- StackFrameContext const *getStackFrame(Decl const *D,
+ StackFrameContext const *getStackFrame(const Decl *D,
LocationContext const *Parent,
- Stmt const *S, const CFGBlock *Blk,
- unsigned Idx) {
- return LocCtxMgr.getStackFrame(AnaCtxMgr.getContext(D), Parent, S, Blk,Idx);
+ const Stmt *S, bool asLValue,
+ const CFGBlock *Blk, unsigned Idx) {
+ return LocCtxMgr.getStackFrame(AnaCtxMgr.getContext(D), Parent, S, asLValue,
+ Blk,Idx);
}
};
diff --git a/include/clang/Checker/PathSensitive/GRExprEngine.h b/include/clang/Checker/PathSensitive/GRExprEngine.h
index 04fce44480..4e97b8ee2e 100644
--- a/include/clang/Checker/PathSensitive/GRExprEngine.h
+++ b/include/clang/Checker/PathSensitive/GRExprEngine.h
@@ -424,9 +424,16 @@ public:
void VisitCXXThisExpr(const CXXThisExpr *TE, ExplodedNode *Pred,
ExplodedNodeSet & Dst);
-
+
+ void VisitCXXTemporaryObjectExpr(const CXXTemporaryObjectExpr *expr,
+ ExplodedNode *Pred, ExplodedNodeSet &Dst,
+ bool asLValue) {
+ VisitCXXConstructExpr(expr, 0, Pred, Dst, asLValue);
+ }
+
void VisitCXXConstructExpr(const CXXConstructExpr *E, const MemRegion *Dest,
- ExplodedNode *Pred, ExplodedNodeSet &Dst);
+ ExplodedNode *Pred, ExplodedNodeSet &Dst,
+ bool asLValue);
void VisitCXXDestructor(const CXXDestructorDecl *DD,
const MemRegion *Dest, const Stmt *S,