diff options
author | Devang Patel <dpatel@apple.com> | 2006-09-06 00:45:52 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2006-09-06 00:45:52 +0000 |
commit | ed872865d0316ec754d93f703dd39f21745e45ca (patch) | |
tree | caf2c4c9177c1b3a48685898bc4239a955f8862e /tools/lto | |
parent | 2681023488d70303ec788bc8a0a3f5336257830a (diff) | |
download | external_llvm-ed872865d0316ec754d93f703dd39f21745e45ca.zip external_llvm-ed872865d0316ec754d93f703dd39f21745e45ca.tar.gz external_llvm-ed872865d0316ec754d93f703dd39f21745e45ca.tar.bz2 |
Instead of demangling symbol name by hand, use original name, which was
used to mangle symbol name, directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30124 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lto')
-rw-r--r-- | tools/lto/lto.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp index df9634e..e49364e 100644 --- a/tools/lto/lto.cpp +++ b/tools/lto/lto.cpp @@ -147,6 +147,7 @@ LinkTimeOptimizer::readLLVMObjectFile(const std::string &InputFilename, LLVMSymbol *newSymbol = new LLVMSymbol(lt, v, v->getName(), mangler.getValueName(v)); symbols[newSymbol->getMangledName()] = newSymbol; + allSymbols[newSymbol->getMangledName()] = newSymbol; for (unsigned count = 0, total = v->getNumOperands(); count != total; ++count) @@ -291,8 +292,9 @@ LinkTimeOptimizer::optimizeModules(const std::string &OutputFilename, // seen by linker. for (unsigned i = 0, e = exportList.size(); i != e; ++i) { const char *name = exportList[i]; - if (strlen(name) > 2 && name[0] == '_') - exportList[i] = &name[1]; + NameToSymbolMap::iterator itr = allSymbols.find(name); + if (itr != allSymbols.end()) + exportList[i] = allSymbols[name]->getName(); } sys::Path tmpAsmFilePath("/tmp/"); |