diff options
author | Puyan Lotfi <puyan@puyan.org> | 2019-10-11 17:24:11 +0000 |
---|---|---|
committer | Puyan Lotfi <puyan@puyan.org> | 2019-10-11 17:24:11 +0000 |
commit | e3388c42f39b6715e9aa1c7594fb0dcf9429e111 (patch) | |
tree | eb174380bf1b5b7cc0054b371edb7184a924f80e | |
parent | 81018c85b9c8275cc3bd0b60aa7a3ef4b601fa16 (diff) | |
download | bcm5719-llvm-e3388c42f39b6715e9aa1c7594fb0dcf9429e111.tar.gz bcm5719-llvm-e3388c42f39b6715e9aa1c7594fb0dcf9429e111.zip |
[clang][IFS] Fixing assert in clang interface stubs for enums, records, typedefs
The clang IFS ASTConsumer was asserting on enums, records (struct definitions in
C), and typedefs. All it needs to do is skip them because the stub just needs to
expose global object instances and functions.
Differential Revision: https://reviews.llvm.org/D68859
llvm-svn: 374573
-rw-r--r-- | clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp | 4 | ||||
-rw-r--r-- | clang/test/InterfaceStubs/noninstancetypes.c | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp b/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp index 73584eb98df..5e6cc65e021 100644 --- a/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp +++ b/clang/lib/Frontend/InterfaceStubFunctionsConsumer.cpp @@ -177,6 +177,10 @@ class InterfaceStubFunctionsConsumer : public ASTConsumer { HandleTemplateSpecializations(*cast<FunctionTemplateDecl>(ND), Symbols, RDO); return true; + case Decl::Kind::Record: + case Decl::Kind::Typedef: + case Decl::Kind::Enum: + case Decl::Kind::EnumConstant: case Decl::Kind::TemplateTypeParm: return true; case Decl::Kind::Var: diff --git a/clang/test/InterfaceStubs/noninstancetypes.c b/clang/test/InterfaceStubs/noninstancetypes.c new file mode 100644 index 00000000000..ad80aa62484 --- /dev/null +++ b/clang/test/InterfaceStubs/noninstancetypes.c @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -o - -emit-interface-stubs %s | FileCheck %s +// TODO: Change clang_cc1 to clang when llvm-ifs can accept empty symbol lists. + +// CHECK: Symbols: +// CHECK-NEXT: ... + +struct a; +enum { b }; +typedef int c; + |