diff options
| author | David Greene <greened@obbligato.org> | 2009-07-31 21:57:10 +0000 |
|---|---|---|
| committer | David Greene <greened@obbligato.org> | 2009-07-31 21:57:10 +0000 |
| commit | bef8768bd0576eec0470a80e3039cd5d1fd50c6b (patch) | |
| tree | cdbbfbd8dc140331cb27e6ee91ae5350a4fc9b05 /include/llvm/CodeGen | |
| parent | 76c4d7696c1eb566d53467a76024c5fdadd448e4 (diff) | |
Simplify operand padding by keying off tabs in the asm stream. If
padding is disabled, tabs get replaced by spaces except in the case of
the first operand, where the tab is output to line up the operands after
the mnemonics.
Add some better comments and eliminate redundant code.
Fix some testcases to not assume tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77740 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen')
| -rw-r--r-- | include/llvm/CodeGen/AsmPrinter.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h index e3d6074adc..7cdf0a7c7b 100644 --- a/include/llvm/CodeGen/AsmPrinter.h +++ b/include/llvm/CodeGen/AsmPrinter.h @@ -226,11 +226,10 @@ namespace llvm { unsigned AsmVariant, const char *ExtraCode); - /// PrintGlobalVariable - Emit the specified global variable and its /// initializer to the output stream. virtual void PrintGlobalVariable(const GlobalVariable *GV) = 0; - + /// SetupMachineFunction - This should be called when a new MachineFunction /// is being processed from runOnMachineFunction. void SetupMachineFunction(MachineFunction &MF); @@ -357,6 +356,13 @@ namespace llvm { void EmitComments(const MCInst &MI) const; protected: + /// PadToColumn - This gets called every time a tab is emitted. If + /// column padding is turned on, we replace the tab with the + /// appropriate amount of padding. If not, we replace the tab with a + /// space, except for the first operand so that initial operands are + /// always lined up by tabs. + void PadToColumn(unsigned Operand) const; + /// EmitZeros - Emit a block of zeros. /// void EmitZeros(uint64_t NumZeros, unsigned AddrSpace = 0) const; |
