[PATCH] D135931: [Attributes] Improve writing `ExprArgument` value.
Volodymyr Sapsai via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 13 19:25:01 PDT 2022
vsapsai created this revision.
vsapsai added reviewers: aaron.ballman, erichkeane, rtrieu.
Herald added a subscriber: ributzka.
Herald added a project: All.
vsapsai requested review of this revision.
Herald added a project: clang.
Instead of dumping `Expr*` memory address, output `Expr` representation.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D135931
Files:
clang/test/SemaCXX/attr-print.cpp
clang/utils/TableGen/ClangAttrEmitter.cpp
Index: clang/utils/TableGen/ClangAttrEmitter.cpp
===================================================================
--- clang/utils/TableGen/ClangAttrEmitter.cpp
+++ clang/utils/TableGen/ClangAttrEmitter.cpp
@@ -1216,6 +1216,13 @@
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 {
Index: clang/test/SemaCXX/attr-print.cpp
===================================================================
--- clang/test/SemaCXX/attr-print.cpp
+++ clang/test/SemaCXX/attr-print.cpp
@@ -43,3 +43,6 @@
// 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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135931.467664.patch
Type: text/x-patch
Size: 1056 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221014/3247fefe/attachment.bin>
More information about the cfe-commits
mailing list