diff options
author | Alexis Hunt <alercah@gmail.com> | 2010-08-30 09:27:16 +0000 |
---|---|---|
committer | Alexis Hunt <alercah@gmail.com> | 2010-08-30 09:27:16 +0000 |
commit | e3675ef0f36b33c9f22aa09a28479a24587155b0 (patch) | |
tree | d9a2411158db781d67342055a93d27ffef7061a3 /clang | |
parent | 9ed87ba797f0ce88ae173b4e2126b64a40525582 (diff) | |
download | bcm5719-llvm-e3675ef0f36b33c9f22aa09a28479a24587155b0.tar.gz bcm5719-llvm-e3675ef0f36b33c9f22aa09a28479a24587155b0.zip |
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
Diffstat (limited to 'clang')
-rw-r--r-- | clang/include/clang/Lex/Token.h | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGExprScalar.cpp | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/clang/include/clang/Lex/Token.h b/clang/include/clang/Lex/Token.h index f2954111878..b4639cf50b6 100644 --- a/clang/include/clang/Lex/Token.h +++ b/clang/include/clang/Lex/Token.h @@ -145,7 +145,7 @@ public: /// makeUserDefinedLiteral - Set this token to be a user-defined literal void makeUserDefinedLiteral(llvm::BumpPtrAllocator &Alloc) { - PtrData = new (Alloc.Allocate(sizeof(UDLData), 4)) UDLData; + PtrData = new (Alloc.Allocate(sizeof(UDLData), 4)) UDLData(); setFlag(UserDefinedLiteral); } diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index dd881350c63..0680428e901 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -210,6 +210,9 @@ public: return CGF.EmitCallExpr(E).getScalarVal(); } + Value *VisitUDLiteralExpr(const UDLiteralExpr *E) { + return VisitCallExpr(E); + } Value *VisitStmtExpr(const StmtExpr *E); |