]> granicus.if.org Git - clang/commitdiff
Two minor fixes to user-defined literals:
authorSean Hunt <scshunt@csclub.uwaterloo.ca>
Mon, 30 Aug 2010 09:27:16 +0000 (09:27 +0000)
committerSean Hunt <scshunt@csclub.uwaterloo.ca>
Mon, 30 Aug 2010 09:27:16 +0000 (09:27 +0000)
 - Zero-initialize UDLData so that crashes stop
 - Stop complaining that we can't emit them (we most certainly can)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112467 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Lex/Token.h
lib/CodeGen/CGExprScalar.cpp

index f2954111878ee7419299ec3fe691a50f0513a305..b4639cf50b6fe72af052e6afd2b3163b2ef97ae4 100644 (file)
@@ -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);
   }
 
index dd881350c63ba56fddc346867ec3b87a3fbdd6ec..0680428e901c19d87eec44d4f1f3a01736028859 100644 (file)
@@ -210,6 +210,9 @@ public:
 
     return CGF.EmitCallExpr(E).getScalarVal();
   }
+  Value *VisitUDLiteralExpr(const UDLiteralExpr *E) {
+    return VisitCallExpr(E);
+  }
 
   Value *VisitStmtExpr(const StmtExpr *E);