Index: llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp =================================================================== --- llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp +++ llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp @@ -241,8 +241,6 @@ JITDylibLookupFlags JDLookupFlags, const SymbolLookupSet &Symbols) { orc::SymbolMap NewSymbols; - bool HasGlobalPrefix = (GlobalPrefix != '\0'); - for (auto &KV : Symbols) { auto &Name = KV.first; @@ -252,11 +250,10 @@ if (Allow && !Allow(Name)) continue; - if (HasGlobalPrefix && (*Name).front() != GlobalPrefix) - continue; + bool StripGlobalPrefix = (GlobalPrefix != '\0' && (*Name).front() == GlobalPrefix); - std::string Tmp((*Name).data() + HasGlobalPrefix, - (*Name).size() - HasGlobalPrefix); + std::string Tmp((*Name).data() + StripGlobalPrefix, + (*Name).size() - StripGlobalPrefix); if (void *Addr = Dylib.getAddressOfSymbol(Tmp.c_str())) { NewSymbols[Name] = JITEvaluatedSymbol( static_cast(reinterpret_cast(Addr)),