[PATCH] D36793: [X86AsmParser] Refactoring, (almost) NFC.

coby via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 19 15:08:40 PDT 2017


coby added a comment.

In https://reviews.llvm.org/D36793#845245, @avt77 wrote:

> IntelExpr::isValid looks rather strange because it validates possible multiplication only. But if we have Scale == 1 and don't have either BaseReg or Disp?


first of all, thanks for your comment.
AOK_IntelExpr is a rewrite mechanism, and as such its mandate is to be a dumb (but convenient) conveyor. 'isValid()', under those guidelines, checks some most trivial parts which can be inferred with ease. others parts are assumed to be validated on the path that led to its emission (either pre or post).
Specific to the scenario you've described - if we 'have' Scale == 1 (which is the default case) any other part is 'considered' legal (to the purpose of this rewrite, again - this is simply a conveyor - we expect validation effort to be conducted by the parser). Index/Base/ImmDisp will be emitted if present.


Repository:
  rL LLVM

https://reviews.llvm.org/D36793





More information about the llvm-commits mailing list