[llvm] r208607 - TableGen: use PrintMethods to print more aliases

Simon Atanasyan simon at atanasyan.com
Tue May 13 00:04:42 PDT 2014


Hi,

On Mon, May 12, 2014 at 10:04 PM, Tim Northover <tnorthover at apple.com> wrote:
> Author: tnorthover
> Date: Mon May 12 13:04:06 2014
> New Revision: 208607
>
> URL: http://llvm.org/viewvc/llvm-project?rev=208607&view=rev
> Log:
> TableGen: use PrintMethods to print more aliases

[...]

> ==============================================================================
> --- llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp (original)
> +++ llvm/trunk/utils/TableGen/AsmWriterEmitter.cpp Mon May 12 13:04:06 2014

[...]

> +  void addOperand(StringRef Op, int OpIdx, int PrintMethodIdx = -1) {
> +    assert(OpIdx >= 0 && OpIdx < 0xFE && "Idx out of range");
> +    assert(PrintMethodIdx == -1 || PrintMethodIdx < 0xFF && "Idx out of range");

Just a bit curious, is say -100 a valid value for the PrintMethodIdx?
Maybe this assert should be written as "assert(PrintMethodIdx >= -1 &&
PrintMethodIdx < 0xFF && "Idx out of range")"?

-- 
Simon Atanasyan



More information about the llvm-commits mailing list