[clang] 1783253 - [Attributes] Improve writing `ExprArgument` value.
Volodymyr Sapsai via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 14 11:21:28 PDT 2022
Author: Volodymyr Sapsai
Date: 2022-10-14T11:20:57-07:00
New Revision: 1783253c41f1b0ac378ab7fa4b6fe5547369c6b0
URL: https://github.com/llvm/llvm-project/commit/1783253c41f1b0ac378ab7fa4b6fe5547369c6b0
DIFF: https://github.com/llvm/llvm-project/commit/1783253c41f1b0ac378ab7fa4b6fe5547369c6b0.diff
LOG: [Attributes] Improve writing `ExprArgument` value.
Instead of dumping `Expr*` memory address, output `Expr` representation.
Differential Revision: https://reviews.llvm.org/D135931
Added:
Modified:
clang/test/SemaCXX/attr-print.cpp
clang/utils/TableGen/ClangAttrEmitter.cpp
Removed:
################################################################################
diff --git a/clang/test/SemaCXX/attr-print.cpp b/clang/test/SemaCXX/attr-print.cpp
index d7ef42306bd39..fa8059fc8ab36 100644
--- a/clang/test/SemaCXX/attr-print.cpp
+++ b/clang/test/SemaCXX/attr-print.cpp
@@ -43,3 +43,6 @@ class __multiple_inheritance MultipleInheritance;
// CHECK: class __virtual_inheritance VirtualInheritance;
class __virtual_inheritance VirtualInheritance;
+
+// CHECK: typedef double *aligned_double __attribute__((align_value(64)));
+typedef double * __attribute__((align_value(64))) aligned_double;
diff --git a/clang/utils/TableGen/ClangAttrEmitter.cpp b/clang/utils/TableGen/ClangAttrEmitter.cpp
index 79590832f7d1d..b7f7e507dd6cf 100644
--- a/clang/utils/TableGen/ClangAttrEmitter.cpp
+++ b/clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -1216,6 +1216,13 @@ namespace {
OS << " }\n";
}
+ void writeValue(raw_ostream &OS) const override {
+ OS << "\";\n";
+ OS << " get" << getUpperName()
+ << "()->printPretty(OS, nullptr, Policy);\n";
+ OS << " OS << \"";
+ }
+
void writeDump(raw_ostream &OS) const override {}
void writeDumpChildren(raw_ostream &OS) const override {
More information about the cfe-commits
mailing list