[llvm-commits] [llvm] r58949 - in /llvm/trunk: include/llvm/CodeGen/MachineRelocation.h include/llvm/Target/TargetJITInfo.h lib/Target/ARM/ARMCodeEmitter.cpp lib/Target/ARM/ARMJITInfo.cpp lib/Target/ARM/ARMJITInfo.h lib/Target/X86/X86CodeEmitter.cpp lib/Target/X86/X86JITInfo.cpp lib/Target/X86/X86JITInfo.h
Evan Cheng
evan.cheng at apple.com
Sun Nov 9 17:08:07 PST 2008
Author: evancheng
Date: Sun Nov 9 19:08:07 2008
New Revision: 58949
URL: http://llvm.org/viewvc/llvm-project?rev=58949&view=rev
Log:
Rename isGVNonLazyPtr to isIndirectSym to reflect how it will be used.
Modified:
llvm/trunk/include/llvm/CodeGen/MachineRelocation.h
llvm/trunk/include/llvm/Target/TargetJITInfo.h
llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp
llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp
llvm/trunk/lib/Target/ARM/ARMJITInfo.h
llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp
llvm/trunk/lib/Target/X86/X86JITInfo.cpp
llvm/trunk/lib/Target/X86/X86JITInfo.h
Modified: llvm/trunk/include/llvm/CodeGen/MachineRelocation.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineRelocation.h?rev=58949&r1=58948&r2=58949&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineRelocation.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineRelocation.h Sun Nov 9 19:08:07 2008
@@ -39,7 +39,7 @@
enum AddressType {
isResult, // Relocation has be transformed into its result pointer.
isGV, // The Target.GV field is valid.
- isGVNonLazyPtr, // Relocation of a Mac OS X NonLazy indirect reference.
+ isIndirectSym, // Relocation of an indirect symbol.
isBB, // Relocation of BB address.
isExtSym, // The Target.ExtSym field is valid.
isConstPool, // Relocation of constant pool address.
@@ -56,7 +56,7 @@
union {
void *Result; // If this has been resolved to a resolved pointer
- GlobalValue *GV; // If this is a pointer to a GV or a GV nonlazy ptr
+ GlobalValue *GV; // If this is a pointer to a GV or an indirect ref.
MachineBasicBlock *MBB; // If this is a pointer to a LLVM BB
const char *ExtSym; // If this is a pointer to a named symbol
unsigned Index; // Constant pool / jump table index
@@ -96,19 +96,19 @@
return Result;
}
- /// MachineRelocation::getGVNonLazyPtr - Return a relocation entry for a
- /// Mac OS X non-lazy GlobalValue indirect reference.
- static MachineRelocation getGVNonLazyPtr(intptr_t offset,
- unsigned RelocationType,
- GlobalValue *GV, intptr_t cst = 0,
- bool NeedStub = 0,
- bool GOTrelative = 0) {
+ /// MachineRelocation::getIndirectSymbol - Return a relocation entry for an
+ /// indirect symbol.
+ static MachineRelocation getIndirectSymbol(intptr_t offset,
+ unsigned RelocationType,
+ GlobalValue *GV, intptr_t cst = 0,
+ bool NeedStub = 0,
+ bool GOTrelative = 0) {
assert((RelocationType & ~63) == 0 && "Relocation type too large!");
MachineRelocation Result;
Result.Offset = offset;
Result.ConstantVal = cst;
Result.TargetReloType = RelocationType;
- Result.AddrType = isGVNonLazyPtr;
+ Result.AddrType = isIndirectSym;
Result.NeedStub = NeedStub;
Result.GOTRelative = GOTrelative;
Result.TargetResolve = false;
@@ -222,10 +222,10 @@
return AddrType == isGV;
}
- /// isGlobalValueNonLazyPtr - Return true if this relocation is the address
- /// of a Mac OS X non-lazy indirect reference.
- bool isGlobalValueNonLazyPtr() const {
- return AddrType == isGVNonLazyPtr;
+ /// isIndirectSymbol - Return true if this relocation is the address an
+ /// indirect symbol
+ bool isIndirectSymbol() const {
+ return AddrType == isIndirectSym;
}
/// isBasicBlock - Return true if this relocation is a basic block reference.
@@ -275,7 +275,7 @@
/// getGlobalValue - If this is a global value reference, return the
/// referenced global.
GlobalValue *getGlobalValue() const {
- assert((isGlobalValue() || isGlobalValueNonLazyPtr()) &&
+ assert((isGlobalValue() || isIndirectSymbol()) &&
"This is not a global value reference!");
return Target.GV;
}
Modified: llvm/trunk/include/llvm/Target/TargetJITInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetJITInfo.h?rev=58949&r1=58948&r2=58949&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetJITInfo.h (original)
+++ llvm/trunk/include/llvm/Target/TargetJITInfo.h Sun Nov 9 19:08:07 2008
@@ -40,12 +40,12 @@
///
virtual void replaceMachineCodeForFunction(void *Old, void *New) = 0;
- /// 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) {
- assert(0 && "This target doesn't implement emitGlobalValueNonLazyPtr!");
+ /// emitGlobalValueIndirectSym - Use the specified MachineCodeEmitter object
+ /// to emit an indirect symbol which contains the address of the specified
+ /// ptr.
+ virtual void *emitGlobalValueIndirectSym(const GlobalValue* GV, void *ptr,
+ MachineCodeEmitter &MCE) {
+ assert(0 && "This target doesn't implement emitGlobalValueIndirectSym!");
return 0;
}
Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=58949&r1=58948&r2=58949&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Sun Nov 9 19:08:07 2008
@@ -337,7 +337,7 @@
if (GV) {
assert(!ACPV->isStub() && "Don't know how to deal this yet!");
if (ACPV->isNonLazyPointer())
- MCE.addRelocation(MachineRelocation::getGVNonLazyPtr(
+ MCE.addRelocation(MachineRelocation::getIndirectSymbol(
MCE.getCurrentPCOffset(), ARM::reloc_arm_machine_cp_entry, GV,
(intptr_t)ACPV, false));
else
Modified: llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp?rev=58949&r1=58948&r2=58949&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMJITInfo.cpp Sun Nov 9 19:08:07 2008
@@ -129,8 +129,8 @@
return ARMCompilationCallback;
}
-void *ARMJITInfo::emitGlobalValueNonLazyPtr(const GlobalValue *GV, void *Ptr,
- MachineCodeEmitter &MCE) {
+void *ARMJITInfo::emitGlobalValueIndirectSym(const GlobalValue *GV, void *Ptr,
+ MachineCodeEmitter &MCE) {
MCE.startGVStub(GV, 4, 4);
MCE.emitWordLE((intptr_t)Ptr);
return MCE.finishGVStub(GV);
Modified: llvm/trunk/lib/Target/ARM/ARMJITInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMJITInfo.h?rev=58949&r1=58948&r2=58949&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMJITInfo.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMJITInfo.h Sun Nov 9 19:08:07 2008
@@ -51,10 +51,10 @@
///
virtual void replaceMachineCodeForFunction(void *Old, void *New);
- /// 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,
+ /// emitGlobalValueIndirectSym - Use the specified MachineCodeEmitter object
+ /// to emit an indirect symbol which contains the address of the specified
+ /// ptr.
+ virtual void *emitGlobalValueIndirectSym(const GlobalValue* GV, void *ptr,
MachineCodeEmitter &MCE);
/// emitFunctionStub - Use the specified MachineCodeEmitter object to emit a
Modified: llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp?rev=58949&r1=58948&r2=58949&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86CodeEmitter.cpp Sun Nov 9 19:08:07 2008
@@ -73,7 +73,7 @@
void emitPCRelativeBlockAddress(MachineBasicBlock *MBB);
void emitGlobalAddress(GlobalValue *GV, unsigned Reloc,
intptr_t Disp = 0, intptr_t PCAdj = 0,
- bool NeedStub = false, bool IsNonLazy = false);
+ bool NeedStub = false, bool Indirect = false);
void emitExternalSymbolAddress(const char *ES, unsigned Reloc);
void emitConstPoolAddress(unsigned CPI, unsigned Reloc, intptr_t Disp = 0,
intptr_t PCAdj = 0);
@@ -155,15 +155,15 @@
intptr_t Disp /* = 0 */,
intptr_t PCAdj /* = 0 */,
bool NeedStub /* = false */,
- bool isNonLazy /* = false */) {
+ bool Indirect /* = false */) {
intptr_t RelocCST = 0;
if (Reloc == X86::reloc_picrel_word)
RelocCST = PICBaseOffset;
else if (Reloc == X86::reloc_pcrel_word)
RelocCST = PCAdj;
- MachineRelocation MR = isNonLazy
- ? MachineRelocation::getGVNonLazyPtr(MCE.getCurrentPCOffset(), Reloc,
- GV, RelocCST, NeedStub)
+ MachineRelocation MR = Indirect
+ ? MachineRelocation::getIndirectSymbol(MCE.getCurrentPCOffset(), Reloc,
+ GV, RelocCST, NeedStub)
: MachineRelocation::getGV(MCE.getCurrentPCOffset(), Reloc,
GV, RelocCST, NeedStub);
MCE.addRelocation(MR);
@@ -289,9 +289,9 @@
unsigned rt = Is64BitMode ? X86::reloc_pcrel_word
: (IsPIC ? X86::reloc_picrel_word : X86::reloc_absolute_word);
bool NeedStub = isa<Function>(RelocOp->getGlobal());
- bool isNonLazy = gvNeedsNonLazyPtr(RelocOp->getGlobal());
+ bool Indirect = gvNeedsNonLazyPtr(RelocOp->getGlobal());
emitGlobalAddress(RelocOp->getGlobal(), rt, RelocOp->getOffset(),
- PCAdj, NeedStub, isNonLazy);
+ PCAdj, NeedStub, Indirect);
} else if (RelocOp->isCPI()) {
unsigned rt = Is64BitMode ? X86::reloc_pcrel_word : X86::reloc_picrel_word;
emitConstPoolAddress(RelocOp->getIndex(), rt,
@@ -610,9 +610,9 @@
rt = X86::reloc_absolute_dword; // FIXME: add X86II flag?
if (MO1.isGlobal()) {
bool NeedStub = isa<Function>(MO1.getGlobal());
- bool isNonLazy = gvNeedsNonLazyPtr(MO1.getGlobal());
+ bool Indirect = gvNeedsNonLazyPtr(MO1.getGlobal());
emitGlobalAddress(MO1.getGlobal(), rt, MO1.getOffset(), 0,
- NeedStub, isNonLazy);
+ NeedStub, Indirect);
} else if (MO1.isSymbol())
emitExternalSymbolAddress(MO1.getSymbolName(), rt);
else if (MO1.isCPI())
@@ -688,9 +688,9 @@
rt = X86::reloc_absolute_word; // FIXME: add X86II flag?
if (MO1.isGlobal()) {
bool NeedStub = isa<Function>(MO1.getGlobal());
- bool isNonLazy = gvNeedsNonLazyPtr(MO1.getGlobal());
+ bool Indirect = gvNeedsNonLazyPtr(MO1.getGlobal());
emitGlobalAddress(MO1.getGlobal(), rt, MO1.getOffset(), 0,
- NeedStub, isNonLazy);
+ NeedStub, Indirect);
} else if (MO1.isSymbol())
emitExternalSymbolAddress(MO1.getSymbolName(), rt);
else if (MO1.isCPI())
@@ -726,9 +726,9 @@
rt = X86::reloc_absolute_word; // FIXME: add X86II flag?
if (MO.isGlobal()) {
bool NeedStub = isa<Function>(MO.getGlobal());
- bool isNonLazy = gvNeedsNonLazyPtr(MO.getGlobal());
+ bool Indirect = gvNeedsNonLazyPtr(MO.getGlobal());
emitGlobalAddress(MO.getGlobal(), rt, MO.getOffset(), 0,
- NeedStub, isNonLazy);
+ NeedStub, Indirect);
} else if (MO.isSymbol())
emitExternalSymbolAddress(MO.getSymbolName(), rt);
else if (MO.isCPI())
Modified: llvm/trunk/lib/Target/X86/X86JITInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86JITInfo.cpp?rev=58949&r1=58948&r2=58949&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86JITInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86JITInfo.cpp Sun Nov 9 19:08:07 2008
@@ -413,8 +413,8 @@
return X86CompilationCallback;
}
-void *X86JITInfo::emitGlobalValueNonLazyPtr(const GlobalValue* GV, void *ptr,
- MachineCodeEmitter &MCE) {
+void *X86JITInfo::emitGlobalValueIndirectSym(const GlobalValue* GV, void *ptr,
+ MachineCodeEmitter &MCE) {
#if defined (X86_64_JIT)
MCE.startGVStub(GV, 8, 8);
MCE.emitWordLE((unsigned)(intptr_t)ptr);
Modified: llvm/trunk/lib/Target/X86/X86JITInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86JITInfo.h?rev=58949&r1=58948&r2=58949&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86JITInfo.h (original)
+++ llvm/trunk/lib/Target/X86/X86JITInfo.h Sun Nov 9 19:08:07 2008
@@ -37,11 +37,11 @@
///
virtual void replaceMachineCodeForFunction(void *Old, void *New);
- /// 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);
+ /// emitGlobalValueIndirectSym - Use the specified MachineCodeEmitter object
+ /// to emit an indirect symbol which contains the address of the specified
+ /// ptr.
+ virtual void *emitGlobalValueIndirectSym(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
More information about the llvm-commits
mailing list