aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86Subtarget.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2006-12-22 22:29:05 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2006-12-22 22:29:05 +0000
commit2b2bc688849234b9ee5e0c8704a2984f0e9cbba3 (patch)
tree104e48b07d554c7dc49aaf62c4ff2d56bae85ba0 /lib/Target/X86/X86Subtarget.cpp
parentee5f9274b925c59082e7ed7f5506bbb5af0d854b (diff)
Refactored JIT codegen for mingw32. Now we're using standart relocation
type for distinguish JIT & non-JIT instead of "dirty" hacks :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32745 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86Subtarget.cpp')
-rw-r--r--lib/Target/X86/X86Subtarget.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp
index 4ab8713427..05965c24cd 100644
--- a/lib/Target/X86/X86Subtarget.cpp
+++ b/lib/Target/X86/X86Subtarget.cpp
@@ -15,6 +15,7 @@
#include "X86GenSubtarget.inc"
#include "llvm/Module.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/Target/TargetMachine.h"
using namespace llvm;
cl::opt<X86Subtarget::AsmWriterFlavorTy>
@@ -31,9 +32,10 @@ AsmWriterFlavor("x86-asm-syntax", cl::init(X86Subtarget::unset),
/// value of GV itself. This means that the GlobalAddress must be in the base
/// or index register of the address, not the GV offset field.
bool X86Subtarget::GVRequiresExtraLoad(const GlobalValue* GV,
+ const TargetMachine& TM,
bool isDirectCall) const
{
- if (GenerateExtraLoadsForGVs)
+ if (TM.getRelocationModel() != Reloc::Static)
if (isTargetDarwin()) {
return (!isDirectCall &&
(GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() ||
@@ -208,16 +210,6 @@ static const char *GetCurrentX86CPU() {
}
}
-/// SetJITMode - This is called to inform the subtarget info that we are
-/// producing code for the JIT.
-void X86Subtarget::SetJITMode()
-{
- // JIT mode doesn't want extra loads for dllimported symbols, it knows exactly
- // where everything is.
- if (isTargetCygwin())
- GenerateExtraLoadsForGVs = false;
-}
-
X86Subtarget::X86Subtarget(const Module &M, const std::string &FS, bool is64Bit)
: AsmFlavor(AsmWriterFlavor)
, X86SSELevel(NoMMXSSE)
@@ -226,7 +218,6 @@ X86Subtarget::X86Subtarget(const Module &M, const std::string &FS, bool is64Bit)
// FIXME: this is a known good value for Yonah. How about others?
, MinRepStrSizeThreshold(128)
, Is64Bit(is64Bit)
- , GenerateExtraLoadsForGVs(true)
, TargetType(isELF) { // Default to ELF unless otherwise specified.
// Determine default and user specified characteristics