[PATCH] D132222: [Assignment Tracking][3/*] Add DIAssignID metadata boilerplate

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 7 01:56:12 PDT 2022


Orlando added inline comments.


================
Comment at: llvm/lib/AsmParser/LLParser.cpp:4419-4420
+bool LLParser::parseDIAssignID(MDNode *&Result, bool IsDistinct) {
+  if (!IsDistinct)
+    return Lex.Error("missing 'distinct', required for !DIAssignID()");
+
----------------
Orlando wrote:
> @jmorse I was writing up the verifier tests you asked for and noticed that the verifier check that DIAssignID nodes are distinct doesn't fire because LLParser (here) gets there first. Do you have a a preference as to whether the check stays here or is removed (relying on the verifier to catch the error if it came from IR in a file)?
> 
> On the one hand, it's not a syntactic requirement for DIAssignID to be distinct. OTOH, it's a semantic requirement and we can catch it here.
> 
> Either way, we should keep the verifier check given a pass may possibly somehow generate non-distinct DIAssignID.
It's also not possible to cause verifier failures by adding operands to DIAssignID (see code below), so I've just added a test the parser parses things expectedly in a new directory parse-and-verify.


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

https://reviews.llvm.org/D132222



More information about the llvm-commits mailing list