From 446531e7bb4355117b070493ca8e81e4b123ef18 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Wed, 24 Sep 2008 16:25:55 +0000 Subject: Add DisableGVCompilation which forces the JIT to assert when it tries to allocate space for a GlobalVariable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56557 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ExecutionEngine/ExecutionEngine.cpp | 1 + lib/ExecutionEngine/JIT/JIT.cpp | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'lib/ExecutionEngine') diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index 52a69ea..8cc2244 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -40,6 +40,7 @@ ExecutionEngine::EERegisterFn ExecutionEngine::ExceptionTableRegister = 0; ExecutionEngine::ExecutionEngine(ModuleProvider *P) : LazyFunctionCreator(0) { LazyCompilationDisabled = false; + GVCompilationDisabled = false; SymbolSearchingDisabled = false; Modules.push_back(P); assert(P && "ModuleProvider is null?"); diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index 39ecc27..383b380 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/lib/ExecutionEngine/JIT/JIT.cpp @@ -552,6 +552,10 @@ void *JIT::getOrEmitGlobalVariable(const GlobalVariable *GV) { addGlobalMapping(GV, Ptr); } } else { + if (isGVCompilationDisabled()) { + cerr << "Compilation of GlobalVariable is disabled!\n"; + abort(); + } // If the global hasn't been emitted to memory yet, allocate space and // emit it into memory. It goes in the same array as the generated // code, jump tables, etc. -- cgit v1.1