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

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 9 22:31:04 PDT 2018


chandlerc marked 3 inline comments as done.
chandlerc added inline comments.


================
Comment at: llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp:273
+      // And then provide a zero terminating entry.
+      0,
   };
----------------
craig.topper wrote:
> 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?
Hey, it works!

Removed all the cruft, directly expanded the macro in the curly braces.

I switched to `static constexpr`. Technically speaking with `const` it remains ambiguous whether the initializer will be run dynamically (which would be unfortunate, once-init barrier and everything). But with constexpr we get what we really want: an actual constant blob of data with nothing else going on.


Repository:
  rL LLVM

https://reviews.llvm.org/D45154





More information about the llvm-commits mailing list