[cfe-commits] r72793 - in /cfe/trunk/lib/CodeGen: CGCXXTemp.cpp CodeGenFunction.h
Anders Carlsson
andersca at mac.com
Wed Jun 3 11:54:26 PDT 2009
Author: andersca
Date: Wed Jun 3 13:54:26 2009
New Revision: 72793
URL: http://llvm.org/viewvc/llvm-project?rev=72793&view=rev
Log:
Store more information about live temporaries. No functionality change for now.
Modified:
cfe/trunk/lib/CodeGen/CGCXXTemp.cpp
cfe/trunk/lib/CodeGen/CodeGenFunction.h
Modified: cfe/trunk/lib/CodeGen/CGCXXTemp.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCXXTemp.cpp?rev=72793&r1=72792&r2=72793&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCXXTemp.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCXXTemp.cpp Wed Jun 3 13:54:26 2009
@@ -17,7 +17,7 @@
void CodeGenFunction::PushCXXTemporary(const CXXTemporary *Temporary,
llvm::Value *Ptr) {
- LiveTemporaries.push_back(Temporary);
+ LiveTemporaries.push_back(CXXLiveTemporaryInfo(Temporary, Ptr, 0, 0));
// Make a cleanup scope and emit the destructor.
{
@@ -40,7 +40,7 @@
// Go through the temporaries backwards.
for (unsigned i = E->getNumTemporaries(); i != 0; --i) {
- assert(LiveTemporaries.back() == E->getTemporary(i - 1));
+ assert(LiveTemporaries.back().Temporary == E->getTemporary(i - 1));
LiveTemporaries.pop_back();
}
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=72793&r1=72792&r2=72793&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Wed Jun 3 13:54:26 2009
@@ -239,7 +239,30 @@
/// 'this' declaration.
ImplicitParamDecl *CXXThisDecl;
- llvm::SmallVector<const CXXTemporary*, 4> LiveTemporaries;
+ /// CXXLiveTemporaryInfo - Holds information about a live C++ temporary.
+ struct CXXLiveTemporaryInfo {
+ /// Temporary - The live temporary.
+ const CXXTemporary *Temporary;
+
+ /// ThisPtr - The pointer to the temporary.
+ llvm::Value *ThisPtr;
+
+ /// DtorBlock - The destructor block.
+ llvm::BasicBlock *DtorBlock;
+
+ /// CondPtr - If this is a conditional temporary, this is the pointer to
+ /// the condition variable that states whether the destructor should be
+ /// called or not.
+ llvm::Value *CondPtr;
+
+ CXXLiveTemporaryInfo(const CXXTemporary *temporary,
+ llvm::Value *thisptr, llvm::Value *condptr,
+ llvm::BasicBlock *dtorblock)
+ : Temporary(temporary), ThisPtr(thisptr), DtorBlock(dtorblock),
+ CondPtr(condptr) { }
+ };
+
+ llvm::SmallVector<CXXLiveTemporaryInfo, 4> LiveTemporaries;
public:
CodeGenFunction(CodeGenModule &cgm);
More information about the cfe-commits
mailing list