Skip to content

Commit c1025fd

Browse files
committed
---
yaml --- r: 346719 b: refs/heads/master c: 893b9cd h: refs/heads/master i: 346717: 62652d2 346715: e65faf4 346711: 0480a8a 346703: b50c075 346687: 44ccaa5
1 parent 0c82310 commit c1025fd

File tree

11 files changed

+70
-10
lines changed

11 files changed

+70
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: a01e4f867b5be93044a98e8bf59c58847bc6f636
2+
refs/heads/master: 893b9cd9cf7da8cff7fa763a0da00c215426bc7f
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/include/swift/AST/ExperimentalDependencies.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -939,8 +939,9 @@ template <typename GraphT> class DotFileEmitter {
939939
// MARK: Declarations for YAMLTraits for reading/writing of SourceFileDepGraph
940940
//==============================================================================
941941

942-
// This introduces a redefinition for Linux.
943-
#if !defined(__linux__)
942+
// This introduces a redefinition where ever std::is_same_t<size_t, uint64_t>
943+
// holds
944+
#if !(defined(__linux__) || defined(_WIN64))
944945
LLVM_YAML_DECLARE_SCALAR_TRAITS(size_t, QuotingType::None)
945946
#endif
946947
LLVM_YAML_DECLARE_ENUM_TRAITS(swift::experimental_dependencies::NodeKind)

trunk/lib/AST/ExperimentalDependencies.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ void SourceFileDepGraph::verifySame(const SourceFileDepGraph &other) const {
262262
namespace llvm {
263263
namespace yaml {
264264
// This introduces a redefinition for Linux.
265-
#if !defined(__linux__)
265+
#if !(defined(__linux__) || defined(_WIN64))
266266
void ScalarTraits<size_t>::output(const size_t &Val, void *, raw_ostream &out) {
267267
out << Val;
268268
}

trunk/lib/Sema/MiscDiagnostics.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2201,7 +2201,7 @@ class VarDeclUsageChecker : public ASTWalker {
22012201
const VarDecl *AssociatedGetter = nullptr;
22022202

22032203
/// The first reference to the associated getter.
2204-
const DeclRefExpr *AssociatedGetterDeclRef = nullptr;
2204+
const Expr *AssociatedGetterRefExpr = nullptr;
22052205

22062206
/// This is a mapping from VarDecls to the if/while/guard statement that they
22072207
/// occur in, when they are in a pattern in a StmtCondition.
@@ -2468,7 +2468,7 @@ VarDeclUsageChecker::~VarDeclUsageChecker() {
24682468
if (FD && FD->getAccessorKind() == AccessorKind::Set) {
24692469
auto getter = dyn_cast<VarDecl>(FD->getStorage());
24702470
if ((access & RK_Read) == 0 && AssociatedGetter == getter) {
2471-
if (auto DRE = AssociatedGetterDeclRef) {
2471+
if (auto DRE = AssociatedGetterRefExpr) {
24722472
Diags.diagnose(DRE->getLoc(), diag::unused_setter_parameter,
24732473
var->getName());
24742474
Diags.diagnose(DRE->getLoc(), diag::fixit_for_unused_setter_parameter,
@@ -2764,10 +2764,18 @@ std::pair<bool, Expr *> VarDeclUsageChecker::walkToExprPre(Expr *E) {
27642764
if (auto *DRE = dyn_cast<DeclRefExpr>(E)) {
27652765
addMark(DRE->getDecl(), RK_Read);
27662766

2767-
// If the Decl is a read of a getter, track the first DRE for diagnostics
2767+
// If the Expression is a read of a getter, track for diagnostics
27682768
if (auto VD = dyn_cast<VarDecl>(DRE->getDecl())) {
2769-
if (AssociatedGetter == VD && AssociatedGetterDeclRef == nullptr)
2770-
AssociatedGetterDeclRef = DRE;
2769+
if (AssociatedGetter == VD && AssociatedGetterRefExpr == nullptr)
2770+
AssociatedGetterRefExpr = DRE;
2771+
}
2772+
}
2773+
// If the Expression is a member reference, see if it is a read of the getter
2774+
// to track for diagnostics.
2775+
if (auto *MRE = dyn_cast<MemberRefExpr>(E)) {
2776+
if (auto VD = dyn_cast<VarDecl>(MRE->getMember().getDecl())) {
2777+
if (AssociatedGetter == VD && AssociatedGetterRefExpr == nullptr)
2778+
AssociatedGetterRefExpr = MRE;
27712779
}
27722780
}
27732781
// If this is an AssignExpr, see if we're mutating something that we know

trunk/test/Sema/diag_self_assign.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class SA3 {
5050
return foo // expected-warning {{attempting to access 'foo' within its own getter}} expected-note{{access 'self' explicitly to silence this warning}} {{14-14=self.}}
5151
}
5252
set {
53-
foo = foo // expected-error {{assigning a property to itself}} expected-warning {{attempting to modify 'foo' within its own setter}} expected-note{{access 'self' explicitly to silence this warning}} {{7-7=self.}}
53+
foo = foo // expected-error {{assigning a property to itself}} expected-warning {{attempting to modify 'foo' within its own setter}} expected-note{{access 'self' explicitly to silence this warning}} {{7-7=self.}} expected-warning{{setter argument 'newValue' was never used, but the property was accessed}} expected-note{{did you mean to use 'newValue' instead of accessing the property's current value?}}
5454
self.foo = self.foo // expected-error {{assigning a property to itself}}
5555
foo = self.foo // expected-error {{assigning a property to itself}} expected-warning {{attempting to modify 'foo' within its own setter}} expected-note{{access 'self' explicitly to silence this warning}} {{7-7=self.}}
5656
self.foo = foo // expected-error {{assigning a property to itself}}

trunk/test/decl/var/usage.swift

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,22 @@ func sr964() {
287287
print(suspiciousSetter) // expected-warning {{setter argument 'newValue' was never used, but the property was accessed}} expected-note {{did you mean to use 'newValue' instead of accessing the property's current value?}} {{13-29=newValue}}
288288
}
289289
}
290+
struct MemberGetterStruct {
291+
var suspiciousSetter: String {
292+
get { return "" }
293+
set {
294+
print(suspiciousSetter) // expected-warning {{setter argument 'newValue' was never used, but the property was accessed}} expected-note {{did you mean to use 'newValue' instead of accessing the property's current value?}} {{15-31=newValue}}
295+
}
296+
}
297+
}
298+
class MemberGetterClass {
299+
var suspiciousSetter: String {
300+
get { return "" }
301+
set {
302+
print(suspiciousSetter) // expected-warning {{setter argument 'newValue' was never used, but the property was accessed}} expected-note {{did you mean to use 'newValue' instead of accessing the property's current value?}} {{15-31=newValue}}
303+
}
304+
}
305+
}
290306
var namedSuspiciousSetter: String {
291307
get { return "" }
292308
set(parameter) {
@@ -305,3 +321,12 @@ func sr964() {
305321
}
306322
}
307323
}
324+
struct MemberGetterExtension {}
325+
extension MemberGetterExtension {
326+
var suspiciousSetter: String {
327+
get { return "" }
328+
set {
329+
print(suspiciousSetter) // expected-warning {{setter argument 'newValue' was never used, but the property was accessed}} expected-note {{did you mean to use 'newValue' instead of accessing the property's current value?}} {{13-29=newValue}}
330+
}
331+
}
332+
}

trunk/utils/build-presets.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,7 @@ install-libicu
730730
install-prefix=/usr
731731
swift-install-components=autolink-driver;compiler;clang-resource-dir-symlink;stdlib;swift-remote-mirror;sdk-overlay;parser-lib;license;sourcekit-inproc
732732
llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-headers;compiler-rt;clangd
733+
install-libcxx
733734
build-swift-static-stdlib
734735
build-swift-static-sdk-overlay
735736
build-swift-stdlib-unittest-extra
@@ -1082,6 +1083,7 @@ reconfigure
10821083

10831084
swift-install-components=compiler;clang-resource-dir-symlink;stdlib;sdk-overlay;parser-lib;license;sourcekit-xpc-service;swift-remote-mirror;swift-remote-mirror-headers
10841085
llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-headers;compiler-rt;clangd
1086+
install-libcxx
10851087

10861088
# Path to the .tar.gz package we would create.
10871089
installable-package=%(installable_package)s

trunk/utils/build-script

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,7 @@ class BuildScriptInvocation(object):
841841
product_classes = []
842842
product_classes.append(products.CMark)
843843
product_classes.append(products.LLVM)
844+
product_classes.append(products.LibCXX)
844845
if self.args.build_libicu:
845846
product_classes.append(products.LibICU)
846847
product_classes.append(products.Swift)

trunk/utils/build-script-impl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ KNOWN_SETTINGS=(
208208
install-swiftevolve "" "whether to install the swift-evolve tool"
209209
install-xctest "" "whether to install xctest"
210210
install-foundation "" "whether to install foundation"
211+
install-libcxx "" "whether to install libc++"
211212
install-libdispatch "" "whether to install libdispatch"
212213
install-libicu "" "whether to install libicu"
213214
install-playgroundsupport "" "whether to install PlaygroundSupport"
@@ -3513,6 +3514,9 @@ for host in "${ALL_HOSTS[@]}"; do
35133514
INSTALL_TARGETS=install-$(echo ${LLVM_INSTALL_COMPONENTS} | sed -E 's/;/ install-/g')
35143515
;;
35153516
libcxx)
3517+
if [[ -z "${INSTALL_LIBCXX}" ]] ; then
3518+
continue
3519+
fi
35163520
INSTALL_TARGETS=install-cxx-headers
35173521
;;
35183522
swift)

trunk/utils/swift_build_support/swift_build_support/products/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from .cmark import CMark
1414
from .foundation import Foundation
15+
from .libcxx import LibCXX
1516
from .libdispatch import LibDispatch
1617
from .libicu import LibICU
1718
from .llbuild import LLBuild
@@ -28,6 +29,7 @@
2829
'CMark',
2930
'Ninja',
3031
'Foundation',
32+
'LibCXX',
3133
'LibDispatch',
3234
'LibICU',
3335
'LLBuild',
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# swift_build_support/products/libcxx.py -------------------------*- python -*-
2+
#
3+
# This source file is part of the Swift.org open source project
4+
#
5+
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
6+
# Licensed under Apache License v2.0 with Runtime Library Exception
7+
#
8+
# See https://swift.org/LICENSE.txt for license information
9+
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
#
11+
# ----------------------------------------------------------------------------
12+
13+
from . import product
14+
15+
16+
class LibCXX(product.Product):
17+
pass

0 commit comments

Comments
 (0)