[PATCH] D121961: [clang] Produce a "multiversion" annotation in textual AST output.

2022-03-21 Thread Tom Honermann via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG0cceee755992: [clang] Produce a multiversion 
annotation in textual AST output. (authored by tahonermann).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121961

Files:
  clang/lib/AST/TextNodeDumper.cpp
  clang/test/AST/ast-dump-funcs-multiversion.c


Index: clang/test/AST/ast-dump-funcs-multiversion.c
===
--- /dev/null
+++ clang/test/AST/ast-dump-funcs-multiversion.c
@@ -0,0 +1,23 @@
+// Test without serialization:
+// RUN: %clang_cc1 -triple x86_64-pc-linux -ast-dump -ast-dump-filter Test %s \
+// RUN: | FileCheck --strict-whitespace %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -triple x86_64-pc-linux -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c -triple x86_64-pc-linux -include-pch %t \
+// RUN:-ast-dump-all -ast-dump-filter Test /dev/null \
+// RUN: | sed -e "s/ //" -e "s/ imported//" \
+// RUN: | FileCheck --strict-whitespace %s
+
+void TestUnattributedMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion 
TestUnattributedMVF
+__attribute__((target("default"))) void TestUnattributedMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} prev 0x{{[^ ]*}} <{{.*}}> 
col:{{[0-9]*}} multiversion TestUnattributedMVF
+
+__attribute__((target("mmx"))) void TestNonMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} TestNonMVF
+
+__attribute__((target("mmx"))) void TestRetroMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion 
TestRetroMVF
+__attribute__((target("sse"))) void TestRetroMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion 
TestRetroMVF
Index: clang/lib/AST/TextNodeDumper.cpp
===
--- clang/lib/AST/TextNodeDumper.cpp
+++ clang/lib/AST/TextNodeDumper.cpp
@@ -283,6 +283,8 @@
   OS << " constexpr";
 if (FD->isConsteval())
   OS << " consteval";
+if (FD->isMultiVersion())
+  OS << " multiversion";
   }
 
   if (!isa(*D)) {


Index: clang/test/AST/ast-dump-funcs-multiversion.c
===
--- /dev/null
+++ clang/test/AST/ast-dump-funcs-multiversion.c
@@ -0,0 +1,23 @@
+// Test without serialization:
+// RUN: %clang_cc1 -triple x86_64-pc-linux -ast-dump -ast-dump-filter Test %s \
+// RUN: | FileCheck --strict-whitespace %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -triple x86_64-pc-linux -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c -triple x86_64-pc-linux -include-pch %t \
+// RUN:-ast-dump-all -ast-dump-filter Test /dev/null \
+// RUN: | sed -e "s/ //" -e "s/ imported//" \
+// RUN: | FileCheck --strict-whitespace %s
+
+void TestUnattributedMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion TestUnattributedMVF
+__attribute__((target("default"))) void TestUnattributedMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} prev 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion TestUnattributedMVF
+
+__attribute__((target("mmx"))) void TestNonMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} TestNonMVF
+
+__attribute__((target("mmx"))) void TestRetroMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion TestRetroMVF
+__attribute__((target("sse"))) void TestRetroMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion TestRetroMVF
Index: clang/lib/AST/TextNodeDumper.cpp
===
--- clang/lib/AST/TextNodeDumper.cpp
+++ clang/lib/AST/TextNodeDumper.cpp
@@ -283,6 +283,8 @@
   OS << " constexpr";
 if (FD->isConsteval())
   OS << " consteval";
+if (FD->isMultiVersion())
+  OS << " multiversion";
   }
 
   if (!isa(*D)) {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121961: [clang] Produce a "multiversion" annotation in textual AST output.

2022-03-19 Thread Tom Honermann via Phabricator via cfe-commits
tahonermann added a comment.

> I was surprised to see the Windows CI pass with that sed invocation!

Ha! I didn't even think about that. I had copied the `RUN` lines from another 
test and only adjusted what was necessary. The bots must have Cygwin, MSYS[2], 
GnuWin32, or similar installed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121961

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121961: [clang] Produce a "multiversion" annotation in textual AST output.

2022-03-19 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM (I was surprised to see the Windows CI pass with that `sed` invocation!)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121961

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121961: [clang] Produce a "multiversion" annotation in textual AST output.

2022-03-18 Thread Tom Honermann via Phabricator via cfe-commits
tahonermann updated this revision to Diff 416668.
tahonermann added a comment.

Rebase to acquire fixes from parent commits.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121961

Files:
  clang/lib/AST/TextNodeDumper.cpp
  clang/test/AST/ast-dump-funcs-multiversion.c


Index: clang/test/AST/ast-dump-funcs-multiversion.c
===
--- /dev/null
+++ clang/test/AST/ast-dump-funcs-multiversion.c
@@ -0,0 +1,23 @@
+// Test without serialization:
+// RUN: %clang_cc1 -triple x86_64-pc-linux -ast-dump -ast-dump-filter Test %s \
+// RUN: | FileCheck --strict-whitespace %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -triple x86_64-pc-linux -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c -triple x86_64-pc-linux -include-pch %t \
+// RUN:-ast-dump-all -ast-dump-filter Test /dev/null \
+// RUN: | sed -e "s/ //" -e "s/ imported//" \
+// RUN: | FileCheck --strict-whitespace %s
+
+void TestUnattributedMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion 
TestUnattributedMVF
+__attribute__((target("default"))) void TestUnattributedMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} prev 0x{{[^ ]*}} <{{.*}}> 
col:{{[0-9]*}} multiversion TestUnattributedMVF
+
+__attribute__((target("mmx"))) void TestNonMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} TestNonMVF
+
+__attribute__((target("mmx"))) void TestRetroMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion 
TestRetroMVF
+__attribute__((target("sse"))) void TestRetroMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion 
TestRetroMVF
Index: clang/lib/AST/TextNodeDumper.cpp
===
--- clang/lib/AST/TextNodeDumper.cpp
+++ clang/lib/AST/TextNodeDumper.cpp
@@ -283,6 +283,8 @@
   OS << " constexpr";
 if (FD->isConsteval())
   OS << " consteval";
+if (FD->isMultiVersion())
+  OS << " multiversion";
   }
 
   if (!isa(*D)) {


Index: clang/test/AST/ast-dump-funcs-multiversion.c
===
--- /dev/null
+++ clang/test/AST/ast-dump-funcs-multiversion.c
@@ -0,0 +1,23 @@
+// Test without serialization:
+// RUN: %clang_cc1 -triple x86_64-pc-linux -ast-dump -ast-dump-filter Test %s \
+// RUN: | FileCheck --strict-whitespace %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -triple x86_64-pc-linux -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c -triple x86_64-pc-linux -include-pch %t \
+// RUN:-ast-dump-all -ast-dump-filter Test /dev/null \
+// RUN: | sed -e "s/ //" -e "s/ imported//" \
+// RUN: | FileCheck --strict-whitespace %s
+
+void TestUnattributedMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion TestUnattributedMVF
+__attribute__((target("default"))) void TestUnattributedMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} prev 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion TestUnattributedMVF
+
+__attribute__((target("mmx"))) void TestNonMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} TestNonMVF
+
+__attribute__((target("mmx"))) void TestRetroMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion TestRetroMVF
+__attribute__((target("sse"))) void TestRetroMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion TestRetroMVF
Index: clang/lib/AST/TextNodeDumper.cpp
===
--- clang/lib/AST/TextNodeDumper.cpp
+++ clang/lib/AST/TextNodeDumper.cpp
@@ -283,6 +283,8 @@
   OS << " constexpr";
 if (FD->isConsteval())
   OS << " consteval";
+if (FD->isMultiVersion())
+  OS << " multiversion";
   }
 
   if (!isa(*D)) {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121961: [clang] Produce a "multiversion" annotation in textual AST output.

2022-03-18 Thread Tom Honermann via Phabricator via cfe-commits
tahonermann updated this revision to Diff 416645.
tahonermann added a comment.

Rebase.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121961

Files:
  clang/lib/AST/TextNodeDumper.cpp
  clang/test/AST/ast-dump-funcs-multiversion.c


Index: clang/test/AST/ast-dump-funcs-multiversion.c
===
--- /dev/null
+++ clang/test/AST/ast-dump-funcs-multiversion.c
@@ -0,0 +1,23 @@
+// Test without serialization:
+// RUN: %clang_cc1 -triple x86_64-pc-linux -ast-dump -ast-dump-filter Test %s \
+// RUN: | FileCheck --strict-whitespace %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -triple x86_64-pc-linux -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c -triple x86_64-pc-linux -include-pch %t \
+// RUN:-ast-dump-all -ast-dump-filter Test /dev/null \
+// RUN: | sed -e "s/ //" -e "s/ imported//" \
+// RUN: | FileCheck --strict-whitespace %s
+
+void TestUnattributedMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion 
TestUnattributedMVF
+__attribute__((target("default"))) void TestUnattributedMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} prev 0x{{[^ ]*}} <{{.*}}> 
col:{{[0-9]*}} multiversion TestUnattributedMVF
+
+__attribute__((target("mmx"))) void TestNonMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} TestNonMVF
+
+__attribute__((target("mmx"))) void TestRetroMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion 
TestRetroMVF
+__attribute__((target("sse"))) void TestRetroMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion 
TestRetroMVF
Index: clang/lib/AST/TextNodeDumper.cpp
===
--- clang/lib/AST/TextNodeDumper.cpp
+++ clang/lib/AST/TextNodeDumper.cpp
@@ -283,6 +283,8 @@
   OS << " constexpr";
 if (FD->isConsteval())
   OS << " consteval";
+if (FD->isMultiVersion())
+  OS << " multiversion";
   }
 
   if (!isa(*D)) {


Index: clang/test/AST/ast-dump-funcs-multiversion.c
===
--- /dev/null
+++ clang/test/AST/ast-dump-funcs-multiversion.c
@@ -0,0 +1,23 @@
+// Test without serialization:
+// RUN: %clang_cc1 -triple x86_64-pc-linux -ast-dump -ast-dump-filter Test %s \
+// RUN: | FileCheck --strict-whitespace %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -triple x86_64-pc-linux -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c -triple x86_64-pc-linux -include-pch %t \
+// RUN:-ast-dump-all -ast-dump-filter Test /dev/null \
+// RUN: | sed -e "s/ //" -e "s/ imported//" \
+// RUN: | FileCheck --strict-whitespace %s
+
+void TestUnattributedMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion TestUnattributedMVF
+__attribute__((target("default"))) void TestUnattributedMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} prev 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion TestUnattributedMVF
+
+__attribute__((target("mmx"))) void TestNonMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} TestNonMVF
+
+__attribute__((target("mmx"))) void TestRetroMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion TestRetroMVF
+__attribute__((target("sse"))) void TestRetroMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion TestRetroMVF
Index: clang/lib/AST/TextNodeDumper.cpp
===
--- clang/lib/AST/TextNodeDumper.cpp
+++ clang/lib/AST/TextNodeDumper.cpp
@@ -283,6 +283,8 @@
   OS << " constexpr";
 if (FD->isConsteval())
   OS << " consteval";
+if (FD->isMultiVersion())
+  OS << " multiversion";
   }
 
   if (!isa(*D)) {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121961: [clang] Produce a "multiversion" annotation in textual AST output.

2022-03-18 Thread Tom Honermann via Phabricator via cfe-commits
tahonermann updated this revision to Diff 416618.
tahonermann added a comment.

Added a test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121961

Files:
  clang/lib/AST/TextNodeDumper.cpp
  clang/test/AST/ast-dump-funcs-multiversion.c


Index: clang/test/AST/ast-dump-funcs-multiversion.c
===
--- /dev/null
+++ clang/test/AST/ast-dump-funcs-multiversion.c
@@ -0,0 +1,23 @@
+// Test without serialization:
+// RUN: %clang_cc1 -triple x86_64-pc-linux -ast-dump -ast-dump-filter Test %s \
+// RUN: | FileCheck --strict-whitespace %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -triple x86_64-pc-linux -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c -triple x86_64-pc-linux -include-pch %t \
+// RUN:-ast-dump-all -ast-dump-filter Test /dev/null \
+// RUN: | sed -e "s/ //" -e "s/ imported//" \
+// RUN: | FileCheck --strict-whitespace %s
+
+void TestUnattributedMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion 
TestUnattributedMVF
+__attribute__((target("default"))) void TestUnattributedMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} prev 0x{{[^ ]*}} <{{.*}}> 
col:{{[0-9]*}} multiversion TestUnattributedMVF
+
+__attribute__((target("mmx"))) void TestNonMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} TestNonMVF
+
+__attribute__((target("mmx"))) void TestRetroMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion 
TestRetroMVF
+__attribute__((target("sse"))) void TestRetroMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion 
TestRetroMVF
Index: clang/lib/AST/TextNodeDumper.cpp
===
--- clang/lib/AST/TextNodeDumper.cpp
+++ clang/lib/AST/TextNodeDumper.cpp
@@ -283,6 +283,8 @@
   OS << " constexpr";
 if (FD->isConsteval())
   OS << " consteval";
+if (FD->isMultiVersion())
+  OS << " multiversion";
   }
 
   if (!isa(*D)) {


Index: clang/test/AST/ast-dump-funcs-multiversion.c
===
--- /dev/null
+++ clang/test/AST/ast-dump-funcs-multiversion.c
@@ -0,0 +1,23 @@
+// Test without serialization:
+// RUN: %clang_cc1 -triple x86_64-pc-linux -ast-dump -ast-dump-filter Test %s \
+// RUN: | FileCheck --strict-whitespace %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -triple x86_64-pc-linux -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c -triple x86_64-pc-linux -include-pch %t \
+// RUN:-ast-dump-all -ast-dump-filter Test /dev/null \
+// RUN: | sed -e "s/ //" -e "s/ imported//" \
+// RUN: | FileCheck --strict-whitespace %s
+
+void TestUnattributedMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion TestUnattributedMVF
+__attribute__((target("default"))) void TestUnattributedMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} prev 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion TestUnattributedMVF
+
+__attribute__((target("mmx"))) void TestNonMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} TestNonMVF
+
+__attribute__((target("mmx"))) void TestRetroMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion TestRetroMVF
+__attribute__((target("sse"))) void TestRetroMVF(void);
+// CHECK:  FunctionDecl 0x{{[^ ]*}} <{{.*}}> col:{{[0-9]*}} multiversion TestRetroMVF
Index: clang/lib/AST/TextNodeDumper.cpp
===
--- clang/lib/AST/TextNodeDumper.cpp
+++ clang/lib/AST/TextNodeDumper.cpp
@@ -283,6 +283,8 @@
   OS << " constexpr";
 if (FD->isConsteval())
   OS << " consteval";
+if (FD->isMultiVersion())
+  OS << " multiversion";
   }
 
   if (!isa(*D)) {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121961: [clang] Produce a "multiversion" annotation in textual AST output.

2022-03-18 Thread Tom Honermann via Phabricator via cfe-commits
tahonermann added a comment.

> Is there a need for this functionality?

Not a strong need, but I found it helpful in two scenarios:

1. A forward declaration of a multiversion function is not required to include 
a multiversion function attribute; later declarations might trigger 
multiversioning.
2. The `target` attribute does not necessarily declare a multiversion function.

Some examples:

  void f();
  __attribute__((target("default"))) void f(); // Causes multiversioning for 
the prior declaration.
  
  __attribute__((target("mmx"))) void g(); // Not a multiversion function 
declaration.
  
  __attribute__((target("mmx"))) void h();
  __attribute__((target("sse"))) void h(); // Causes multiversioning for the 
prior declaration.

I'll add a test; thank you for the hint for where to add it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121961

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121961: [clang] Produce a "multiversion" annotation in textual AST output.

2022-03-18 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment.

In D121961#3391988 , @aaron.ballman 
wrote:

> Is there a need for this functionality? The text node dumper already dumps 
> attributes associated with the function: https://godbolt.org/z/EbW8E74TT
>
> If the change is necessary, it needs some test coverage (I'd recommend adding 
> the test to the `clang/test/AST` directory).

I would have found this helpful while working with MV functions in the past, 
particularly 'target' ones.  So there is perhaps some value and minimal harm to 
this.  That said, we definitely need a test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121961

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121961: [clang] Produce a "multiversion" annotation in textual AST output.

2022-03-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment.

Is there a need for this functionality? The text node dumper already dumps 
attributes associated with the function: https://godbolt.org/z/EbW8E74TT

If the change is necessary, it needs some test coverage (I'd recommend adding 
the test to the `clang/test/AST` directory).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121961

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121961: [clang] Produce a "multiversion" annotation in textual AST output.

2022-03-17 Thread Tom Honermann via Phabricator via cfe-commits
tahonermann created this revision.
tahonermann added reviewers: erichkeane, aaron.ballman.
Herald added a project: All.
tahonermann published this revision for review.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This change adds a "multiversion" annotation to textual AST output.
For example:

  FunctionDecl 0xb6628b0  col:5 multiversion foo 'int (void)'


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121961

Files:
  clang/lib/AST/TextNodeDumper.cpp


Index: clang/lib/AST/TextNodeDumper.cpp
===
--- clang/lib/AST/TextNodeDumper.cpp
+++ clang/lib/AST/TextNodeDumper.cpp
@@ -283,6 +283,8 @@
   OS << " constexpr";
 if (FD->isConsteval())
   OS << " consteval";
+if (FD->isMultiVersion())
+  OS << " multiversion";
   }
 
   if (!isa(*D)) {


Index: clang/lib/AST/TextNodeDumper.cpp
===
--- clang/lib/AST/TextNodeDumper.cpp
+++ clang/lib/AST/TextNodeDumper.cpp
@@ -283,6 +283,8 @@
   OS << " constexpr";
 if (FD->isConsteval())
   OS << " consteval";
+if (FD->isMultiVersion())
+  OS << " multiversion";
   }
 
   if (!isa(*D)) {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits