summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86Subtarget.h
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-05-20 12:20:10 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-05-20 12:20:10 +0000
commitc7e98132285502ae4ad8586778be86e2850cd392 (patch)
treee67fbb99ee106e1b8d265dede972e6bd0c066d10 /llvm/lib/Target/X86/X86Subtarget.h
parentb189db627c703a30cb0561ff9797db4c2f3337b4 (diff)
downloadbcm5719-llvm-c7e98132285502ae4ad8586778be86e2850cd392.tar.gz
bcm5719-llvm-c7e98132285502ae4ad8586778be86e2850cd392.zip
Refactor X86 symbol access classification.
This refactors the logic in X86 to avoid code duplication. It also splits it in two steps: it first decides if a symbol is local to the DSO and then uses that information to decide how to access it. The first part is implemented by shouldAssumeDSOLocal. It is not in any way specific to X86. In a followup patch I intend to move it to somewhere common and reused it in other backends. llvm-svn: 270209
Diffstat (limited to 'llvm/lib/Target/X86/X86Subtarget.h')
-rw-r--r--llvm/lib/Target/X86/X86Subtarget.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/Target/X86/X86Subtarget.h b/llvm/lib/Target/X86/X86Subtarget.h
index 68672c28060..f77a33f2348 100644
--- a/llvm/lib/Target/X86/X86Subtarget.h
+++ b/llvm/lib/Target/X86/X86Subtarget.h
@@ -556,18 +556,17 @@ public:
}
}
- /// Determine if this global is defined in a Position Independent
- /// Executable (PIE) where its definition cannot be interposed.
- bool isGlobalDefinedInPIE(const GlobalValue *GV) const {
- return GV->getParent()->getPIELevel() != PIELevel::Default &&
- !GV->isDeclarationForLinker();
- }
-
/// Classify a global variable reference for the current subtarget according
/// to how we should reference it in a non-pcrel context.
+ unsigned char classifyLocalReference(const GlobalValue *GV) const;
+
+ unsigned char classifyGlobalReference(const GlobalValue *GV,
+ const Module &M) const;
unsigned char classifyGlobalReference(const GlobalValue *GV) const;
/// Classify a global function reference for the current subtarget.
+ unsigned char classifyGlobalFunctionReference(const GlobalValue *GV,
+ const Module &M) const;
unsigned char classifyGlobalFunctionReference(const GlobalValue *GV) const;
/// Classify a blockaddress reference for the current subtarget according to
OpenPOWER on IntegriCloud