forked from OSchip/llvm-project
Revert r133516 "Remove some unnecessary uses of c_str()."
This was causing compile-time failures for some of the Objc and Obj-C++ benchmarks. The specific errors were of the form: "ld: duplicate symbol …" rdar://9660124 llvm-svn: 133955
This commit is contained in:
parent
71eabde2f8
commit
e967eefa00
|
@ -208,7 +208,7 @@ void LTOModule::addObjCClass(GlobalVariable *clgv) {
|
|||
if (objcClassNameFromExpression(c->getOperand(1), superclassName)) {
|
||||
NameAndAttributes info;
|
||||
StringMap<NameAndAttributes>::value_type &entry =
|
||||
_undefines.GetOrCreateValue(superclassName);
|
||||
_undefines.GetOrCreateValue(superclassName.c_str());
|
||||
if (!entry.getValue().name) {
|
||||
const char *symbolName = entry.getKey().data();
|
||||
info.name = symbolName;
|
||||
|
@ -220,7 +220,7 @@ void LTOModule::addObjCClass(GlobalVariable *clgv) {
|
|||
std::string className;
|
||||
if (objcClassNameFromExpression(c->getOperand(2), className)) {
|
||||
StringSet::value_type &entry =
|
||||
_defines.GetOrCreateValue(className);
|
||||
_defines.GetOrCreateValue(className.c_str());
|
||||
entry.setValue(1);
|
||||
NameAndAttributes info;
|
||||
info.name = entry.getKey().data();
|
||||
|
@ -243,7 +243,7 @@ void LTOModule::addObjCCategory(GlobalVariable *clgv) {
|
|||
NameAndAttributes info;
|
||||
|
||||
StringMap<NameAndAttributes>::value_type &entry =
|
||||
_undefines.GetOrCreateValue(targetclassName);
|
||||
_undefines.GetOrCreateValue(targetclassName.c_str());
|
||||
|
||||
if (entry.getValue().name)
|
||||
return;
|
||||
|
@ -264,7 +264,7 @@ void LTOModule::addObjCClassRef(GlobalVariable *clgv) {
|
|||
NameAndAttributes info;
|
||||
|
||||
StringMap<NameAndAttributes>::value_type &entry =
|
||||
_undefines.GetOrCreateValue(targetclassName);
|
||||
_undefines.GetOrCreateValue(targetclassName.c_str());
|
||||
if (entry.getValue().name)
|
||||
return;
|
||||
|
||||
|
@ -375,7 +375,7 @@ void LTOModule::addDefinedSymbol(GlobalValue *def, Mangler &mangler,
|
|||
|
||||
// add to table of symbols
|
||||
NameAndAttributes info;
|
||||
StringSet::value_type &entry = _defines.GetOrCreateValue(Buffer);
|
||||
StringSet::value_type &entry = _defines.GetOrCreateValue(Buffer.c_str());
|
||||
entry.setValue(1);
|
||||
|
||||
StringRef Name = entry.getKey();
|
||||
|
@ -436,7 +436,7 @@ void LTOModule::addPotentialUndefinedSymbol(GlobalValue *decl,
|
|||
mangler.getNameWithPrefix(name, decl, false);
|
||||
|
||||
StringMap<NameAndAttributes>::value_type &entry =
|
||||
_undefines.GetOrCreateValue(name);
|
||||
_undefines.GetOrCreateValue(name.c_str());
|
||||
|
||||
// we already have the symbol
|
||||
if (entry.getValue().name)
|
||||
|
|
Loading…
Reference in New Issue