[llvm] 2ca81cd - [ORC] Avoid more SymbolStringPtr copies.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Thu May 19 10:51:33 PDT 2022
Author: Lang Hames
Date: 2022-05-19T10:51:20-07:00
New Revision: 2ca81cd91486280b232a6be45858f757a8ea0870
URL: https://github.com/llvm/llvm-project/commit/2ca81cd91486280b232a6be45858f757a8ea0870
DIFF: https://github.com/llvm/llvm-project/commit/2ca81cd91486280b232a6be45858f757a8ea0870.diff
LOG: [ORC] Avoid more SymbolStringPtr copies.
Added:
Modified:
llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp b/llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp
index c1ad569dd65d..394a555e453b 100644
--- a/llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp
@@ -63,7 +63,6 @@ getMachOObjectFileSymbolInfo(ExecutionSession &ES,
auto Name = Sym.getName();
if (!Name)
return Name.takeError();
- auto InternedName = ES.intern(*Name);
auto SymFlags = JITSymbolFlags::fromObjectSymbol(Sym);
if (!SymFlags)
return SymFlags.takeError();
@@ -72,7 +71,7 @@ getMachOObjectFileSymbolInfo(ExecutionSession &ES,
if (Name->startswith("l"))
*SymFlags &= ~JITSymbolFlags::Exported;
- I.SymbolFlags[InternedName] = std::move(*SymFlags);
+ I.SymbolFlags[ES.intern(*Name)] = std::move(*SymFlags);
}
for (auto &Sec : Obj.sections()) {
@@ -121,7 +120,7 @@ getELFObjectFileSymbolInfo(ExecutionSession &ES,
auto Name = Sym.getName();
if (!Name)
return Name.takeError();
- auto InternedName = ES.intern(*Name);
+
auto SymFlags = JITSymbolFlags::fromObjectSymbol(Sym);
if (!SymFlags)
return SymFlags.takeError();
@@ -130,7 +129,7 @@ getELFObjectFileSymbolInfo(ExecutionSession &ES,
if (Sym.getBinding() == ELF::STB_GNU_UNIQUE)
*SymFlags |= JITSymbolFlags::Weak;
- I.SymbolFlags[InternedName] = std::move(*SymFlags);
+ I.SymbolFlags[ES.intern(*Name)] = std::move(*SymFlags);
}
SymbolStringPtr InitSymbol;
@@ -175,12 +174,12 @@ getGenericObjectFileSymbolInfo(ExecutionSession &ES,
auto Name = Sym.getName();
if (!Name)
return Name.takeError();
- auto InternedName = ES.intern(*Name);
+
auto SymFlags = JITSymbolFlags::fromObjectSymbol(Sym);
if (!SymFlags)
return SymFlags.takeError();
- I.SymbolFlags[InternedName] = std::move(*SymFlags);
+ I.SymbolFlags[ES.intern(*Name)] = std::move(*SymFlags);
}
return I;
More information about the llvm-commits
mailing list