aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Interpreter/Interpreter.cpp
diff options
context:
space:
mode:
authorJeaye Wilkerson <contact@jeaye.com>2025-09-12 08:34:14 -0700
committerGitHub <noreply@github.com>2025-09-12 18:34:14 +0300
commit7ebfcbd0ec525810d3874b5826ac1cb53f14c6e4 (patch)
treec4072b6b991d2b0cbf1452e6155dc9337da4684e /clang/lib/Interpreter/Interpreter.cpp
parentbe587941c22f16df6fb2053cc06cf91c5a378613 (diff)
downloadllvm-7ebfcbd0ec525810d3874b5826ac1cb53f14c6e4.zip
llvm-7ebfcbd0ec525810d3874b5826ac1cb53f14c6e4.tar.gz
llvm-7ebfcbd0ec525810d3874b5826ac1cb53f14c6e4.tar.bz2
Allow for custom code model in clang::Interpreter (#156977)
This is necessary when using ASan, since the larger code size will lead to errors such as: ``` JIT session error: In graph clojure_core-clojure.core$clojure_core_cpp_cast_24538-24543-jitted-objectbuffer, section .eh_frame: relocation target 0x7bffe374b000 (DW.ref.__gxx_personality_v0) is out of range of Delta32 fixup at address 0x7bffe374b000 (<anonymous block> @ 0x7fffebf48158 + 0x13) ``` Previously, `clang::Interpreter` would hard-code the usage of a small code model. With this change, we default to small, but allow for custom values. This related to #102858 and #135401. There is no change to default behavior here. @lhames for review.
Diffstat (limited to 'clang/lib/Interpreter/Interpreter.cpp')
-rw-r--r--clang/lib/Interpreter/Interpreter.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Interpreter/Interpreter.cpp b/clang/lib/Interpreter/Interpreter.cpp
index 043e0c1..84f1c36 100644
--- a/clang/lib/Interpreter/Interpreter.cpp
+++ b/clang/lib/Interpreter/Interpreter.cpp
@@ -647,6 +647,8 @@ llvm::Error Interpreter::CreateExecutor(JITConfig Config) {
auto JTMB = createJITTargetMachineBuilder(TT);
if (!JTMB)
return JTMB.takeError();
+ if (Config.CM)
+ JTMB->setCodeModel(Config.CM);
auto JB = IncrementalExecutor::createDefaultJITBuilder(std::move(*JTMB));
if (!JB)
return JB.takeError();