diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-10 07:20:05 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-10 07:20:05 +0000 |
commit | d392bd97c8203ab4a770dfdd0a5565ac6cd6cacd (patch) | |
tree | a02f94431291c100954d58626105f1e33e6393c1 /lib/Target/X86/X86Subtarget.h | |
parent | 3b6b36d6f54e780a2947cb1b9efe4eed7c40dc11 (diff) | |
download | external_llvm-d392bd97c8203ab4a770dfdd0a5565ac6cd6cacd.zip external_llvm-d392bd97c8203ab4a770dfdd0a5565ac6cd6cacd.tar.gz external_llvm-d392bd97c8203ab4a770dfdd0a5565ac6cd6cacd.tar.bz2 |
move some classification logic around. Now GVRequiresExtraLoad
is just a trivial wrapper around "ClassifyGlobalReference", which
stole a ton of logic from LowerGlobalAddress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75237 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86Subtarget.h')
-rw-r--r-- | lib/Target/X86/X86Subtarget.h | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/lib/Target/X86/X86Subtarget.h b/lib/Target/X86/X86Subtarget.h index 1fe612a..2990df5 100644 --- a/lib/Target/X86/X86Subtarget.h +++ b/lib/Target/X86/X86Subtarget.h @@ -150,7 +150,6 @@ public: bool hasAVX() const { return HasAVX; } bool hasFMA3() const { return HasFMA3; } bool hasFMA4() const { return HasFMA4; } - bool isBTMemSlow() const { return IsBTMemSlow; } unsigned getAsmFlavor() const { @@ -161,28 +160,25 @@ public: bool isFlavorIntel() const { return AsmFlavor == Intel; } bool isTargetDarwin() const { return TargetType == isDarwin; } - bool isTargetELF() const { - return TargetType == isELF; - } + bool isTargetELF() const { return TargetType == isELF; } bool isTargetWindows() const { return TargetType == isWindows; } bool isTargetMingw() const { return TargetType == isMingw; } - bool isTargetCygMing() const { return (TargetType == isMingw || - TargetType == isCygwin); } + bool isTargetCygMing() const { + return TargetType == isMingw || TargetType == isCygwin; + } bool isTargetCygwin() const { return TargetType == isCygwin; } bool isTargetWin64() const { - return (Is64Bit && (TargetType == isMingw || TargetType == isWindows)); + return Is64Bit && (TargetType == isMingw || TargetType == isWindows); } std::string getDataLayout() const { const char *p; if (is64Bit()) p = "e-p:64:64-s:64-f64:64:64-i64:64:64-f80:128:128"; - else { - if (isTargetDarwin()) - p = "e-p:32:32-f64:32:64-i64:32:64-f80:128:128"; - else - p = "e-p:32:32-f64:32:64-i64:32:64-f80:32:32"; - } + else if (isTargetDarwin()) + p = "e-p:32:32-f64:32:64-i64:32:64-f80:128:128"; + else + p = "e-p:32:32-f64:32:64-i64:32:64-f80:32:32"; return std::string(p); } @@ -197,11 +193,18 @@ public: /// isLinux - Return true if the target is "Linux". bool isLinux() const { return IsLinux; } + + /// ClassifyGlobalReference - Classify a global variable reference for the + /// current subtarget according to how we should reference it in a non-pcrel + /// context. + unsigned char ClassifyGlobalReference(const GlobalValue *GV, + const TargetMachine &TM)const; + /// True if accessing the GV requires an extra load. For Windows, dllimported /// symbols are indirect, loading the value at address GV rather then the /// 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 GVRequiresExtraLoad(const GlobalValue* GV, const TargetMachine &TM)const; + bool GVRequiresExtraLoad(const GlobalValue *GV, const TargetMachine &TM)const; /// True if accessing the GV requires a register. This is a superset of the /// cases where GVRequiresExtraLoad is true. Some variations of PIC require |