diff options
author | Andrew Lenharth <andrewl@lenharth.org> | 2006-12-07 23:55:55 +0000 |
---|---|---|
committer | Andrew Lenharth <andrewl@lenharth.org> | 2006-12-07 23:55:55 +0000 |
commit | 0fb259046d43b72d82981af2505b1813b50b3432 (patch) | |
tree | ead9ce9db12bd56fafeb95fe83b2f12b7b4b0746 | |
parent | e16634065021e36ae31f074f623a636924d6b8d1 (diff) | |
download | external_llvm-0fb259046d43b72d82981af2505b1813b50b3432.zip external_llvm-0fb259046d43b72d82981af2505b1813b50b3432.tar.gz external_llvm-0fb259046d43b72d82981af2505b1813b50b3432.tar.bz2 |
Simplify a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32343 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/Alpha/AlphaAsmPrinter.cpp | 41 | ||||
-rw-r--r-- | lib/Target/Alpha/AlphaLLRP.cpp | 3 | ||||
-rw-r--r-- | lib/Target/Alpha/AlphaTargetAsmInfo.cpp | 1 |
3 files changed, 15 insertions, 30 deletions
diff --git a/lib/Target/Alpha/AlphaAsmPrinter.cpp b/lib/Target/Alpha/AlphaAsmPrinter.cpp index 4b71ab5..be8973a 100644 --- a/lib/Target/Alpha/AlphaAsmPrinter.cpp +++ b/lib/Target/Alpha/AlphaAsmPrinter.cpp @@ -33,20 +33,11 @@ namespace { /// Unique incrementer for label values for referencing Global values. /// - unsigned LabelNumber; AlphaAsmPrinter(std::ostream &o, TargetMachine &tm, const TargetAsmInfo *T) - : AsmPrinter(o, tm, T), LabelNumber(0) { + : AsmPrinter(o, tm, T) { } - /// We name each basic block in a Function with a unique number, so - /// that we can consistently refer to them later. This is cleared - /// at the beginning of each call to runOnMachineFunction(). - /// - typedef std::map<const Value *, unsigned> ValueMapTy; - ValueMapTy NumberForBB; - std::string CurSection; - virtual const char *getPassName() const { return "Alpha Assembly Printer"; } @@ -54,7 +45,6 @@ namespace { void printOp(const MachineOperand &MO, bool IsCallOp = false); void printOperand(const MachineInstr *MI, int opNum); void printBaseOffsetPair (const MachineInstr *MI, int i, bool brackets=true); - void printMachineInstruction(const MachineInstr *MI); bool runOnMachineFunction(MachineFunction &F); bool doInitialization(Module &M); bool doFinalization(Module &M); @@ -136,20 +126,6 @@ void AlphaAsmPrinter::printOp(const MachineOperand &MO, bool IsCallOp) { } } -/// printMachineInstruction -- Print out a single Alpha MI to -/// the current output stream. -/// -void AlphaAsmPrinter::printMachineInstruction(const MachineInstr *MI) { - ++EmittedInsts; - if (printInstruction(MI)) - return; // Printer was automatically generated - - assert(0 && "Unhandled instruction in asm writer!"); - abort(); - return; -} - - /// runOnMachineFunction - This uses the printMachineInstruction() /// method to print assembly for each instruction. /// @@ -177,7 +153,7 @@ bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) { break; case Function::WeakLinkage: case Function::LinkOnceLinkage: - O << "\t.weak " << CurrentFnName << "\n"; + O << TAI->getWeakRefDirective() << CurrentFnName << "\n"; break; } @@ -188,16 +164,21 @@ bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) { // Print out code for the function. for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); I != E; ++I) { - printBasicBlockLabel(I, true); - O << '\n'; + if (I != MF.begin()) { + printBasicBlockLabel(I, true); + O << '\n'; + } for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end(); II != E; ++II) { // Print the assembly for the instruction. + ++EmittedInsts; O << "\t"; - printMachineInstruction(II); + if (!printInstruction(II)) { + assert(0 && "Unhandled instruction in asm writer!"); + abort(); + } } } - ++LabelNumber; O << "\t.end " << CurrentFnName << "\n"; diff --git a/lib/Target/Alpha/AlphaLLRP.cpp b/lib/Target/Alpha/AlphaLLRP.cpp index 06d217b..6e59e46 100644 --- a/lib/Target/Alpha/AlphaLLRP.cpp +++ b/lib/Target/Alpha/AlphaLLRP.cpp @@ -117,6 +117,9 @@ namespace { case Alpha::ALTENT: case Alpha::MEMLABEL: case Alpha::PCLABEL: + case Alpha::IDEF_I: + case Alpha::IDEF_F32: + case Alpha::IDEF_F64: --count; break; case Alpha::BR: diff --git a/lib/Target/Alpha/AlphaTargetAsmInfo.cpp b/lib/Target/Alpha/AlphaTargetAsmInfo.cpp index 80ccd31..233d2c7 100644 --- a/lib/Target/Alpha/AlphaTargetAsmInfo.cpp +++ b/lib/Target/Alpha/AlphaTargetAsmInfo.cpp @@ -20,4 +20,5 @@ AlphaTargetAsmInfo::AlphaTargetAsmInfo(const AlphaTargetMachine &TM) { PrivateGlobalPrefix = "$"; JumpTableDirective = ".gprel32"; JumpTableDataSection = "\t.section .rodata\n"; + WeakRefDirective = "\t.weak\t"; } |