From ef1860a117b4a35918eb9793a7b94715e12a3a42 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Fri, 11 Feb 2011 05:23:09 +0000 Subject: Remove std::string version of getNameWithPrefix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125363 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/lto/LTOCodeGenerator.cpp | 7 +++++-- tools/lto/LTOModule.cpp | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'tools/lto') diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp index 439bac1..d102f6b 100644 --- a/tools/lto/LTOCodeGenerator.cpp +++ b/tools/lto/LTOCodeGenerator.cpp @@ -350,16 +350,19 @@ void LTOCodeGenerator::applyScopeRestrictions() { MCContext Context(*_target->getMCAsmInfo(), NULL); Mangler mangler(Context, *_target->getTargetData()); std::vector mustPreserveList; + SmallString<64> Buffer; for (Module::iterator f = mergedModule->begin(), e = mergedModule->end(); f != e; ++f) { + mangler.getNameWithPrefix(Buffer, f, false); if (!f->isDeclaration() && - _mustPreserveSymbols.count(mangler.getNameWithPrefix(f))) + _mustPreserveSymbols.count(Buffer)) mustPreserveList.push_back(::strdup(f->getNameStr().c_str())); } for (Module::global_iterator v = mergedModule->global_begin(), e = mergedModule->global_end(); v != e; ++v) { + mangler.getNameWithPrefix(Buffer, v, false); if (!v->isDeclaration() && - _mustPreserveSymbols.count(mangler.getNameWithPrefix(v))) + _mustPreserveSymbols.count(Buffer)) mustPreserveList.push_back(::strdup(v->getNameStr().c_str())); } passes.add(createInternalizePass(mustPreserveList)); diff --git a/tools/lto/LTOModule.cpp b/tools/lto/LTOModule.cpp index ca937bf..8562f74 100644 --- a/tools/lto/LTOModule.cpp +++ b/tools/lto/LTOModule.cpp @@ -320,7 +320,9 @@ void LTOModule::addDefinedSymbol(GlobalValue *def, Mangler &mangler, return; // string is owned by _defines - const char *symbolName = ::strdup(mangler.getNameWithPrefix(def).c_str()); + SmallString<64> Buffer; + mangler.getNameWithPrefix(Buffer, def, false); + const char *symbolName = ::strdup(Buffer.c_str()); // set alignment part log2() can have rounding errors uint32_t align = def->getAlignment(); @@ -395,7 +397,8 @@ void LTOModule::addPotentialUndefinedSymbol(GlobalValue *decl, if (isa(decl)) return; - std::string name = mangler.getNameWithPrefix(decl); + SmallString<64> name; + mangler.getNameWithPrefix(name, decl, false); // we already have the symbol if (_undefines.find(name) != _undefines.end()) -- cgit v1.1