Differential Revision: http://reviews.llvm.org/D19040
llvm-svn: 267229
diff --git a/llvm/lib/Target/X86/X86Subtarget.h b/llvm/lib/Target/X86/X86Subtarget.h
index 7713656..170e5c3 100644
--- a/llvm/lib/Target/X86/X86Subtarget.h
+++ b/llvm/lib/Target/X86/X86Subtarget.h
@@ -548,6 +548,14 @@
}
}
+ /// Determine if this global is defined in a Position Independent
+ /// Executable (PIE) where its definition cannot be interposed.
+ bool isGlobalDefinedInPIE(const GlobalValue *GV,
+ const TargetMachine &TM) const {
+ return TM.Options.PositionIndependentExecutable &&
+ !GV->isDeclarationForLinker();
+ }
+
/// ClassifyGlobalReference - Classify a global variable reference for the
/// current subtarget according to how we should reference it in a non-pcrel
/// context.