llvm.org GIT mirror llvm / dfab291
split "JumpTableDirective" (an existing hack) into a PIC and nonPIC version. This allows TAI implementations to specify the directive to use based on the mode being codegen'd for. The real fix for this is to remove JumpTableDirective, but I don't feel like diving into the jumptable snarl just now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78709 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 11 years ago
5 changed file(s) with 12 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
183183
184184 //===--- Section Switching Directives ---------------------------------===//
185185
186 /// JumpTableDirective - if non-null, the directive to emit before a jump
187 /// table.
186 /// JumpTableDirective - if non-null, the directive to emit before jump
187 /// table entries. FIXME: REMOVE THIS.
188188 const char *JumpTableDirective;
189 const char *PICJumpTableDirective;
190
189191
190192 //===--- Global Variable Emission Directives --------------------------===//
191193
417419 const char *getAscizDirective() const {
418420 return AscizDirective;
419421 }
420 const char *getJumpTableDirective() const {
421 return JumpTableDirective;
422 const char *getJumpTableDirective(bool isPIC) const {
423 return isPIC ? PICJumpTableDirective : JumpTableDirective;
422424 }
423425 const char *getAlignDirective() const {
424426 return AlignDirective;
922922 O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
923923 << '_' << JTI << '_' << MO2.getImm() << ":\n";
924924
925 const char *JTEntryDirective = TAI->getJumpTableDirective();
926 if (!JTEntryDirective)
927 JTEntryDirective = TAI->getData32bitsDirective();
925 const char *JTEntryDirective = TAI->getData32bitsDirective();
928926
929927 const MachineFunction *MF = MI->getParent()->getParent();
930928 const MachineJumpTableInfo *MJTI = MF->getJumpTableInfo();
946944 << "_set_" << MBB->getNumber();
947945 else if (TM.getRelocationModel() == Reloc::PIC_) {
948946 printBasicBlockLabel(MBB, false, false, false);
949 // If the arch uses custom Jump Table directives, don't calc relative to JT
950 if (!TAI->getJumpTableDirective())
951 O << '-' << TAI->getPrivateGlobalPrefix() << "JTI"
952 << getFunctionNumber() << '_' << JTI << '_' << MO2.getImm();
947 O << '-' << TAI->getPrivateGlobalPrefix() << "JTI"
948 << getFunctionNumber() << '_' << JTI << '_' << MO2.getImm();
953949 } else {
954950 printBasicBlockLabel(MBB, false, false, false);
955951 }
1616 AlphaTargetAsmInfo::AlphaTargetAsmInfo() {
1717 AlignmentIsInBytes = false;
1818 PrivateGlobalPrefix = "$";
19 JumpTableDirective = ".gprel32";
19 PICJumpTableDirective = ".gprel32";
2020 WeakRefDirective = "\t.weak\t";
2121 }
2323 PrivateGlobalPrefix = "$";
2424 CommentString = "#";
2525 ZeroDirective = "\t.space\t";
26
27 if (TM.getRelocationModel() == Reloc::PIC_)
28 JumpTableDirective = "\t.gpword\t";
26 PICJumpTableDirective = "\t.gpword\t";
2927 }
5353 AlignmentIsInBytes = true;
5454 TextAlignFillValue = 0;
5555 JumpTableDirective = 0;
56 PICJumpTableDirective = 0;
5657 GlobalDirective = "\t.globl\t";
5758 SetDirective = 0;
5859 LCOMMDirective = 0;