[PATCH] D45154: [x86] Model the direction flag (DF) separately from the rest of EFLAGS.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 9 19:37:07 PDT 2018


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp:273
+      // And then provide a zero terminating entry.
+      0,
   };
----------------
chandlerc wrote:
> craig.topper wrote:
> > Is this even needed? Was someone trying to protect against a trailing comma in the macro expansion? Which we now have outside...
> I assumed this was trying to create a null terminator.
> 
> I thought we made trailing commas a no-op for these things so that stuff like this was OK?
Yeah trailing commas are fine for this reason, except for in enums pre-C++11. I've personally fixed a number of tablegen emitters to not pad arrays with a 0 purely to prevent trailing commas even though it should never have been an issue. So I can believe that this is there for that reason. Maybe remove it and check with an assert against array_lengthof.

Should that array be declared "static const"? Does that make much difference to the code we output?


Repository:
  rL LLVM

https://reviews.llvm.org/D45154





More information about the llvm-commits mailing list