[PATCH] D96641: [XCOFF] [NFC] make StorageMappingClass/SymbolType member optional in MCSectionXCOFF class

Hubert Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 13 14:25:45 PST 2021


hubert.reinterpretcast added inline comments.


================
Comment at: llvm/lib/MC/MCSectionXCOFF.cpp:42
   if (getKind().isData()) {
-    switch (getMappingClass()) {
+    assert(getMappingClass() && "Data kind section should be a csect.");
+    switch (getMappingClass().getValue()) {
----------------
MaskRay wrote:
> assert is not needed because getValue() would fail too
I envision this patch ending up with some asserts on `isCsect` because custom asserts are friendlier when they trigger.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96641



More information about the llvm-commits mailing list