Skip to content

Commit 2f61489

Browse files
committed
Don't try to bridge diagnostics from C++ to Swift
We'll be going the other way, with diagnostics existentials.
1 parent 7483373 commit 2f61489

File tree

2 files changed

+1
-31
lines changed

2 files changed

+1
-31
lines changed

include/swift/AST/CASTBridging.h

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,6 @@
3131
#define _Nullable
3232
#endif
3333

34-
//===----------------------------------------------------------------------===//
35-
// Diagnostic Engine
36-
//===----------------------------------------------------------------------===//
37-
38-
#ifndef __has_attribute // Optional of course.
39-
#define __has_attribute(x) 0 // Compatibility with non-clang compilers.
40-
#endif
41-
42-
// TODO: Move this to somewhere common header.
43-
#if __has_attribute(enum_extensibility)
44-
#define ENUM_EXTENSIBILITY_ATTR(arg) __attribute__((enum_extensibility(arg)))
45-
#else
46-
#define ENUM_EXTENSIBILITY_ATTR(arg)
47-
#endif
48-
49-
// NOTE: This must be the same underlying value as C++ 'swift::DiagID' defined
50-
// in 'DiagnosticList.cpp'.
51-
typedef enum ENUM_EXTENSIBILITY_ATTR(open) BridgedDiagID : unsigned {
52-
#define DIAG(KIND, ID, Options, Text, Signature) BridgedDiagID_##ID,
53-
#include "swift/AST/DiagnosticsAll.def"
54-
} BridgedDiagID;
55-
5634
SWIFT_BEGIN_NULLABILITY_ANNOTATIONS
5735

5836
typedef long SwiftInt;
@@ -68,14 +46,6 @@ typedef struct {
6846
SwiftInt byteLength;
6947
} BridgedCharSourceRange;
7048

71-
// FIXME: Can we bridge InFlightDiagnostic?
72-
void DiagnosticEngine_diagnose(void *, void *loc, BridgedDiagID diagID,
73-
BridgedArrayRef arguments,
74-
BridgedCharSourceRange highlight,
75-
BridgedArrayRef fixIts);
76-
77-
int DiagnosticEngine_hadAnyError(void *);
78-
7949
typedef void *BridgedIdentifier;
8050

8151
#ifdef __cplusplus

lib/ASTGen/Sources/ASTGen/Decls.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extension ASTGenVisitor {
5151
let isLet = node.letOrVarKeyword.tokenKind == .letKeyword
5252

5353
// TODO: don't drop "initializer" on the floor.
54-
return SwiftVarDecl_create(ctx, pattern, loc, isStateic, isLet, declContext)
54+
return SwiftVarDecl_create(ctx, nil, loc, isStateic, isLet, declContext)
5555
}
5656

5757
public func visit(_ node: CodeBlockSyntax) -> UnsafeMutableRawPointer {

0 commit comments

Comments
 (0)