Skip to content

Commit 391d76b

Browse files
authored
Merge pull request #69137 from eeckstein/fix-ast-bridging
Rename BridgedDiagnosticEngine -> BridgedDiagEngine
2 parents e298fb5 + 04b1ab6 commit 391d76b

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

SwiftCompilerSources/Sources/AST/DiagnosticEngine.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ public struct DiagnosticFixIt {
5252
}
5353

5454
public struct DiagnosticEngine {
55-
private let bridged: BridgedDiagnosticEngine
55+
private let bridged: BridgedDiagEngine
5656

57-
public init(bridged: BridgedDiagnosticEngine) {
57+
public init(bridged: BridgedDiagEngine) {
5858
self.bridged = bridged
5959
}
6060
public init?(bridged: BridgedOptionalDiagnosticEngine) {
6161
guard let object = bridged.object else {
6262
return nil
6363
}
64-
self.bridged = BridgedDiagnosticEngine(object: object)
64+
self.bridged = BridgedDiagEngine(object: object)
6565
}
6666

6767
public func diagnose(_ position: SourceLoc?,

SwiftCompilerSources/Sources/Parse/Regex.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public func _RegexLiteralParsingFn(
9393
_ captureStructureOut: UnsafeMutableRawPointer,
9494
_ captureStructureSize: CUnsignedInt,
9595
_ bridgedDiagnosticBaseLoc: BridgedSourceLoc,
96-
_ bridgedDiagnosticEngine: BridgedDiagnosticEngine
96+
_ bridgedDiagnosticEngine: BridgedDiagEngine
9797
) -> Bool {
9898
let str = String(cString: inputPtr)
9999
let captureBuffer = UnsafeMutableRawBufferPointer(

include/swift/AST/ASTBridging.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ typedef enum ENUM_EXTENSIBILITY_ATTR(open) BridgedDiagID : uint32_t {
4040
#include "swift/AST/DiagnosticsAll.def"
4141
} BridgedDiagID;
4242

43-
// Must match the definition of BridgedDiagnosticEngine in CASTBridging.h.
44-
typedef struct {
43+
// The name must not collide with BridgedDiagnosticEngine in CASTBridging.h.
44+
struct BridgedDiagEngine {
4545
void * _Nonnull object;
46-
} BridgedDiagnosticEngine;
46+
};
4747

4848
struct BridgedOptionalDiagnosticEngine {
4949
void *_Nullable object;
@@ -83,12 +83,12 @@ class BridgedDiagnosticFixIt {
8383
};
8484

8585
// FIXME: Can we bridge InFlightDiagnostic?
86-
void DiagnosticEngine_diagnose(BridgedDiagnosticEngine, BridgedSourceLoc loc,
86+
void DiagnosticEngine_diagnose(BridgedDiagEngine, BridgedSourceLoc loc,
8787
BridgedDiagID diagID, BridgedArrayRef arguments,
8888
BridgedSourceLoc highlightStart, uint32_t hightlightLength,
8989
BridgedArrayRef fixIts);
9090

91-
bool DiagnosticEngine_hadAnyError(BridgedDiagnosticEngine);
91+
bool DiagnosticEngine_hadAnyError(BridgedDiagEngine);
9292

9393
SWIFT_END_NULLABILITY_ANNOTATIONS
9494

include/swift/AST/BridgingUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
namespace swift {
2020

21-
inline BridgedDiagnosticEngine getBridgedDiagnosticEngine(DiagnosticEngine *D) {
21+
inline BridgedDiagEngine getBridgedDiagnosticEngine(DiagnosticEngine *D) {
2222
return {(void *)D};
2323
}
2424
inline BridgedOptionalDiagnosticEngine

include/swift/Parse/RegexParserBridging.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ typedef bool (*RegexLiteralParsingFn)(/*InputPtr*/ const char *_Nonnull,
5858
/*CaptureStructureOut*/ void *_Nonnull,
5959
/*CaptureStructureSize*/ unsigned,
6060
/*DiagnosticBaseLoc*/ BridgedSourceLoc,
61-
BridgedDiagnosticEngine);
61+
BridgedDiagEngine);
6262
void Parser_registerRegexLiteralParsingFn(RegexLiteralParsingFn _Nullable fn);
6363

6464
#endif // REGEX_PARSER_BRIDGING

lib/AST/ASTBridging.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
using namespace swift;
1919

2020
namespace {
21-
/// BridgedDiagnosticEngine -> DiagnosticEngine *.
22-
DiagnosticEngine *getDiagnosticEngine(const BridgedDiagnosticEngine &bridged) {
21+
/// BridgedDiagEngine -> DiagnosticEngine *.
22+
DiagnosticEngine *getDiagnosticEngine(const BridgedDiagEngine &bridged) {
2323
return static_cast<DiagnosticEngine *>(bridged.object);
2424
}
2525

@@ -48,7 +48,7 @@ BridgedDiagnosticFixIt::BridgedDiagnosticFixIt(BridgedSourceLoc start, uint32_t
4848
llvm::ArrayRef<DiagnosticArgument>())) {}
4949

5050
void DiagnosticEngine_diagnose(
51-
BridgedDiagnosticEngine bridgedEngine, BridgedSourceLoc loc,
51+
BridgedDiagEngine bridgedEngine, BridgedSourceLoc loc,
5252
BridgedDiagID bridgedDiagID,
5353
BridgedArrayRef /*BridgedDiagnosticArgument*/ bridgedArguments,
5454
BridgedSourceLoc highlightStart, uint32_t hightlightLength,
@@ -76,7 +76,7 @@ void DiagnosticEngine_diagnose(
7676
}
7777
}
7878

79-
bool DiagnosticEngine_hadAnyError(BridgedDiagnosticEngine bridgedEngine) {
79+
bool DiagnosticEngine_hadAnyError(BridgedDiagEngine bridgedEngine) {
8080
auto *D = getDiagnosticEngine(bridgedEngine);
8181
return D->hadAnyError();
8282
}

0 commit comments

Comments
 (0)