From: Sean Hunt Date: Mon, 30 Aug 2010 09:27:16 +0000 (+0000) Subject: Two minor fixes to user-defined literals: X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=75b8508380e6d44276a8fafe5cafcedb9cf532d3;p=clang 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) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112467 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Lex/Token.h b/include/clang/Lex/Token.h index f295411187..b4639cf50b 100644 --- a/include/clang/Lex/Token.h +++ b/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/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index dd881350c6..0680428e90 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/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);