r374573 - [clang][IFS] Fixing assert in clang interface stubs for enums, records, typedefs
Puyan Lotfi via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 11 10:24:11 PDT 2019
Author: zer0
Date: Fri Oct 11 10:24:11 2019
New Revision: 374573
URL: http://llvm.org/viewvc/llvm-project?rev=374573&view=rev
Log:
[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
Added:
cfe/trunk/test/InterfaceStubs/noninstancetypes.c
Modified:
cfe/trunk/lib/Frontend/InterfaceStubFunctionsConsumer.cpp
Modified: cfe/trunk/lib/Frontend/InterfaceStubFunctionsConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InterfaceStubFunctionsConsumer.cpp?rev=374573&r1=374572&r2=374573&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InterfaceStubFunctionsConsumer.cpp (original)
+++ cfe/trunk/lib/Frontend/InterfaceStubFunctionsConsumer.cpp Fri Oct 11 10:24:11 2019
@@ -177,6 +177,10 @@ class InterfaceStubFunctionsConsumer : p
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:
Added: cfe/trunk/test/InterfaceStubs/noninstancetypes.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/InterfaceStubs/noninstancetypes.c?rev=374573&view=auto
==============================================================================
--- cfe/trunk/test/InterfaceStubs/noninstancetypes.c (added)
+++ cfe/trunk/test/InterfaceStubs/noninstancetypes.c Fri Oct 11 10:24:11 2019
@@ -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;
+
More information about the cfe-commits
mailing list