[PATCH] D47145: [X86][ELF][CET] Adding the .note.gnu.property ELF section in X86

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 30 02:45:20 PDT 2018


grimar added inline comments.


================
Comment at: llvm/lib/Target/X86/X86AsmPrinter.cpp:557
+      int WordSize = TT.isArch64Bit() ? 8 : 4;
+      assert((TT.isArch32Bit() || WordSize == 8) &&
+             "CFProtection used on invalid architecture");
----------------
I would move this assert to the beginning of the scope
and also use `isArch64Bit` for consistency:

```
if (FeatureFlagsAnd) {
  assert((TT.isArch32Bit() || TT.isArch64Bit()) && ...
```

But actually.. is it really possible to arch be 16 bits in X86AsmPrinter?
It seems this assert is just redundant. And if that would be possible, it should be
an explicit error probably.


https://reviews.llvm.org/D47145





More information about the llvm-commits mailing list