Skip to content

Commit 95904eb

Browse files
committed
Handle bounds annotated types as sugar types
1 parent 866a834 commit 95904eb

File tree

1 file changed

+6
-27
lines changed

1 file changed

+6
-27
lines changed

lib/ClangImporter/ImportType.cpp

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -410,33 +410,6 @@ namespace {
410410
return Type();
411411
}
412412

413-
ImportResult VisitCountAttributedType(
414-
const clang::CountAttributedType *type) {
415-
// CountAttributedType is a clang type representing a pointer with
416-
// a "counted_by" type attribute. For now, we don't import these
417-
// into Swift.
418-
// In the future we could do something more clever (such as trying to
419-
// import as an Array where possible) or less clever (such as importing
420-
// as the desugared, underlying pointer type).
421-
return Type();
422-
}
423-
424-
ImportResult VisitDynamicRangePointerType(
425-
const clang::DynamicRangePointerType *type) {
426-
// DynamicRangePointerType is a clang type representing a pointer with
427-
// an "ended_by" type attribute for -fbounds-safety. For now, we don't
428-
// import these into Swift.
429-
return Type();
430-
}
431-
432-
ImportResult VisitValueTerminatedType(
433-
const clang::ValueTerminatedType *type) {
434-
// ValueTerminatedType is a clang type representing a pointer with
435-
// a "terminated_by" type attribute for -fbounds-safety. For now, we don't
436-
// import these into Swift.
437-
return Type();
438-
}
439-
440413
ImportResult VisitMemberPointerType(const clang::MemberPointerType *type) {
441414
return Type();
442415
}
@@ -957,6 +930,12 @@ namespace {
957930
SUGAR_TYPE(Using)
958931
SUGAR_TYPE(BTFTagAttributed)
959932

933+
// Clang types representing a pointer with a bounds annotation such as
934+
// "counted_by", "ended_by" and "terminated_by". For now, we ignore them.
935+
SUGAR_TYPE(CountAttributed)
936+
SUGAR_TYPE(DynamicRangePointer)
937+
SUGAR_TYPE(ValueTerminated)
938+
960939
ImportResult VisitDecayedType(const clang::DecayedType *type) {
961940
clang::ASTContext &clangCtx = Impl.getClangASTContext();
962941
if (clangCtx.hasSameType(type->getOriginalType(),

0 commit comments

Comments
 (0)