Skip to content

Commit c6e6f75

Browse files
[Interop][SwiftToCxx] Deleting unnecessary NaiveException
1 parent 4b35f98 commit c6e6f75

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

lib/PrintAsClang/PrintSwiftToClangCoreScaffold.cpp

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -156,26 +156,6 @@ static void printTypeMetadataResponseType(SwiftToClangInteropContext &ctx,
156156
funcSig.parameterTypes[0]);
157157
}
158158

159-
void printCxxNaiveException(raw_ostream &os) {
160-
os << "/// Naive exception class that should be thrown\n";
161-
os << "class NaiveException : public swift::Error {\n";
162-
os << "public:\n";
163-
os << " inline NaiveException(const char * _Nonnull msg) noexcept : "
164-
<< "msg_(msg) { }\n";
165-
os << " inline NaiveException(NaiveException&& other) noexcept : "
166-
"msg_(other.msg_) { other.msg_ = nullptr; }\n";
167-
os << " inline ~NaiveException() noexcept { }\n";
168-
os << " void operator =(NaiveException&& other) noexcept { auto temp = msg_;"
169-
<< " msg_ = other.msg_; other.msg_ = temp; }\n";
170-
os << " void operator =(const NaiveException&) noexcept = delete;";
171-
os << "\n";
172-
os << " inline const char * _Nonnull getMessage() const noexcept { "
173-
<< "return(msg_); }\n";
174-
os << "private:\n";
175-
os << " const char * _Nonnull msg_;\n";
176-
os << "};\n";
177-
}
178-
179159
void printPrimitiveGenericTypeTraits(raw_ostream &os, ASTContext &astContext,
180160
PrimitiveTypeMapping &typeMapping,
181161
bool isCForwardDefinition) {
@@ -239,7 +219,7 @@ void swift::printSwiftToClangCoreScaffold(SwiftToClangInteropContext &ctx,
239219
/*isCForwardDefinition=*/true);
240220
});
241221
os << "\n";
242-
printCxxNaiveException(os);
222+
//printCxxNaiveException(os);
243223
});
244224
os << "\n";
245225
// C++ only supports inline variables from C++17.

0 commit comments

Comments
 (0)