OSDN Git Service

[X86][AsmParser] Rework the in/out (%dx) hack one more time.
authorCraig Topper <craig.topper@intel.com>
Tue, 3 Jul 2018 18:07:30 +0000 (18:07 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 3 Jul 2018 18:07:30 +0000 (18:07 +0000)
commitf4212f0917fbd9815da88efb7fbfffa5c7484681
tree01f0800a01fe0d38a521401ccc5bd9336ad6e3c3
parent773b6e54313bbf32633c9c6df6d60b4fffbdf715
[X86][AsmParser] Rework the in/out (%dx) hack one more time.

This patch adds a new token type specifically for (%dx). We will now always create this token when we parse (%dx). After all operands have been parsed, if the mnemonic is in/out we'll morph this token to a regular register token. Otherwise we keep it as the special DX token which won't match any instructions.

This removes the need for passing Mnemonic through the parsing functions. It also seems closer to gas where when its used on the wrong instruction it just gets diagnosed as an invalid operand rather than a bad memory address.

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