Use a better name for the label relocations while emitting them for Jump Tables

llvm-svn: 76334
This commit is contained in:
Bruno Cardoso Lopes 2009-07-18 20:52:11 +00:00
parent 4f51628b02
commit e376b53c7b
4 changed files with 6 additions and 5 deletions

View File

@ -106,7 +106,7 @@ namespace llvm {
/// getJumpTableRelocationTy - Returns the machine relocation type used /// getJumpTableRelocationTy - Returns the machine relocation type used
/// to reference a jumptable. /// to reference a jumptable.
virtual unsigned getJumpTableMachineRelocationTy() const = 0; virtual unsigned getAbsoluteLabelMachineRelTy() const = 0;
}; };
} // end llvm namespace } // end llvm namespace

View File

@ -185,7 +185,7 @@ void ELFCodeEmitter::emitJumpTables(MachineJumpTableInfo *MJTI) {
// Each MBB entry in the Jump table section has a relocation entry // Each MBB entry in the Jump table section has a relocation entry
// against the current text section. // against the current text section.
for (unsigned mi = 0, me = MBBs.size(); mi != me; ++mi) { for (unsigned mi = 0, me = MBBs.size(); mi != me; ++mi) {
unsigned MachineRelTy = TEW->getJumpTableMachineRelocationTy(); unsigned MachineRelTy = TEW->getAbsoluteLabelMachineRelTy();
MachineRelocation MR = MachineRelocation MR =
MachineRelocation::getBB(JTSection.size(), MachineRelocation::getBB(JTSection.size(),
MachineRelTy, MachineRelTy,

View File

@ -102,7 +102,8 @@ unsigned X86ELFWriterInfo::getRelocationTySize(unsigned RelTy) const {
return 0; return 0;
} }
unsigned X86ELFWriterInfo::getJumpTableMachineRelocationTy() const { unsigned X86ELFWriterInfo::getAbsoluteLabelMachineRelTy() const {
return X86::reloc_absolute_dword; return is64Bit ?
X86::reloc_absolute_dword : X86::reloc_absolute_word;
} }

View File

@ -58,7 +58,7 @@ namespace llvm {
/// getJumpTableRelocationTy - Returns the machine relocation type used /// getJumpTableRelocationTy - Returns the machine relocation type used
/// to reference a jumptable. /// to reference a jumptable.
virtual unsigned getJumpTableMachineRelocationTy() const; virtual unsigned getAbsoluteLabelMachineRelTy() const;
}; };
} // end llvm namespace } // end llvm namespace