Skip to content

Commit 896ed66

Browse files
committed
AST: Suppress unused function and -Wreturn-type-c-linkage warnings.
1 parent 2ec8efe commit 896ed66

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/AST/InlinableText.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@ struct ExtractInactiveRanges : public ASTWalker {
192192
};
193193
} // end anonymous namespace
194194

195+
#if SWIFT_BUILD_SWIFT_SYNTAX
196+
#pragma clang diagnostic push
197+
#pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
198+
extern "C" BridgedStringRef
199+
swift_ASTGen_extractInlinableText(BridgedASTContext ctx,
200+
BridgedStringRef sourceText);
201+
#pragma clang diagnostic pop
202+
#else
195203
/// Appends the textual contents of the provided source range, stripping
196204
/// the contents of comments that appear in the source.
197205
///
@@ -292,10 +300,7 @@ static void appendRange(
292300
scratch.append(text.begin(), text.end());
293301
}
294302
}
295-
296-
extern "C"
297-
BridgedStringRef swift_ASTGen_extractInlinableText(
298-
BridgedASTContext ctx, BridgedStringRef sourceText);
303+
#endif // SWIFT_BUILD_SWIFT_SYNTAX
299304

300305
StringRef swift::extractInlinableText(ASTContext &ctx, ASTNode node,
301306
SmallVectorImpl<char> &scratch) {

0 commit comments

Comments
 (0)