[PATCH] D100854: [TableGen] Change assertion information from a tuple to a struct [NFC]

Paul C. Anagnostopoulos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 20 10:30:44 PDT 2021


Paul-C-Anagnostopoulos added a comment.

Thanks, @dblaikie. I will incorporated your suggestions and the linties.



================
Comment at: llvm/lib/TableGen/TGParser.cpp:368
   if (E.Assertion) {
-    CheckAssert(std::get<0>(*E.Assertion), std::get<1>(*E.Assertion), 
-                std::get<2>(*E.Assertion));
+    CheckAssert((*E.Assertion).AssertionInfo::Loc,
+                (*E.Assertion).AssertionInfo::Condition, 
----------------
dblaikie wrote:
> This is some very strange/non-idiomatic code. Why are the member accesses qualified like this?
> 
> I'd expect this code to look more like: `E.Assertion->Loc` for instance
I was hoping someone would tell me how to simplify this. Why do I need 'AssertionInfo::' this way, but not with '->Loc'?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100854



More information about the llvm-commits mailing list