diff options
| author | Nick Desaulniers <ndesaulniers@google.com> | 2019-04-11 22:47:13 +0000 |
|---|---|---|
| committer | Nick Desaulniers <ndesaulniers@google.com> | 2019-04-11 22:47:13 +0000 |
| commit | 8ec304c9fd92442393fcdd98f08fa07ac3ccf5df (patch) | |
| tree | 2c922aaba1b2711b021da69f3643147520f6c048 /llvm/lib/Target/X86/X86AsmPrinter.h | |
| parent | 2edfcf9065940df55012a1d85f749437cce8c765 (diff) | |
| download | bcm5719-llvm-8ec304c9fd92442393fcdd98f08fa07ac3ccf5df.tar.gz bcm5719-llvm-8ec304c9fd92442393fcdd98f08fa07ac3ccf5df.zip | |
[X86AsmPrinter] refactor static functions into private methods. NFC
Summary:
A lot of the code for printing special cases of operands in this
translation unit are static functions. While I too have suffered many
years of abuse at the hands of C, we should prefer private methods,
particularly when you start passing around *this as your first argument,
which is a code smell.
This will help make generic vs arch specific asm printing easier, as it
brings X86AsmPrinter more in line with other arch's derived AsmPrinters.
We will then be able to more easily move architecture generic code to
the base class, and architecture specific code to the derived classes.
Some other small refactorings while we're here:
- the parameter Op is now consistently OpNo
- add spaces around binary expressions. I know we're not millionaires
but c'mon.
Reviewers: echristo
Reviewed By: echristo
Subscribers: smeenai, hiraditya, llvm-commits, srhines, craig.topper
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60577
llvm-svn: 358236
Diffstat (limited to 'llvm/lib/Target/X86/X86AsmPrinter.h')
| -rw-r--r-- | llvm/lib/Target/X86/X86AsmPrinter.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86AsmPrinter.h b/llvm/lib/Target/X86/X86AsmPrinter.h index ebb3b18346a..fd49d154c65 100644 --- a/llvm/lib/Target/X86/X86AsmPrinter.h +++ b/llvm/lib/Target/X86/X86AsmPrinter.h @@ -102,6 +102,18 @@ class LLVM_LIBRARY_VISIBILITY X86AsmPrinter : public AsmPrinter { // Choose between emitting .seh_ directives and .cv_fpo_ directives. void EmitSEHInstruction(const MachineInstr *MI); + void PrintSymbolOperand(const MachineOperand &MO, raw_ostream &O); + void PrintOperand(const MachineInstr *MI, unsigned OpNo, raw_ostream &O); + void PrintModifiedOperand(const MachineInstr *MI, unsigned OpNo, + raw_ostream &O, const char *Modifier); + void PrintPCRelImm(const MachineInstr *MI, unsigned OpNo, raw_ostream &O); + void PrintLeaMemReference(const MachineInstr *MI, unsigned OpNo, + raw_ostream &O, const char *Modifier); + void PrintMemReference(const MachineInstr *MI, unsigned OpNo, raw_ostream &O, + const char *Modifier); + void PrintIntelMemReference(const MachineInstr *MI, unsigned OpNo, + raw_ostream &O); + public: X86AsmPrinter(TargetMachine &TM, std::unique_ptr<MCStreamer> Streamer); |

