[clang] [clang] Fix pretty-printing assume_aligned attributes (PR #67331)
Balazs Benics via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 25 23:59:23 PDT 2023
================
@@ -320,10 +320,11 @@ namespace {
}
std::string getIsOmitted() const override {
- if (type == "IdentifierInfo *")
- return "!get" + getUpperName().str() + "()";
- if (type == "TypeSourceInfo *")
+ StringRef T = type;
+ if (T == "TypeSourceInfo *")
return "!get" + getUpperName().str() + "Loc()";
+ if (T.ends_with(" *"))
+ return "!get" + getUpperName().str() + "()";
----------------
steakhal wrote:
Indeed, there are more pointer things in the "type" field. Different kinds of Decls and could be others as well.
I agree that the safest is to only enable this for "Expr *".
https://github.com/llvm/llvm-project/pull/67331
More information about the cfe-commits
mailing list