Skip to content

Commit 66321f7

Browse files
authored
[ClangImporter] Do not import DynamicRangePointerType and ValueTerminatedType (#77910)
DynamicRangePointerType and ValueTerminatedType are new Clang types for -fbounds-safety, annotated with the 'ended_by' and the 'terminated_by' attributes. This adds visitors for these types in ClangImporter so Swift still builds with Clang that has these new types.
1 parent 4bab2a8 commit 66321f7

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

lib/ClangImporter/ImportType.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@
5555
using namespace swift;
5656
using namespace importer;
5757

58+
// XXX: This is to resolve the build dependency with Clang. Remove it once these
59+
// types actually land in Clang.
60+
namespace clang {
61+
class DynamicRangePointerType;
62+
class ValueTerminatedType;
63+
}
64+
5865
/// Given that a type is the result of a special typedef import, was
5966
/// it originally a CF pointer?
6067
static bool isImportedCFPointer(clang::QualType clangType, Type type) {
@@ -421,6 +428,22 @@ namespace {
421428
return Type();
422429
}
423430

431+
ImportResult VisitDynamicRangePointerType(
432+
const clang::DynamicRangePointerType *type) {
433+
// DynamicRangePointerType is a clang type representing a pointer with
434+
// an "ended_by" type attribute for -fbounds-safety. For now, we don't
435+
// import these into Swift.
436+
return Type();
437+
}
438+
439+
ImportResult VisitValueTerminatedType(
440+
const clang::ValueTerminatedType *type) {
441+
// ValueTerminatedType is a clang type representing a pointer with
442+
// a "terminated_by" type attribute for -fbounds-safety. For now, we don't
443+
// import these into Swift.
444+
return Type();
445+
}
446+
424447
ImportResult VisitMemberPointerType(const clang::MemberPointerType *type) {
425448
return Type();
426449
}

0 commit comments

Comments
 (0)