[llvm-commits] [llvm] r62336 - /llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp

Evan Cheng evan.cheng at apple.com
Fri Jan 16 11:14:49 PST 2009


Author: evancheng
Date: Fri Jan 16 13:14:49 2009
New Revision: 62336

URL: http://llvm.org/viewvc/llvm-project?rev=62336&view=rev
Log:
Change isGVCompilationDisabled() semantics again. It should abort on any GV that's not constant whether it's "internal" or not. In a server / client environment, GV is returned in the same block of memory as code. However, the memory might not be writable.

Modified:
    llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp

Modified: llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp?rev=62336&r1=62335&r2=62336&view=diff

==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/JIT.cpp Fri Jan 16 13:14:49 2009
@@ -554,7 +554,10 @@
     addGlobalMapping(GV, Ptr);
     }
   } else {
-    if (isGVCompilationDisabled() && !GV->hasLocalLinkage()) {
+    // GlobalVariable's which are not "constant" will cause trouble in a server
+    // situation. It's returned in the same block of memory as code which may
+    // not be writable.
+    if (isGVCompilationDisabled() && !GV->isConstant()) {
       cerr << "Compilation of non-internal GlobalValue is disabled!\n";
       abort();
     }





More information about the llvm-commits mailing list