Author: Puyan Lotfi Date: 2019-12-04T19:10:47-05:00 New Revision: 07e445103e363c85ce7313c542dee20b2294fe72
URL: https://github.com/llvm/llvm-project/commit/07e445103e363c85ce7313c542dee20b2294fe72 DIFF: https://github.com/llvm/llvm-project/commit/07e445103e363c85ce7313c542dee20b2294fe72.diff LOG: [clang][IFS] Adding support for new clang interface stubs decl types. NamespaceAliasDecl UnresolvedUsingTypenameDecl CXXDeductionGuideDecl ConstructorUsingShadowDecl Differential Revision: https://reviews.llvm.org/D70728 Added: clang/test/InterfaceStubs/constructor-using-shadow.cpp clang/test/InterfaceStubs/cxxdeduction-guide.cpp clang/test/InterfaceStubs/namespace-alias.cpp clang/test/InterfaceStubs/unresolved-using-typename.cpp Modified: clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp Removed: ################################################################################ diff --git a/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp b/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp index 025e6eb1508f..3b0a5668af94 100644 --- a/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp +++ b/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp @@ -195,6 +195,10 @@ class InterfaceStubFunctionsConsumer : public ASTConsumer { case Decl::Kind::TemplateTemplateParm: case Decl::Kind::ClassTemplatePartialSpecialization: case Decl::Kind::IndirectField: + case Decl::Kind::ConstructorUsingShadow: + case Decl::Kind::CXXDeductionGuide: + case Decl::Kind::NamespaceAlias: + case Decl::Kind::UnresolvedUsingTypename: return true; case Decl::Kind::Var: { // Bail on any VarDecl that either has no named symbol. diff --git a/clang/test/InterfaceStubs/constructor-using-shadow.cpp b/clang/test/InterfaceStubs/constructor-using-shadow.cpp new file mode 100644 index 000000000000..d4b85ac73e56 --- /dev/null +++ b/clang/test/InterfaceStubs/constructor-using-shadow.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -o - -emit-interface-stubs %s | FileCheck %s + +// CHECK: --- !experimental-ifs-v1 +// CHECK-NEXT: IfsVersion: 1.0 +// CHECK-NEXT: Triple: +// CHECK-NEXT: ObjectFileFormat: ELF +// CHECK-NEXT: Symbols: +// CHECK-NEXT: ... + + // ConstructorUsingShadowDecl +struct Base { Base(int); }; +struct Derived : public Base { using Base::Base; }; diff --git a/clang/test/InterfaceStubs/cxxdeduction-guide.cpp b/clang/test/InterfaceStubs/cxxdeduction-guide.cpp new file mode 100644 index 000000000000..f09b9d929ca3 --- /dev/null +++ b/clang/test/InterfaceStubs/cxxdeduction-guide.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -o - -emit-interface-stubs -std=c++17 %s | FileCheck %s + +// CHECK: --- !experimental-ifs-v1 +// CHECK-NEXT: IfsVersion: 1.0 +// CHECK-NEXT: Triple: +// CHECK-NEXT: ObjectFileFormat: ELF +// CHECK-NEXT: Symbols: +// CHECK-NEXT: ... + +// CXXDeductionGuideDecl +template<typename T> struct A { A(); A(T); }; +A() -> A<int>; diff --git a/clang/test/InterfaceStubs/namespace-alias.cpp b/clang/test/InterfaceStubs/namespace-alias.cpp new file mode 100644 index 000000000000..6a7f27c9b7b0 --- /dev/null +++ b/clang/test/InterfaceStubs/namespace-alias.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -o - -emit-interface-stubs %s | FileCheck %s + +// CHECK: --- !experimental-ifs-v1 +// CHECK-NEXT: IfsVersion: 1.0 +// CHECK-NEXT: Triple: +// CHECK-NEXT: ObjectFileFormat: ELF +// CHECK-NEXT: Symbols: +// CHECK-NEXT: ... + +// NamespaceAliasDecl +namespace NS { } +namespace B = NS; diff --git a/clang/test/InterfaceStubs/unresolved-using-typename.cpp b/clang/test/InterfaceStubs/unresolved-using-typename.cpp new file mode 100644 index 000000000000..e6afc781412a --- /dev/null +++ b/clang/test/InterfaceStubs/unresolved-using-typename.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -o - -emit-interface-stubs %s | FileCheck %s + +// CHECK: --- !experimental-ifs-v1 +// CHECK-NEXT: IfsVersion: 1.0 +// CHECK-NEXT: Triple: +// CHECK-NEXT: ObjectFileFormat: ELF +// CHECK-NEXT: Symbols: +// CHECK-NEXT: ... + +// UnresolvedUsingTypenameDecl +template<typename T> class C1 { using ReprType = unsigned; }; +template<typename T> class C2 : public C1<T> { using typename C1<T>::Repr; }; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits