mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 03:25:23 +00:00
Add support for other relocation bases to jump tables, as well as custom asm directives
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30593 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -187,7 +187,10 @@ void AsmPrinter::EmitJumpTableInfo(MachineJumpTableInfo *MJTI) {
|
||||
// JTEntryDirective is a string to print sizeof(ptr) for non-PIC jump tables,
|
||||
// and 32 bits for PIC since PIC jump table entries are differences, not
|
||||
// pointers to blocks.
|
||||
const char *JTEntryDirective = TAI->getData32bitsDirective();
|
||||
// Use the architecture specific relocation directive, if it is set
|
||||
const char *JTEntryDirective = TAI->getJumpTableDirective();
|
||||
if (!JTEntryDirective)
|
||||
JTEntryDirective = TAI->getData32bitsDirective();
|
||||
|
||||
// Pick the directive to use to print the jump table entries, and switch to
|
||||
// the appropriate section.
|
||||
@@ -227,8 +230,10 @@ void AsmPrinter::EmitJumpTableInfo(MachineJumpTableInfo *MJTI) {
|
||||
<< '_' << i << "_set_" << JTBBs[ii]->getNumber();
|
||||
} else if (TM.getRelocationModel() == Reloc::PIC_) {
|
||||
printBasicBlockLabel(JTBBs[ii], false, false);
|
||||
O << '-' << TAI->getPrivateGlobalPrefix() << "JTI"
|
||||
<< getFunctionNumber() << '_' << i;
|
||||
//If the arch uses custom Jump Table directives, don't calc relative to JT
|
||||
if (!TAI->getJumpTableDirective())
|
||||
O << '-' << TAI->getPrivateGlobalPrefix() << "JTI"
|
||||
<< getFunctionNumber() << '_' << i;
|
||||
} else {
|
||||
printBasicBlockLabel(JTBBs[ii], false, false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user