[ORC] Merge redundant jitlink::Symbol -> JITSymbolFlags mappings.
authorLang Hames <lhames@gmail.com>
Wed, 1 Feb 2023 22:48:46 +0000 (14:48 -0800)
committerLang Hames <lhames@gmail.com>
Thu, 2 Feb 2023 00:39:54 +0000 (16:39 -0800)
commit2aa85ecaf61dc88a3bb444e7d29855784ff432bf
tree0028b5624dc01a59c14e31a57477cd23b1a865b7
parenteb3be66028eac88098e0186cff80e0421949dd69
[ORC] Merge redundant jitlink::Symbol -> JITSymbolFlags mappings.

Adds a getJITSymbolFlagsForSymbol function that returns the JITSymbolFlags
for a given jitlink::Symbol, and replaces severalredundant copies of that
mapping with calls to the new function. This fixes a bug in
LinkGraphMaterializationUnit::scanLinkGraph where we were failing to set the
JITSymbolFlags::Weak flag for weak symbols, and a bug in
ObjectLinkingLayer::claimOrExternalizeWeakAndCommonSymbols where we were
failing to set the JITSymbolFlags::Callable flag for callable symbols.
llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
llvm/unittests/ExecutionEngine/Orc/ObjectLinkingLayerTest.cpp