From: Kevin Enderby Date: Fri, 15 Jul 2011 18:30:43 +0000 (+0000) Subject: Have tblgen produce code that tolerates operands that return an invalid match class. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=893818347e9d7b34ea99ae9c984934c9b6bf92da;p=oota-llvm.git 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 --- diff --git a/utils/TableGen/AsmMatcherEmitter.cpp b/utils/TableGen/AsmMatcherEmitter.cpp index d9c3b84d6c2..a6a4fecd301 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";