summaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp
diff options
context:
space:
mode:
authorJared Wyles <jared.wyles@gmail.com>2024-12-06 10:22:09 +1100
committerGitHub <noreply@github.com>2024-12-06 10:22:09 +1100
commit2ccf7ed277df28651b94bbee9fccefdf22fb074f (patch)
tree405004620d15dd1a13be2ce3d942ec898db79cba /llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp
parente6cf5d2863b77895ae7183952514bedd9e8dde16 (diff)
[JITLink] Switch to SymbolStringPtr for Symbol names (#115796)
Use SymbolStringPtr for Symbol names in LinkGraph. This reduces string interning on the boundary between JITLink and ORC, and allows pointer comparisons (rather than string comparisons) between Symbol names. This should improve the performance and readability of code that bridges between JITLink and ORC (e.g. ObjectLinkingLayer and ObjectLinkingLayer::Plugins). To enable use of SymbolStringPtr a std::shared_ptr<SymbolStringPool> is added to LinkGraph and threaded through to its construction sites in LLVM and Bolt. All LinkGraphs that are to have symbol names compared by pointer equality must point to the same SymbolStringPool instance, which in ORC sessions should be the pool attached to the ExecutionSession. --------- Co-authored-by: Lang Hames <lhames@gmail.com>
Diffstat (limited to 'llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp b/llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp
index 71221c2d3fce..0b2cafb0bff1 100644
--- a/llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp
@@ -129,7 +129,7 @@ getELFObjectFileSymbolInfo(ExecutionSession &ES,
if (Sym.getBinding() == ELF::STB_GNU_UNIQUE)
*SymFlags |= JITSymbolFlags::Weak;
- I.SymbolFlags[ES.intern(*Name)] = std::move(*SymFlags);
+ I.SymbolFlags[ES.intern(std::move(*Name))] = std::move(*SymFlags);
}
SymbolStringPtr InitSymbol;