From 0a23d76999f838257f70bd43dc7f1e2242147609 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sat, 12 Sep 2009 23:06:21 +0000 Subject: Don't use the PredefinedExpr string as the global variable name, these don't make very nice symbols, just use the function name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81653 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/CGExpr.cpp') diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 92e87826a2..fe43627006 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -841,11 +841,15 @@ LValue CodeGenFunction::EmitPredefinedFunctionName(unsigned Type) { break; } + llvm::StringRef FnName = CurFn->getName(); + if (FnName.startswith("\01")) + FnName = FnName.substr(1); + GlobalVarName += FnName; + std::string FunctionName = PredefinedExpr::ComputeName(getContext(), (PredefinedExpr::IdentType)Type, CurCodeDecl); - GlobalVarName += FunctionName; llvm::Constant *C = CGM.GetAddrOfConstantCString(FunctionName, GlobalVarName.c_str()); return LValue::MakeAddr(C, 0); -- cgit v1.2.3