From fe345572459b69a6b680322fef504b4f8bd98dd7 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 5 Mar 2009 22:59:19 +0000 Subject: Don't mangle names of local variables. - For one thing, this adds unneeded overhead; for another, this routine can be used to emit unnamed decls which we shouldn't try to mangle. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66212 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index a187f8a51b..3f930feaaa 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -170,8 +170,10 @@ static void setGlobalVisibility(llvm::GlobalValue *GV, const char *CodeGenModule::getMangledName(const NamedDecl *ND) { llvm::SmallString<256> Name; llvm::raw_svector_ostream Out(Name); - if (!mangleName(ND, Context, Out)) + if (!mangleName(ND, Context, Out)) { + assert(ND->getIdentifier() && "Attempt to mangle unnamed decl."); return ND->getIdentifier()->getName(); + } Name += '\0'; return MangledNames.GetOrCreateValue(Name.begin(), Name.end()) -- cgit v1.2.3