forked from OSchip/llvm-project
[ORC] Avoid more SymbolStringPtr copies.
This commit is contained in:
parent
d27e4bcebd
commit
2ca81cd914
|
@ -63,7 +63,6 @@ getMachOObjectFileSymbolInfo(ExecutionSession &ES,
|
||||||
auto Name = Sym.getName();
|
auto Name = Sym.getName();
|
||||||
if (!Name)
|
if (!Name)
|
||||||
return Name.takeError();
|
return Name.takeError();
|
||||||
auto InternedName = ES.intern(*Name);
|
|
||||||
auto SymFlags = JITSymbolFlags::fromObjectSymbol(Sym);
|
auto SymFlags = JITSymbolFlags::fromObjectSymbol(Sym);
|
||||||
if (!SymFlags)
|
if (!SymFlags)
|
||||||
return SymFlags.takeError();
|
return SymFlags.takeError();
|
||||||
|
@ -72,7 +71,7 @@ getMachOObjectFileSymbolInfo(ExecutionSession &ES,
|
||||||
if (Name->startswith("l"))
|
if (Name->startswith("l"))
|
||||||
*SymFlags &= ~JITSymbolFlags::Exported;
|
*SymFlags &= ~JITSymbolFlags::Exported;
|
||||||
|
|
||||||
I.SymbolFlags[InternedName] = std::move(*SymFlags);
|
I.SymbolFlags[ES.intern(*Name)] = std::move(*SymFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto &Sec : Obj.sections()) {
|
for (auto &Sec : Obj.sections()) {
|
||||||
|
@ -121,7 +120,7 @@ getELFObjectFileSymbolInfo(ExecutionSession &ES,
|
||||||
auto Name = Sym.getName();
|
auto Name = Sym.getName();
|
||||||
if (!Name)
|
if (!Name)
|
||||||
return Name.takeError();
|
return Name.takeError();
|
||||||
auto InternedName = ES.intern(*Name);
|
|
||||||
auto SymFlags = JITSymbolFlags::fromObjectSymbol(Sym);
|
auto SymFlags = JITSymbolFlags::fromObjectSymbol(Sym);
|
||||||
if (!SymFlags)
|
if (!SymFlags)
|
||||||
return SymFlags.takeError();
|
return SymFlags.takeError();
|
||||||
|
@ -130,7 +129,7 @@ getELFObjectFileSymbolInfo(ExecutionSession &ES,
|
||||||
if (Sym.getBinding() == ELF::STB_GNU_UNIQUE)
|
if (Sym.getBinding() == ELF::STB_GNU_UNIQUE)
|
||||||
*SymFlags |= JITSymbolFlags::Weak;
|
*SymFlags |= JITSymbolFlags::Weak;
|
||||||
|
|
||||||
I.SymbolFlags[InternedName] = std::move(*SymFlags);
|
I.SymbolFlags[ES.intern(*Name)] = std::move(*SymFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
SymbolStringPtr InitSymbol;
|
SymbolStringPtr InitSymbol;
|
||||||
|
@ -175,12 +174,12 @@ getGenericObjectFileSymbolInfo(ExecutionSession &ES,
|
||||||
auto Name = Sym.getName();
|
auto Name = Sym.getName();
|
||||||
if (!Name)
|
if (!Name)
|
||||||
return Name.takeError();
|
return Name.takeError();
|
||||||
auto InternedName = ES.intern(*Name);
|
|
||||||
auto SymFlags = JITSymbolFlags::fromObjectSymbol(Sym);
|
auto SymFlags = JITSymbolFlags::fromObjectSymbol(Sym);
|
||||||
if (!SymFlags)
|
if (!SymFlags)
|
||||||
return SymFlags.takeError();
|
return SymFlags.takeError();
|
||||||
|
|
||||||
I.SymbolFlags[InternedName] = std::move(*SymFlags);
|
I.SymbolFlags[ES.intern(*Name)] = std::move(*SymFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
return I;
|
return I;
|
||||||
|
|
Loading…
Reference in New Issue