summaryrefslogtreecommitdiff
path: root/lib/Target/ARM/ARMJITInfo.h
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-11-08 07:38:22 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-11-08 07:38:22 +0000
commit3cc8223a3c062daee763d6db272415a76de38a78 (patch)
treee8a15e2231a18da5c78223d3ea580678f748381a /lib/Target/ARM/ARMJITInfo.h
parentd7398c9b699cae3a109e9808401f7d0b2fc7e686 (diff)
downloadllvm-3cc8223a3c062daee763d6db272415a76de38a78.tar.gz
llvm-3cc8223a3c062daee763d6db272415a76de38a78.tar.bz2
llvm-3cc8223a3c062daee763d6db272415a76de38a78.tar.xz
Tell ARMJITInfo if codegen relocation is PIC. It changes how function stubs are generated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58896 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMJITInfo.h')
-rw-r--r--lib/Target/ARM/ARMJITInfo.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/Target/ARM/ARMJITInfo.h b/lib/Target/ARM/ARMJITInfo.h
index 91d51b4b5b..fe1ea1029e 100644
--- a/lib/Target/ARM/ARMJITInfo.h
+++ b/lib/Target/ARM/ARMJITInfo.h
@@ -26,8 +26,6 @@ namespace llvm {
class ARMTargetMachine;
class ARMJITInfo : public TargetJITInfo {
- ARMTargetMachine &TM;
-
// ConstPoolId2AddrMap - A map from constant pool ids to the corresponding
// CONSTPOOL_ENTRY addresses.
SmallVector<intptr_t, 16> ConstPoolId2AddrMap;
@@ -39,8 +37,12 @@ namespace llvm {
// PCLabelMap - A map from PC labels to addresses.
DenseMap<unsigned, intptr_t> PCLabelMap;
+ // IsPIC - True if the relocation model is PIC. This is used to determine
+ // how to codegen function stubs.
+ bool IsPIC;
+
public:
- explicit ARMJITInfo(ARMTargetMachine &tm) : TM(tm) { useGOT = false; }
+ explicit ARMJITInfo() : IsPIC(false) { useGOT = false; }
/// replaceMachineCodeForFunction - Make it so that calling the function
/// whose machine code is at OLD turns into a call to NEW, perhaps by
@@ -89,12 +91,15 @@ namespace llvm {
#endif
}
- /// Initialize - Initialize internal stage. Get the list of constant pool
- /// Resize constant pool ids to CONSTPOOL_ENTRY addresses map.
- void Initialize(const MachineFunction &MF) {
+ /// Initialize - Initialize internal stage for the function being JITted.
+ /// Resize constant pool ids to CONSTPOOL_ENTRY addresses map; resize
+ /// jump table ids to jump table bases map; remember if codegen relocation
+ /// model is PIC.
+ void Initialize(const MachineFunction &MF, bool isPIC) {
const ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>();
ConstPoolId2AddrMap.resize(AFI->getNumConstPoolEntries());
JumpTableId2AddrMap.resize(AFI->getNumJumpTables());
+ IsPIC = isPIC;
}
/// getConstantPoolEntryAddr - The ARM target puts all constant