Skip to content

Commit 11b6d26

Browse files
committed
---
yaml --- r: 319351 b: refs/heads/master-rebranch c: 22a8a8f h: refs/heads/master i: 319349: 06dd8e6 319347: 0fe8a02 319343: 803b96d
1 parent bd56a26 commit 11b6d26

File tree

9 files changed

+22
-14
lines changed

9 files changed

+22
-14
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1457,4 +1457,4 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-02-a: ddd2b2976aa9bfde5f20fe37f6bd2
14571457
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-03-a: 171cc166f2abeb5ca2a4003700a8a78a108bd300
14581458
refs/heads/benlangmuir-patch-1: baaebaf39d52f3bf36710d4fe40cf212e996b212
14591459
refs/heads/i-do-redeclare: 8c4e6d5de5c1e3f0a2cedccf319df713ea22c48e
1460-
refs/heads/master-rebranch: ec8b8275b729a15cf403ee6d193256718f53471d
1460+
refs/heads/master-rebranch: 22a8a8f4068c8219c753df54bf56710dfed5a3f1

branches/master-rebranch/include/swift/AST/DiagnosticsModuleDiffer.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ ERROR(conformance_removed,none,"%0 has removed %select{conformance to|inherited
6868

6969
ERROR(conformance_added,none,"%0 has added inherited protocol %1", (StringRef, StringRef))
7070

71+
ERROR(existing_conformance_added,none,"%0 has added a conformance to an existing protocol %1", (StringRef, StringRef))
72+
7173
ERROR(default_associated_type_removed,none,"%0 has removed default type %1", (StringRef, StringRef))
7274

7375
ERROR(protocol_req_added,none,"%0 has been added as a protocol requirement", (StringRef))

branches/master-rebranch/test/api-digester/Outputs/Cake-abi.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ cake1: Func ObjCProtocol.addOptional() is now an optional requirement
7373
cake1: Func ObjCProtocol.removeOptional() is no longer an optional requirement
7474
cake1: Protocol P3 has removed inherited protocol P2
7575
cake1: Struct fixedLayoutStruct has removed conformance to P1
76+
cake2: Class C7 has added a conformance to an existing protocol P1
77+
cake2: Class SuperClassChange has added a conformance to an existing protocol P1
7678
cake2: Protocol P3 has added inherited protocol P4
79+
cake2: Struct fixedLayoutStruct has added a conformance to an existing protocol P2
7780

7881
/* Protocol Requirement Change */
7982
cake1: Accessor HasMutatingMethodClone.bar.Get() now requires new witness table entry

branches/master-rebranch/tools/swift-api-digester/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ add_swift_host_tool(swift-api-digester
22
swift-api-digester.cpp
33
ModuleAnalyzerNodes.cpp
44
ModuleDiagsConsumer.cpp
5-
SWIFT_COMPONENT tools
65
SWIFT_COMPONENT toolchain-tools
76
)
87
target_link_libraries(swift-api-digester

branches/master-rebranch/tools/swift-api-digester/ModuleAnalyzerNodes.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -845,10 +845,7 @@ static bool isSDKNodeEqual(SDKContext &Ctx, const SDKNode &L, const SDKNode &R)
845845
}
846846

847847
bool SDKContext::isEqual(const SDKNode &Left, const SDKNode &Right) {
848-
if (!EqualCache[&Left].count(&Right)) {
849-
EqualCache[&Left][&Right] = isSDKNodeEqual(*this, Left, Right);
850-
}
851-
return EqualCache[&Left][&Right];
848+
return isSDKNodeEqual(*this, Left, Right);
852849
}
853850

854851
AccessLevel SDKContext::getAccessLevel(const ValueDecl *VD) const {

branches/master-rebranch/tools/swift-api-digester/ModuleAnalyzerNodes.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,6 @@ class SDKContext {
160160

161161
CheckerOptions Opts;
162162
std::vector<BreakingAttributeInfo> BreakingAttrs;
163-
/// This is to cache the equal comparison results between nodes.
164-
llvm::DenseMap<const SDKNode*, llvm::DenseMap<const SDKNode*, bool>> EqualCache;
165163

166164
public:
167165
SDKContext(CheckerOptions Options);

branches/master-rebranch/tools/swift-api-digester/ModuleDiagsConsumer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ static StringRef getCategoryName(uint32_t ID) {
6363
case LocalDiagID::conformance_added:
6464
case LocalDiagID::conformance_removed:
6565
case LocalDiagID::optional_req_changed:
66+
case LocalDiagID::existing_conformance_added:
6667
return "/* Protocol Conformance Change */";
6768
case LocalDiagID::default_associated_type_removed:
6869
case LocalDiagID::protocol_req_added:

branches/master-rebranch/tools/swift-api-digester/swift-api-digester.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,8 @@ class PrunePass : public MatchedNodeListener, public SDKTreeDiffPass {
951951
SDKContext &Ctx;
952952
UpdatedNodesMap &UpdateMap;
953953
llvm::StringSet<> ProtocolReqWhitelist;
954+
SDKNodeRoot *LeftRoot;
955+
SDKNodeRoot *RightRoot;
954956

955957
static void printSpaces(llvm::raw_ostream &OS, SDKNode *N) {
956958
assert(N);
@@ -1028,6 +1030,12 @@ class PrunePass : public MatchedNodeListener, public SDKTreeDiffPass {
10281030
auto *TD = Conf->getNominalTypeDecl();
10291031
if (TD->isProtocol()) {
10301032
TD->emitDiag(diag::conformance_added, Conf->getName());
1033+
} else {
1034+
// Adding conformance to an existing type can be ABI breaking.
1035+
if (Ctx.checkingABI() &&
1036+
!LeftRoot->getDescendantsByUsr(Conf->getUsr()).empty()) {
1037+
TD->emitDiag(diag::existing_conformance_added, Conf->getName());
1038+
}
10311039
}
10321040
}
10331041

@@ -1128,6 +1136,8 @@ class PrunePass : public MatchedNodeListener, public SDKTreeDiffPass {
11281136
}
11291137

11301138
void pass(NodePtr Left, NodePtr Right) override {
1139+
LeftRoot = Left->getAs<SDKNodeRoot>();
1140+
RightRoot = Right->getAs<SDKNodeRoot>();
11311141
foundMatch(Left, Right, NodeMatchReason::Root);
11321142
}
11331143
};
@@ -2258,6 +2268,10 @@ static int prepareForDump(const char *Main,
22582268

22592269
if (!options::Triple.empty())
22602270
InitInvok.setTargetTriple(options::Triple);
2271+
2272+
// Ensure the tool works on linux properly
2273+
InitInvok.getLangOptions().EnableObjCInterop =
2274+
InitInvok.getLangOptions().Target.isOSDarwin();
22612275
InitInvok.getClangImporterOptions().ModuleCachePath =
22622276
options::ModuleCachePath;
22632277

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
swift_install_in_component(FILES "swift-api-checker.py"
2-
DESTINATION "bin"
3-
COMPONENT tools)
41
swift_install_in_component(FILES "swift-api-checker.py"
52
DESTINATION "bin"
63
COMPONENT toolchain-tools)
7-
swift_install_in_component(DIRECTORY "sdk-module-lists"
8-
DESTINATION "bin"
9-
COMPONENT tools)
104
swift_install_in_component(DIRECTORY "sdk-module-lists"
115
DESTINATION "bin"
126
COMPONENT toolchain-tools)

0 commit comments

Comments
 (0)