Let StackFrameContext represent if the call expr is evaluated as lvalue.

This is required for supporting const reference to temporary objects.

llvm-svn: 120093
This commit is contained in:
Zhongxing Xu
2010-11-24 13:08:51 +00:00
parent e0a1d2b32c
commit a1a9ba11b7
9 changed files with 83 additions and 39 deletions

View File

@@ -152,7 +152,8 @@ void LocationContext::ProfileCommon(llvm::FoldingSetNodeID &ID,
}
void StackFrameContext::Profile(llvm::FoldingSetNodeID &ID) {
Profile(ID, getAnalysisContext(), getParent(), CallSite, Block, Index);
Profile(ID, getAnalysisContext(), getParent(), CallSite.getPointer(),
CallSite.getInt(), Block, Index);
}
void ScopeContext::Profile(llvm::FoldingSetNodeID &ID) {
@@ -188,15 +189,15 @@ LocationContextManager::getLocationContext(AnalysisContext *ctx,
const StackFrameContext*
LocationContextManager::getStackFrame(AnalysisContext *ctx,
const LocationContext *parent,
const Stmt *s, const CFGBlock *blk,
unsigned idx) {
const Stmt *s, bool asLValue,
const CFGBlock *blk, unsigned idx) {
llvm::FoldingSetNodeID ID;
StackFrameContext::Profile(ID, ctx, parent, s, blk, idx);
StackFrameContext::Profile(ID, ctx, parent, s, asLValue, blk, idx);
void *InsertPos;
StackFrameContext *L =
cast_or_null<StackFrameContext>(Contexts.FindNodeOrInsertPos(ID, InsertPos));
if (!L) {
L = new StackFrameContext(ctx, parent, s, blk, idx);
L = new StackFrameContext(ctx, parent, s, asLValue, blk, idx);
Contexts.InsertNode(L, InsertPos);
}
return L;