OSDN Git Service

[X86AsmPrinter] refactor static functions into private methods. NFC
authorNick Desaulniers <ndesaulniers@google.com>
Thu, 11 Apr 2019 22:47:13 +0000 (22:47 +0000)
committerNick Desaulniers <ndesaulniers@google.com>
Thu, 11 Apr 2019 22:47:13 +0000 (22:47 +0000)
commitbfffca94649041d5a5ec93e2c45d0ac6dc019a41
tree18d3f4c8514d51a7260e9f7e7ed218d9780c1b2c
parent0907e8aafad5ca8cbbfde20eda64b08d2e4b22e6
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358236 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86AsmPrinter.cpp
lib/Target/X86/X86AsmPrinter.h