[llvm-commits] [llvm] r156263 - /llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
David Blaikie
dblaikie at gmail.com
Sun May 6 10:41:30 PDT 2012
On Sun, May 6, 2012 at 10:33 AM, Jim Grosbach <grosbach at apple.com> wrote:
> Author: grosbach
> Date: Sun May 6 12:33:14 2012
> New Revision: 156263
>
> URL: http://llvm.org/viewvc/llvm-project?rev=156263&view=rev
> Log:
> TableGen: AsmMatcher diagnostic when missing instruction mnemonic.
Test case?
>
> Previously, if an instruction definition was missing the mnemonic,
> the next line would just assert(). Issue a real diagnostic instead.
>
> Modified:
> llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
>
> Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=156263&r1=156262&r2=156263&view=diff
> ==============================================================================
> --- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
> +++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Sun May 6 12:33:14 2012
> @@ -825,6 +825,9 @@
> throw TGError(TheDef->getLoc(),
> "Instruction '" + TheDef->getName() + "' has no tokens");
> Mnemonic = AsmOperands[0].Token;
> + if (Mnemonic.empty())
> + throw TGError(TheDef->getLoc(),
> + "Missing instruction mnemonic");
> // FIXME : Check and raise an error if it is a register.
> if (Mnemonic[0] == '$')
> throw TGError(TheDef->getLoc(),
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list