[clang] e6cd950 - Revert "[clang-repl] Adapt to the recent dylib-related changes in ORC."
Vassil Vassilev via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 29 12:34:35 PDT 2023
Author: Vassil Vassilev
Date: 2023-08-29T19:34:20Z
New Revision: e6cd950d1b4a07f8c339b6f55374e4aa229e42f7
URL: https://github.com/llvm/llvm-project/commit/e6cd950d1b4a07f8c339b6f55374e4aa229e42f7
DIFF: https://github.com/llvm/llvm-project/commit/e6cd950d1b4a07f8c339b6f55374e4aa229e42f7.diff
LOG: Revert "[clang-repl] Adapt to the recent dylib-related changes in ORC."
This reverts commit 196d8569d46dc5200c44e70cdf839b042148b988 while investigating
bot failure: https://lab.llvm.org/buildbot/#/builders/216/builds/26444
Added:
Modified:
clang/lib/Interpreter/IncrementalExecutor.cpp
clang/unittests/Interpreter/InterpreterTest.cpp
Removed:
################################################################################
diff --git a/clang/lib/Interpreter/IncrementalExecutor.cpp b/clang/lib/Interpreter/IncrementalExecutor.cpp
index 2c4dfc9a611e02..3f8d60630de417 100644
--- a/clang/lib/Interpreter/IncrementalExecutor.cpp
+++ b/clang/lib/Interpreter/IncrementalExecutor.cpp
@@ -92,19 +92,12 @@ llvm::Error IncrementalExecutor::runCtors() const {
llvm::Expected<llvm::orc::ExecutorAddr>
IncrementalExecutor::getSymbolAddress(llvm::StringRef Name,
SymbolNameKind NameKind) const {
- using namespace llvm::orc;
- auto SO = makeJITDylibSearchOrder({&Jit->getMainJITDylib(),
- Jit->getPlatformJITDylib().get(),
- Jit->getProcessSymbolsJITDylib().get()});
-
- ExecutionSession &ES = Jit->getExecutionSession();
-
- auto SymOrErr =
- ES.lookup(SO, (NameKind == LinkerName) ? ES.intern(Name)
- : Jit->mangleAndIntern(Name));
- if (auto Err = SymOrErr.takeError())
- return std::move(Err);
- return SymOrErr->getAddress();
+ auto Sym = (NameKind == LinkerName) ? Jit->lookupLinkerMangled(Name)
+ : Jit->lookup(Name);
+
+ if (!Sym)
+ return Sym.takeError();
+ return Sym;
}
} // end namespace clang
diff --git a/clang/unittests/Interpreter/InterpreterTest.cpp b/clang/unittests/Interpreter/InterpreterTest.cpp
index 0f546d275f82f1..1800bff153b713 100644
--- a/clang/unittests/Interpreter/InterpreterTest.cpp
+++ b/clang/unittests/Interpreter/InterpreterTest.cpp
@@ -234,16 +234,10 @@ TEST(IncrementalProcessing, FindMangledNameSymbol) {
}
std::string MangledName = MangleName(FD);
- auto Addr = Interp->getSymbolAddress(MangledName);
- EXPECT_FALSE(!Addr);
- EXPECT_NE(0U, Addr->getValue());
+ auto Addr = cantFail(Interp->getSymbolAddress(MangledName));
+ EXPECT_NE(0U, Addr.getValue());
GlobalDecl GD(FD);
- EXPECT_EQ(*Addr, cantFail(Interp->getSymbolAddress(GD)));
- cantFail(
- Interp->ParseAndExecute("extern \"C\" int printf(const char*,...);"));
- Addr = Interp->getSymbolAddress("printf");
- EXPECT_FALSE(!Addr);
- EXPECT_EQ((unsigned long long)&printf, Addr->getValue());
+ EXPECT_EQ(Addr, cantFail(Interp->getSymbolAddress(GD)));
}
static void *AllocateObject(TypeDecl *TD, Interpreter &Interp) {
More information about the cfe-commits
mailing list