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.

llvm-svn: 66212
This commit is contained in:
Daniel Dunbar
2009-03-05 22:59:19 +00:00
parent 3add5e51ff
commit f804897ee9
3 changed files with 13 additions and 3 deletions

View File

@@ -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())