[PATCH] D78276: [X86][MC][NFC] Reduce the parameters of functions in X86MCCodeEmitter(Part II)

Kan Shengchen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 00:02:48 PDT 2020


skan created this revision.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

We determine the REX prefix used by instruction in `determineREXPrefix`,
and this value is used in `emitMemModRMByte' and used as the return
value of `emitOpcodePrefix`.

Before this patch, REX was passed as reference to `emitPrefixImpl`, it
is strange and not necessary, e.g, we have to write

  bool Rex = false;
  emitPrefixImpl(CurOp, CurByte, Rex, MI, STI, OS);

in `emitPrefix` even if `Rex` will not be used.

So we let REX be the return value of `emitPrefixImpl`. The REX is passed
from `emitREXPrefix` to  `emitOpcodePrefix` and then to
`emitPrefixImpl`. This makes sense since REX is a kind of opcode prefix
and of course is a prefix.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78276

Files:
  llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78276.257969.patch
Type: text/x-patch
Size: 10075 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200416/fcb0c672/attachment.bin>


More information about the llvm-commits mailing list