Skip to content

Commit 26c7310

Browse files
committed
Swift AST: Fix debug description of Type
Don't get the swift source version string, but the debug dump string
1 parent 4603530 commit 26c7310

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

include/swift/AST/ASTBridging.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -3002,7 +3002,7 @@ struct BridgedASTType {
30023002
swift::TypeBase * _Nullable type;
30033003

30043004
BRIDGED_INLINE swift::Type unbridged() const;
3005-
BRIDGED_INLINE BridgedOwnedString getDebugDescription() const;
3005+
BridgedOwnedString getDebugDescription() const;
30063006
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedCanType getCanonicalType() const;
30073007
BRIDGED_INLINE bool isLegalFormalType() const;
30083008
BRIDGED_INLINE bool hasTypeParameter() const;

include/swift/AST/ASTBridgingImpl.h

-4
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,6 @@ swift::Type BridgedASTType::unbridged() const {
390390
return type;
391391
}
392392

393-
BridgedOwnedString BridgedASTType::getDebugDescription() const {
394-
return BridgedOwnedString(unbridged().getString());
395-
}
396-
397393
BridgedCanType BridgedASTType::getCanonicalType() const {
398394
return unbridged()->getCanonicalType();
399395
}

lib/AST/Bridging/MiscBridging.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,17 @@ BridgedOwnedString BridgedDeclObj::getDebugDescription() const {
9797
return BridgedOwnedString(str);
9898
}
9999

100+
//===----------------------------------------------------------------------===//
101+
// MARK: BridgedASTType
102+
//===----------------------------------------------------------------------===//
103+
104+
BridgedOwnedString BridgedASTType::getDebugDescription() const {
105+
std::string str;
106+
llvm::raw_string_ostream os(str);
107+
unbridged().dump(os);
108+
return BridgedOwnedString(str);
109+
}
110+
100111
//===----------------------------------------------------------------------===//
101112
// MARK: Conformance
102113
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)