Skip to content

Commit ad8b5a5

Browse files
committed
Revert "[cxx-interop] Use clang::CanQualType in ClangTypeExplicitSafetyDescriptor"
This reverts commit 5328572.
1 parent 6607ae9 commit ad8b5a5

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

include/swift/ClangImporter/ClangImporterRequests.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -625,11 +625,9 @@ void simple_display(llvm::raw_ostream &out, CxxValueSemanticsDescriptor desc);
625625
SourceLoc extractNearestSourceLoc(CxxValueSemanticsDescriptor desc);
626626

627627
struct ClangTypeExplicitSafetyDescriptor final {
628-
clang::CanQualType type;
628+
clang::QualType type;
629629

630-
ClangTypeExplicitSafetyDescriptor(clang::CanQualType type) : type(type) {}
631-
ClangTypeExplicitSafetyDescriptor(clang::QualType type)
632-
: type(type->getCanonicalTypeUnqualified()) {}
630+
ClangTypeExplicitSafetyDescriptor(clang::QualType type) : type(type) {}
633631

634632
friend llvm::hash_code
635633
hash_value(const ClangTypeExplicitSafetyDescriptor &desc) {

lib/ClangImporter/ClangImporter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8725,8 +8725,8 @@ SourceLoc swift::extractNearestSourceLoc(SafeUseOfCxxDeclDescriptor desc) {
87258725

87268726
void swift::simple_display(llvm::raw_ostream &out,
87278727
ClangTypeExplicitSafetyDescriptor desc) {
8728-
auto qt = static_cast<clang::QualType>(desc.type);
8729-
out << "Checking if type '" << qt.getAsString() << "' is explicitly safe.\n";
8728+
out << "Checking if type '" << desc.type.getAsString()
8729+
<< "' is explicitly safe.\n";
87308730
}
87318731

87328732
SourceLoc swift::extractNearestSourceLoc(ClangTypeExplicitSafetyDescriptor desc) {
@@ -8735,7 +8735,7 @@ SourceLoc swift::extractNearestSourceLoc(ClangTypeExplicitSafetyDescriptor desc)
87358735

87368736
ExplicitSafety ClangTypeExplicitSafety::evaluate(
87378737
Evaluator &evaluator, ClangTypeExplicitSafetyDescriptor desc) const {
8738-
auto clangType = static_cast<clang::QualType>(desc.type);
8738+
auto clangType = desc.type;
87398739

87408740
// Handle pointers.
87418741
auto pointeeType = clangType->getPointeeType();

0 commit comments

Comments
 (0)