fix PR5869: mangle static symbols like gcc does to make it easier to diff symbol tables

llvm-svn: 92911
This commit is contained in:
Nuno Lopes 2010-01-07 09:36:51 +00:00
parent 1949de7b81
commit 950d5b2cd3
2 changed files with 10 additions and 2 deletions

View File

@ -199,10 +199,13 @@ void CXXNameMangler::mangle(const NamedDecl *D, llvm::StringRef Prefix) {
return;
}
// <mangled-name> ::= _Z <encoding>
// <mangled-name> ::= _Z [L] <encoding>
// ::= <data name>
// ::= <special-name>
Out << Prefix;
if (D->getLinkage() == NamedDecl::InternalLinkage) // match gcc behavior
Out << 'L';
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
mangleFunctionEncoding(FD);
else

View File

@ -308,4 +308,9 @@ template class Alloc<char>;
}
// CHECK: define void @_Z1fU13block_pointerFiiiE
void f(int (^)(int, int)) { }
void f(int (^)(int, int)) { }
// PR5869
// CHECK: define internal void @_ZL2f2v
static void f2() {}
void f3() { f2(); }