[PATCH] D115128: [TableGen][CodeEmitter] Introducing the VarLenCodeEmitterGen infrastructure

Min-Yih Hsu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 6 17:08:54 PST 2021


myhsu added inline comments.


================
Comment at: llvm/utils/TableGen/VarLenCodeEmitterGen.cpp:46-48
+    if (!isa<StringInit>(OperandName) && !isa<IntInit>(HiBit) &&
+        (LoBit && !isa<IntInit>(LoBit)))
+      PrintFatalError("Invalid format for operand");
----------------
0x59616e wrote:
> Hi,
> First off, I want to appreciate for all of your hard work. That's awesome. Really.
> 
> I have a question: shouldn't that `&&` be `||` ?
> 
> My understanding is: We have to make sure that every argument is what it should be.
> 
> In this case, the first argument should be StringInit, the second should be IntInit, etc.
> 
> So, if one of them is incorret, then it is fatal error.
> 
> But this logic in the if statement won't fail unless all of the two (or three) arguments are  not what they should be.
> 
> Thanks for reading this comment :)
> 
> 
yes you're right. Thanks!


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115128/new/

https://reviews.llvm.org/D115128



More information about the llvm-commits mailing list