Skip to content

Commit

Permalink
Simplify mangling by using mangleAndIntern
Browse files Browse the repository at this point in the history
  • Loading branch information
devajithvs authored and jenkins committed Jun 26, 2024
1 parent 48788e4 commit 900be1d
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions lib/Interpreter/IncrementalJIT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,21 +648,11 @@ IncrementalJIT::addOrReplaceDefinition(StringRef Name,
if (Symbol && (JITTargetAddress)Symbol == KnownAddr)
return KnownAddr;

llvm::SmallString<128> LinkerMangledName;
char LinkerPrefix = this->m_TM->createDataLayout().getGlobalPrefix();
bool HasLinkerPrefix = LinkerPrefix != '\0';
if (HasLinkerPrefix && Name.front() == LinkerPrefix) {
LinkerMangledName.assign(1, LinkerPrefix);
LinkerMangledName.append(Name);
} else {
LinkerMangledName.assign(Name);
}

// Let's inject it
bool Inserted;
SymbolMap::iterator It;
std::tie(It, Inserted) = m_InjectedSymbols.try_emplace(
Jit->getExecutionSession().intern(LinkerMangledName),
Jit->mangleAndIntern(Name),
JITEvaluatedSymbol(KnownAddr, JITSymbolFlags::Exported));
assert(Inserted && "Why wasn't this found in the initial Jit lookup?");

Expand Down

0 comments on commit 900be1d

Please sign in to comment.