diff options
author | Kevin Enderby <enderby@apple.com> | 2011-07-15 18:30:43 +0000 |
---|---|---|
committer | Kevin Enderby <enderby@apple.com> | 2011-07-15 18:30:43 +0000 |
commit | 893818347e9d7b34ea99ae9c984934c9b6bf92da (patch) | |
tree | f879c940875bff041aa2589dbc0783ff504c8fc5 /utils | |
parent | 71400b6afa3a650cac0ace1beb24a35518555f56 (diff) |
Have tblgen produce code that tolerates operands that return an invalid match class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135287 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/AsmMatcherEmitter.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp index d9c3b84d6c..a6a4fecd30 100644 --- a/utils/TableGen/AsmMatcherEmitter.cpp +++ b/utils/TableGen/AsmMatcherEmitter.cpp @@ -1656,6 +1656,10 @@ static void EmitValidateOperandClass(AsmMatcherInfo &Info, OS << " " << Info.Target.getName() << "Operand &Operand = *(" << Info.Target.getName() << "Operand*)GOp;\n"; + // The InvalidMatchClass is not to match any operand. + OS << " if (Kind == InvalidMatchClass)\n"; + OS << " return false;\n\n"; + // Check for Token operands first. OS << " if (Operand.isToken())\n"; OS << " return MatchTokenString(Operand.getToken()) == Kind;\n\n"; |