Two minor fixes to user-defined literals:

- Zero-initialize UDLData so that crashes stop
 - Stop complaining that we can't emit them (we most certainly can)

llvm-svn: 112467
This commit is contained in:
Alexis Hunt 2010-08-30 09:27:16 +00:00
parent 9ed87ba797
commit e3675ef0f3
2 changed files with 4 additions and 1 deletions

View File

@ -145,7 +145,7 @@ public:
/// makeUserDefinedLiteral - Set this token to be a user-defined literal /// makeUserDefinedLiteral - Set this token to be a user-defined literal
void makeUserDefinedLiteral(llvm::BumpPtrAllocator &Alloc) { void makeUserDefinedLiteral(llvm::BumpPtrAllocator &Alloc) {
PtrData = new (Alloc.Allocate(sizeof(UDLData), 4)) UDLData; PtrData = new (Alloc.Allocate(sizeof(UDLData), 4)) UDLData();
setFlag(UserDefinedLiteral); setFlag(UserDefinedLiteral);
} }

View File

@ -210,6 +210,9 @@ public:
return CGF.EmitCallExpr(E).getScalarVal(); return CGF.EmitCallExpr(E).getScalarVal();
} }
Value *VisitUDLiteralExpr(const UDLiteralExpr *E) {
return VisitCallExpr(E);
}
Value *VisitStmtExpr(const StmtExpr *E); Value *VisitStmtExpr(const StmtExpr *E);