[clang] [Attributes] Support Attributes being declared as only supporting late parsing when passing an experimental feature flag (PR #88596)

via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 13 22:46:24 PDT 2024


================
@@ -2101,9 +2179,20 @@ bool PragmaClangAttributeSupport::isAttributedSupported(
     return SpecifiedResult;
 
   // Opt-out rules:
-  // An attribute requires delayed parsing (LateParsed is on)
-  if (Attribute.getValueAsBit("LateParsed"))
+
+  // An attribute requires delayed parsing (LateParsed is on).
+  switch (getLateAttrParseKind(&Attribute)) {
+  case LateAttrParseKind::LateAttrParsingNever:
+    break;
+  case LateAttrParseKind::LateAttrParsingAlways:
+    return false;
+  case LateAttrParseKind::LateAttrParsingExperimentalOnly:
+    // FIXME: This is only late parsed when
+    // `-fexperimental-late-parse-attributes` is on. If that option is off
+    // then we shouldn't return here.
     return false;
----------------
Sirraide wrote:

I’d leave a comment here explaining the situation; I’m just saying that I’m not convinced there really is any ‘fixing’ this here w/o making the code around `IsSupportedByPragmaAttribute` aware of this, which seems like a strange thing to do.


https://github.com/llvm/llvm-project/pull/88596


More information about the cfe-commits mailing list