summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-03-05 22:59:19 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-03-05 22:59:19 +0000
commitf804897ee94fe082cc840c5eca54ae6698324452 (patch)
tree6839cb2d7f63ac85cf5b248c3d9f927e85bdd45b /clang/lib/CodeGen/CodeGenModule.cpp
parent3add5e51ff569c38ce56b5a9a1f08a800960757e (diff)
downloadbcm5719-llvm-f804897ee94fe082cc840c5eca54ae6698324452.tar.gz
bcm5719-llvm-f804897ee94fe082cc840c5eca54ae6698324452.zip
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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index a187f8a51bb..3f930feaaa0 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/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())
OpenPOWER on IntegriCloud