Attempt to make FreeBSD buildbot green.

It seems that __cxa_demangle function on the buildbot tried to demangle
a variable "tlsvar" as a C++ symbol. Do not call that function unless
it does not start with "_Z" which is the prefix of mangled names.

llvm-svn: 257661
This commit is contained in:
Rui Ueyama 2016-01-13 19:40:13 +00:00
parent aae49c1944
commit 5fa978b4c0
1 changed files with 5 additions and 0 deletions

View File

@ -145,6 +145,11 @@ std::string elf2::demangle(StringRef Name) {
#else
if (!Config->Demangle)
return Name;
// Return if it does not look like a C++ symbol.
if (!Name.startswith("_Z"))
return Name;
char *Buf =
abi::__cxa_demangle(Name.str().c_str(), nullptr, nullptr, nullptr);
if (!Buf)