[clang] [clang] Fix pretty-printing assume_aligned attributes (PR #67331)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 26 06:39:28 PDT 2023


================
@@ -320,11 +320,12 @@ namespace {
     }
 
     std::string getIsOmitted() const override {
-      if (type == "IdentifierInfo *")
+      StringRef T = type;
+      if (T == "IdentifierInfo *" || T == "Expr *")
         return "!get" + getUpperName().str() + "()";
-      if (type == "TypeSourceInfo *")
+      if (T == "TypeSourceInfo *")
         return "!get" + getUpperName().str() + "Loc()";
-      if (type == "ParamIdx")
+      if (T == "ParamIdx")
         return "!get" + getUpperName().str() + "().isValid()";
       return "false";
----------------
erichkeane wrote:

So the bit I requested was an assert over 330 here that is: `assert(T=="somethingnothandled" || T=="somethingelsenothandled" || ...)` so that we can catch this in the future.

You SHOULD be able to figure out the list by doing a couple of builds here to see (note that you dont' have to do check-clang, just 'ninja clang' (or w/e), since this is tablegen.

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


More information about the cfe-commits mailing list