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/ <undeserialized declarations>//" -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<FunctionDecl>(*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/ <undeserialized declarations>//" -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<FunctionDecl>(*D)) {
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to