[PATCH] D141324: [clang] extend external_source_symbol attribute with the USR clause

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 19 10:36:26 PST 2023


erichkeane added inline comments.


================
Comment at: clang/include/clang/Basic/Attr.td:962
+  let Spellings = [Clang<"external_source_symbol", /*allowInC=*/1,
+                   /*version=*/2>];
   let Args = [StringArgument<"language", 1>,
----------------
For standards version numbers, we tend to set this to a 'date' more or less, so something like `20230119`.  I wonder if there is value to making THAT how we do this here too?


================
Comment at: clang/utils/TableGen/ClangAttrEmitter.cpp:3318
+    for (const auto &Spelling : Attr->getValueAsListOfDefs("Spellings")) {
+      if (Spelling->getValueAsString("Variety") == Variety ||
+          Spelling->getValueAsString("Variety") == "Clang") {
----------------
Why is this =="Clang" specific?  Since you've added the Version to the spelling, I'd anticipate us to just be able to grab it for the current spelling.  I wouldn't want an individual spelling here to override it, particularly since with this change Clang could potentially override the standards version.


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

https://reviews.llvm.org/D141324



More information about the cfe-commits mailing list