Small fixes to CXXTemporary and CXXBindTemporaryExpr.

llvm-svn: 72628
This commit is contained in:
Anders Carlsson 2009-05-30 20:34:37 +00:00
parent 993a4b3080
commit ffda606612
2 changed files with 6 additions and 5 deletions

View File

@ -415,13 +415,14 @@ public:
/// CXXTemporary - Represents a C++ temporary. /// CXXTemporary - Represents a C++ temporary.
class CXXTemporary { class CXXTemporary {
/// Destructor - The destructor that needs to be called. /// Destructor - The destructor that needs to be called.
CXXDestructorDecl *Destructor; const CXXDestructorDecl *Destructor;
CXXTemporary(CXXDestructorDecl *destructor) CXXTemporary(const CXXDestructorDecl *destructor)
: Destructor(destructor) { } : Destructor(destructor) { }
public: public:
static CXXTemporary *Create(ASTContext &C, CXXDestructorDecl *Destructor); static CXXTemporary *Create(ASTContext &C,
const CXXDestructorDecl *Destructor);
}; };
/// CXXBindTemporaryExpr - Represents binding an expression to a temporary, /// CXXBindTemporaryExpr - Represents binding an expression to a temporary,

View File

@ -237,7 +237,7 @@ const char *CXXNamedCastExpr::getCastName() const {
} }
CXXTemporary *CXXTemporary::Create(ASTContext &C, CXXTemporary *CXXTemporary::Create(ASTContext &C,
CXXDestructorDecl *Destructor) { const CXXDestructorDecl *Destructor) {
// FIXME: Allocate using the ASTContext. // FIXME: Allocate using the ASTContext.
return new CXXTemporary(Destructor); return new CXXTemporary(Destructor);
} }
@ -248,7 +248,7 @@ CXXBindTemporaryExpr *CXXBindTemporaryExpr::Create(ASTContext &C,
assert(SubExpr->getType()->isRecordType() && assert(SubExpr->getType()->isRecordType() &&
"Expression bound to a temporary must have record type!"); "Expression bound to a temporary must have record type!");
return new CXXBindTemporaryExpr(Temp, SubExpr); return new (C) CXXBindTemporaryExpr(Temp, SubExpr);
} }
CXXTemporaryObjectExpr::CXXTemporaryObjectExpr(ASTContext &C, VarDecl *vd, CXXTemporaryObjectExpr::CXXTemporaryObjectExpr(ASTContext &C, VarDecl *vd,