Revert errant deletion. The target needs to be able to specify that it doesn't want...
authorJim Grosbach <grosbach@apple.com>
Thu, 30 Oct 2008 23:44:39 +0000 (23:44 +0000)
committerJim Grosbach <grosbach@apple.com>
Thu, 30 Oct 2008 23:44:39 +0000 (23:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58475 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetJITInfo.h
lib/ExecutionEngine/JIT/JITEmitter.cpp

index 142f0efbd3f5f71e3c22df8f8192ae7056a4589c..09ef15eb49f1f6aea16b2142675aa1b0df2175eb 100644 (file)
@@ -107,6 +107,9 @@ namespace llvm {
     // JIT to manage a GOT for it.
     bool needsGOT() const { return useGOT; }
 
+    /// hasCustomConstantPool - Allows a target to specify that constant
+    /// pool address resolution is handled by the target.
+    virtual bool hasCustomConstantPool() const { return false; }
   protected:
     bool useGOT;
   };
index 73346fe99e53e969d655505c201a28184939154d..9f020e3ae37f6ecb68dbca9e1900af047c363d07 100644 (file)
@@ -1013,6 +1013,11 @@ void* JITEmitter::allocateSpace(intptr_t Size, unsigned Alignment) {
 }
 
 void JITEmitter::emitConstantPool(MachineConstantPool *MCP) {
+  if (TheJIT->getJITInfo().hasCustomConstantPool()) {
+    DOUT << "JIT: Target has custom constant pool handling. Omitting standard "
+            "constant pool\n";
+    return;
+  }
   const std::vector<MachineConstantPoolEntry> &Constants = MCP->getConstants();
   if (Constants.empty()) return;