[PATCH] D118311: [Clang][ModuleMap] Add conditional parsing via requires block declaration

Bruno Cardoso Lopes via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 3 16:04:33 PST 2022


bruno requested changes to this revision.
bruno added a comment.
This revision now requires changes to proceed.
Herald added a project: All.

> It would be nice to have some mechanism to notify developers that includes are still performed regardless of requires

I'd like to see a module remark for whenever a match fails `-Rmodule-requires-fail` or something like that. I've been bitten before by a regular submodule `requires` not triggering, just to find out some specific subfeature was missing in the compiler invocation - it can take a while to spot that. Doesn't need to be a blocker for getting this in though.



================
Comment at: clang/docs/Modules.rst:657
+    }
+  }
+
----------------
Nice doc and examples!


================
Comment at: clang/include/clang/Basic/DiagnosticLexKinds.td:723
+  "invalid requires declaration outside of a module declaration, did you mean"
+  " to add '{' to open a requires block?">;
 def err_mmap_expected_rbrace : Error<"expected '}'">;
----------------
I'm not really too worried about a fixit here, but it would be nice if the "did you mean..." part came out of a note instead.


================
Comment at: clang/lib/Lex/ModuleMap.cpp:2355
+        parseModuleMembers();
+      }
+    }
----------------
Too many curly braces?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118311



More information about the llvm-commits mailing list