Skip to content

Commit 8075b09

Browse files
committed
ClangImporter: Set the 'throws' bit on a few CallExprs
This allows Sema to skip checking external definitions altogether.
1 parent 57254cb commit 8075b09

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,7 @@ makeUnionFieldAccessors(ClangImporter::Implementation &Impl,
10011001
{ inoutSelf },
10021002
{ Identifier() });
10031003
selfPointer->setType(C.TheRawPointerType);
1004+
selfPointer->setThrows(false);
10041005

10051006
auto initializeFn = cast<FuncDecl>(getBuiltinValueDecl(
10061007
C, C.getIdentifier("initialize")));
@@ -1018,6 +1019,7 @@ makeUnionFieldAccessors(ClangImporter::Implementation &Impl,
10181019
{ newValueRef, selfPointer },
10191020
{ Identifier(), Identifier() });
10201021
initialize->setType(TupleType::getEmpty(C));
1022+
initialize->setThrows(false);
10211023

10221024
auto body = BraceStmt::create(C, SourceLoc(), { initialize }, SourceLoc(),
10231025
/*implicit*/ true);
@@ -5562,6 +5564,7 @@ Decl *SwiftDeclConverter::importEnumCaseAlias(
55625564
auto instantiate = new (Impl.SwiftContext)
55635565
DotSyntaxCallExpr(constantRef, SourceLoc(), typeRef);
55645566
instantiate->setType(importedEnumTy);
5567+
instantiate->setThrows(false);
55655568

55665569
Decl *CD = Impl.createConstant(name, importIntoDC, importedEnumTy,
55675570
instantiate, ConstantConvertKind::None,

0 commit comments

Comments
 (0)