Author: coppro
Date: Mon Aug 30 04:27:16 2010
New Revision: 112467

URL: http://llvm.org/viewvc/llvm-project?rev=112467&view=rev
Log:
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)

Modified:
    cfe/trunk/include/clang/Lex/Token.h
    cfe/trunk/lib/CodeGen/CGExprScalar.cpp

Modified: cfe/trunk/include/clang/Lex/Token.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Token.h?rev=112467&r1=112466&r2=112467&view=diff
==============================================================================
--- cfe/trunk/include/clang/Lex/Token.h (original)
+++ cfe/trunk/include/clang/Lex/Token.h Mon Aug 30 04:27:16 2010
@@ -145,7 +145,7 @@
 
   /// 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);
   }
 

Modified: cfe/trunk/lib/CodeGen/CGExprScalar.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprScalar.cpp?rev=112467&r1=112466&r2=112467&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Mon Aug 30 04:27:16 2010
@@ -210,6 +210,9 @@
 
     return CGF.EmitCallExpr(E).getScalarVal();
   }
+  Value *VisitUDLiteralExpr(const UDLiteralExpr *E) {
+    return VisitCallExpr(E);
+  }
 
   Value *VisitStmtExpr(const StmtExpr *E);
 


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to