aboutsummaryrefslogtreecommitdiff
path: root/lib/Target
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-11-05 01:50:32 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-11-05 01:50:32 +0000
commitc96a8e7df1ffeebc5fb876f5eef380e8547ce14f (patch)
tree7830d261da19810d78b38ffcb0e88cf68d39af93 /lib/Target
parentc9eaef0bf2d22f9f3ef3148560ae4159d357a76c (diff)
Rename isGVLazyPtr to isGVNonLazyPtr relocation. This represents Mac OS X
indirect gv reference. Please don't call it lazy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58746 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/X86/X86CodeEmitter.cpp32
-rw-r--r--lib/Target/X86/X86JITInfo.cpp4
-rw-r--r--lib/Target/X86/X86JITInfo.h9
3 files changed, 23 insertions, 22 deletions
diff --git a/lib/Target/X86/X86CodeEmitter.cpp b/lib/Target/X86/X86CodeEmitter.cpp
index 1271146140..fabb67ee2d 100644
--- a/lib/Target/X86/X86CodeEmitter.cpp
+++ b/lib/Target/X86/X86CodeEmitter.cpp
@@ -73,7 +73,7 @@ namespace {
void emitPCRelativeBlockAddress(MachineBasicBlock *MBB);
void emitGlobalAddress(GlobalValue *GV, unsigned Reloc,
intptr_t Disp = 0, intptr_t PCAdj = 0,
- bool NeedStub = false, bool IsLazy = false);
+ bool NeedStub = false, bool IsNonLazy = false);
void emitExternalSymbolAddress(const char *ES, unsigned Reloc);
void emitConstPoolAddress(unsigned CPI, unsigned Reloc, intptr_t Disp = 0,
intptr_t PCAdj = 0);
@@ -94,7 +94,7 @@ namespace {
unsigned getX86RegNum(unsigned RegNo) const;
- bool gvNeedsLazyPtr(const GlobalValue *GV);
+ bool gvNeedsNonLazyPtr(const GlobalValue *GV);
};
char Emitter::ID = 0;
}
@@ -155,15 +155,15 @@ void Emitter::emitGlobalAddress(GlobalValue *GV, unsigned Reloc,
intptr_t Disp /* = 0 */,
intptr_t PCAdj /* = 0 */,
bool NeedStub /* = false */,
- bool isLazy /* = false */) {
+ bool isNonLazy /* = false */) {
intptr_t RelocCST = 0;
if (Reloc == X86::reloc_picrel_word)
RelocCST = PICBaseOffset;
else if (Reloc == X86::reloc_pcrel_word)
RelocCST = PCAdj;
- MachineRelocation MR = isLazy
- ? MachineRelocation::getGVLazyPtr(MCE.getCurrentPCOffset(), Reloc,
- GV, RelocCST, NeedStub)
+ MachineRelocation MR = isNonLazy
+ ? MachineRelocation::getGVNonLazyPtr(MCE.getCurrentPCOffset(), Reloc,
+ GV, RelocCST, NeedStub)
: MachineRelocation::getGV(MCE.getCurrentPCOffset(), Reloc,
GV, RelocCST, NeedStub);
MCE.addRelocation(MR);
@@ -263,8 +263,8 @@ static bool isDisp8(int Value) {
return Value == (signed char)Value;
}
-bool Emitter::gvNeedsLazyPtr(const GlobalValue *GV) {
- // For Darwin, simulate the linktime GOT by using the same lazy-pointer
+bool Emitter::gvNeedsNonLazyPtr(const GlobalValue *GV) {
+ // For Darwin, simulate the linktime GOT by using the same non-lazy-pointer
// mechanism as 32-bit mode.
return (!Is64BitMode || TM.getSubtarget<X86Subtarget>().isTargetDarwin()) &&
TM.getSubtarget<X86Subtarget>().GVRequiresExtraLoad(GV, TM, false);
@@ -289,9 +289,9 @@ void Emitter::emitDisplacementField(const MachineOperand *RelocOp,
unsigned rt = Is64BitMode ? X86::reloc_pcrel_word
: (IsPIC ? X86::reloc_picrel_word : X86::reloc_absolute_word);
bool NeedStub = isa<Function>(RelocOp->getGlobal());
- bool isLazy = gvNeedsLazyPtr(RelocOp->getGlobal());
+ bool isNonLazy = gvNeedsNonLazyPtr(RelocOp->getGlobal());
emitGlobalAddress(RelocOp->getGlobal(), rt, RelocOp->getOffset(),
- PCAdj, NeedStub, isLazy);
+ PCAdj, NeedStub, isNonLazy);
} else if (RelocOp->isCPI()) {
unsigned rt = Is64BitMode ? X86::reloc_pcrel_word : X86::reloc_picrel_word;
emitConstPoolAddress(RelocOp->getIndex(), rt,
@@ -610,9 +610,9 @@ void Emitter::emitInstruction(const MachineInstr &MI,
rt = X86::reloc_absolute_dword; // FIXME: add X86II flag?
if (MO1.isGlobal()) {
bool NeedStub = isa<Function>(MO1.getGlobal());
- bool isLazy = gvNeedsLazyPtr(MO1.getGlobal());
+ bool isNonLazy = gvNeedsNonLazyPtr(MO1.getGlobal());
emitGlobalAddress(MO1.getGlobal(), rt, MO1.getOffset(), 0,
- NeedStub, isLazy);
+ NeedStub, isNonLazy);
} else if (MO1.isSymbol())
emitExternalSymbolAddress(MO1.getSymbolName(), rt);
else if (MO1.isCPI())
@@ -688,9 +688,9 @@ void Emitter::emitInstruction(const MachineInstr &MI,
rt = X86::reloc_absolute_word; // FIXME: add X86II flag?
if (MO1.isGlobal()) {
bool NeedStub = isa<Function>(MO1.getGlobal());
- bool isLazy = gvNeedsLazyPtr(MO1.getGlobal());
+ bool isNonLazy = gvNeedsNonLazyPtr(MO1.getGlobal());
emitGlobalAddress(MO1.getGlobal(), rt, MO1.getOffset(), 0,
- NeedStub, isLazy);
+ NeedStub, isNonLazy);
} else if (MO1.isSymbol())
emitExternalSymbolAddress(MO1.getSymbolName(), rt);
else if (MO1.isCPI())
@@ -726,9 +726,9 @@ void Emitter::emitInstruction(const MachineInstr &MI,
rt = X86::reloc_absolute_word; // FIXME: add X86II flag?
if (MO.isGlobal()) {
bool NeedStub = isa<Function>(MO.getGlobal());
- bool isLazy = gvNeedsLazyPtr(MO.getGlobal());
+ bool isNonLazy = gvNeedsNonLazyPtr(MO.getGlobal());
emitGlobalAddress(MO.getGlobal(), rt, MO.getOffset(), 0,
- NeedStub, isLazy);
+ NeedStub, isNonLazy);
} else if (MO.isSymbol())
emitExternalSymbolAddress(MO.getSymbolName(), rt);
else if (MO.isCPI())
diff --git a/lib/Target/X86/X86JITInfo.cpp b/lib/Target/X86/X86JITInfo.cpp
index f8761dc87e..ee46657431 100644
--- a/lib/Target/X86/X86JITInfo.cpp
+++ b/lib/Target/X86/X86JITInfo.cpp
@@ -413,8 +413,8 @@ X86JITInfo::getLazyResolverFunction(JITCompilerFn F) {
return X86CompilationCallback;
}
-void *X86JITInfo::emitGlobalValueLazyPtr(const GlobalValue* GV, void *ptr,
- MachineCodeEmitter &MCE) {
+void *X86JITInfo::emitGlobalValueNonLazyPtr(const GlobalValue* GV, void *ptr,
+ MachineCodeEmitter &MCE) {
#if defined (X86_64_JIT)
MCE.startFunctionStub(GV, 8, 8);
MCE.emitWordLE((unsigned)(intptr_t)ptr);
diff --git a/lib/Target/X86/X86JITInfo.h b/lib/Target/X86/X86JITInfo.h
index 6b8d197846..65a417dde8 100644
--- a/lib/Target/X86/X86JITInfo.h
+++ b/lib/Target/X86/X86JITInfo.h
@@ -37,10 +37,11 @@ namespace llvm {
///
virtual void replaceMachineCodeForFunction(void *Old, void *New);
- /// emitGlobalValueLazyPtr - Use the specified MachineCodeEmitter object to
- /// emit a lazy pointer which contains the address of the specified ptr.
- virtual void *emitGlobalValueLazyPtr(const GlobalValue* GV, void *ptr,
- MachineCodeEmitter &MCE);
+ /// emitGlobalValueNonLazyPtr - Use the specified MachineCodeEmitter object
+ /// to emit a Mac OS X non-lazy pointer which contains the address of the
+ /// specified ptr.
+ virtual void *emitGlobalValueNonLazyPtr(const GlobalValue* GV, void *ptr,
+ MachineCodeEmitter &MCE);
/// emitFunctionStub - Use the specified MachineCodeEmitter object to emit a
/// small native function that simply calls the function at the specified