Skip to content

Commit 66233dc

Browse files
committed
---
yaml --- r: 349246 b: refs/heads/master-next c: 1445314 h: refs/heads/master
1 parent 1400460 commit 66233dc

File tree

189 files changed

+1625
-6549
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+1625
-6549
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 3574c513bbc5578dd9346b4ea9ab5995c5927bb5
3-
refs/heads/master-next: 9182051d34f267fadd2cf025f5fff520462e38e9
3+
refs/heads/master-next: 14453147d6182073ab1011fc4cf6a7271f42777f
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,6 @@ if(SWIFT_NEED_EXPLICIT_LIBDISPATCH)
996996
-DCMAKE_CXX_COMPILER=${SWIFT_LIBDISPATCH_CXX_COMPILER}
997997
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
998998
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
999-
-DCMAKE_INSTALL_LIBDIR=lib
1000999
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
10011000
-DCMAKE_LINKER=${CMAKE_LINKER}
10021001
-DCMAKE_RANLIB=${CMAKE_RANLIB}

branches/master-next/cmake/modules/SwiftSource.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@ function(_compile_swift_files
326326
set(sib_file "${module_base}.Onone.sib")
327327
set(sibopt_file "${module_base}.O.sib")
328328
set(sibgen_file "${module_base}.sibgen")
329+
list(APPEND swift_module_flags
330+
"-emit-module-source-info-path" "${source_info_file}")
329331

330332
if(SWIFT_ENABLE_MODULE_INTERFACES)
331333
set(interface_file "${module_base}.swiftinterface")
@@ -499,7 +501,6 @@ function(_compile_swift_files
499501
COMMAND
500502
"${PYTHON_EXECUTABLE}" "${line_directive_tool}" "@${file_path}" --
501503
"${swift_compiler_tool}" "-emit-module" "-o" "${module_file}"
502-
"-emit-module-source-info-path" "${source_info_file}"
503504
${swift_flags} ${swift_module_flags} "@${file_path}"
504505
${command_touch_module_outputs}
505506
OUTPUT ${module_outputs}

branches/master-next/docs/ABI/Mangling.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ Types
481481
type ::= 'Bf' NATURAL '_' // Builtin.Float<n>
482482
type ::= 'Bi' NATURAL '_' // Builtin.Int<n>
483483
type ::= 'BI' // Builtin.IntLiteral
484-
type ::= 'BO' // Builtin.UnknownObject (no longer a distinct type, but still used for AnyObject)
484+
type ::= 'BO' // Builtin.UnknownObject
485485
type ::= 'Bo' // Builtin.NativeObject
486486
type ::= 'Bp' // Builtin.RawPointer
487487
type ::= 'Bt' // Builtin.SILToken

branches/master-next/docs/ARCOptimization.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ is_unique performs depends on the argument type:
335335

336336
- Objective-C object types require an additional check that the
337337
dynamic object type uses native Swift reference counting:
338-
(unknown class reference, class existential)
338+
(Builtin.UnknownObject, unknown class reference, class existential)
339339

340340
- Bridged object types allow the dynamic object type check to be
341341
bypassed based on the pointer encoding:

branches/master-next/include/swift/AST/ASTContext.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ class ASTContext final {
605605
const CanType TheAnyType; /// This is 'Any', the empty protocol composition
606606
const CanType TheNativeObjectType; /// Builtin.NativeObject
607607
const CanType TheBridgeObjectType; /// Builtin.BridgeObject
608+
const CanType TheUnknownObjectType; /// Builtin.UnknownObject
608609
const CanType TheRawPointerType; /// Builtin.RawPointer
609610
const CanType TheUnsafeValueBufferType; /// Builtin.UnsafeValueBuffer
610611
const CanType TheSILTokenType; /// Builtin.SILToken

branches/master-next/include/swift/AST/ASTTypeIDs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
#include "swift/Basic/TypeID.h"
2222
namespace swift {
2323

24-
class AbstractFunctionDecl;
25-
class BraceStmt;
2624
class CustomAttr;
2725
class Decl;
2826
class GenericParamList;

branches/master-next/include/swift/AST/Decl.h

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,6 @@ class alignas(1 << DeclAlignInBits) Decl {
676676

677677
Decl(const Decl&) = delete;
678678
void operator=(const Decl&) = delete;
679-
SourceLoc getLocFromSource() const;
680679

681680
protected:
682681

@@ -1583,7 +1582,7 @@ enum class ImportKind : uint8_t {
15831582
class ImportDecl final : public Decl,
15841583
private llvm::TrailingObjects<ImportDecl, std::pair<Identifier,SourceLoc>> {
15851584
friend TrailingObjects;
1586-
friend class Decl;
1585+
15871586
public:
15881587
typedef std::pair<Identifier, SourceLoc> AccessPathElement;
15891588

@@ -1655,7 +1654,7 @@ class ImportDecl final : public Decl,
16551654
}
16561655

16571656
SourceLoc getStartLoc() const { return ImportLoc; }
1658-
SourceLoc getLocFromSource() const { return getFullAccessPath().front().second; }
1657+
SourceLoc getLoc() const { return getFullAccessPath().front().second; }
16591658
SourceRange getSourceRange() const {
16601659
return SourceRange(ImportLoc, getFullAccessPath().back().second);
16611660
}
@@ -1717,7 +1716,6 @@ class ExtensionDecl final : public GenericContext, public Decl,
17171716
std::pair<LazyMemberLoader *, uint64_t> takeConformanceLoaderSlow();
17181717

17191718
friend class ExtendedNominalRequest;
1720-
friend class Decl;
17211719
public:
17221720
using Decl::getASTContext;
17231721

@@ -1730,7 +1728,7 @@ class ExtensionDecl final : public GenericContext, public Decl,
17301728
ClangNode clangNode = ClangNode());
17311729

17321730
SourceLoc getStartLoc() const { return ExtensionLoc; }
1733-
SourceLoc getLocFromSource() const { return ExtensionLoc; }
1731+
SourceLoc getLoc() const { return ExtensionLoc; }
17341732
SourceRange getSourceRange() const {
17351733
return { ExtensionLoc, Braces.End };
17361734
}
@@ -2043,7 +2041,7 @@ class PatternBindingEntry {
20432041
class PatternBindingDecl final : public Decl,
20442042
private llvm::TrailingObjects<PatternBindingDecl, PatternBindingEntry> {
20452043
friend TrailingObjects;
2046-
friend class Decl;
2044+
20472045
SourceLoc StaticLoc; ///< Location of the 'static/class' keyword, if present.
20482046
SourceLoc VarLoc; ///< Location of the 'var' keyword.
20492047

@@ -2052,7 +2050,7 @@ class PatternBindingDecl final : public Decl,
20522050
PatternBindingDecl(SourceLoc StaticLoc, StaticSpellingKind StaticSpelling,
20532051
SourceLoc VarLoc, unsigned NumPatternEntries,
20542052
DeclContext *Parent);
2055-
SourceLoc getLocFromSource() const { return VarLoc; }
2053+
20562054
public:
20572055
static PatternBindingDecl *create(ASTContext &Ctx, SourceLoc StaticLoc,
20582056
StaticSpellingKind StaticSpelling,
@@ -2082,6 +2080,7 @@ class PatternBindingDecl final : public Decl,
20822080
SourceLoc getStartLoc() const {
20832081
return StaticLoc.isValid() ? StaticLoc : VarLoc;
20842082
}
2083+
SourceLoc getLoc() const { return VarLoc; }
20852084
SourceRange getSourceRange() const;
20862085

20872086
unsigned getNumPatternEntries() const {
@@ -2217,8 +2216,7 @@ class PatternBindingDecl final : public Decl,
22172216
/// global variables.
22182217
class TopLevelCodeDecl : public DeclContext, public Decl {
22192218
BraceStmt *Body;
2220-
SourceLoc getLocFromSource() const { return getStartLoc(); }
2221-
friend class Decl;
2219+
22222220
public:
22232221
TopLevelCodeDecl(DeclContext *Parent, BraceStmt *Body = nullptr)
22242222
: DeclContext(DeclContextKind::TopLevelCodeDecl, Parent),
@@ -2229,6 +2227,7 @@ class TopLevelCodeDecl : public DeclContext, public Decl {
22292227
void setBody(BraceStmt *b) { Body = b; }
22302228

22312229
SourceLoc getStartLoc() const;
2230+
SourceLoc getLoc() const { return getStartLoc(); }
22322231
SourceRange getSourceRange() const;
22332232

22342233
static bool classof(const Decl *D) {
@@ -2267,8 +2266,6 @@ class IfConfigDecl : public Decl {
22672266
/// The array is ASTContext allocated.
22682267
ArrayRef<IfConfigClause> Clauses;
22692268
SourceLoc EndLoc;
2270-
SourceLoc getLocFromSource() const { return Clauses[0].Loc; }
2271-
friend class Decl;
22722269
public:
22732270

22742271
IfConfigDecl(DeclContext *Parent, ArrayRef<IfConfigClause> Clauses,
@@ -2294,6 +2291,7 @@ class IfConfigDecl : public Decl {
22942291
}
22952292

22962293
SourceLoc getEndLoc() const { return EndLoc; }
2294+
SourceLoc getLoc() const { return Clauses[0].Loc; }
22972295

22982296
bool hadMissingEnd() const { return Bits.IfConfigDecl.HadMissingEnd; }
22992297

@@ -2310,8 +2308,7 @@ class PoundDiagnosticDecl : public Decl {
23102308
SourceLoc StartLoc;
23112309
SourceLoc EndLoc;
23122310
StringLiteralExpr *Message;
2313-
SourceLoc getLocFromSource() const { return StartLoc; }
2314-
friend class Decl;
2311+
23152312
public:
23162313
PoundDiagnosticDecl(DeclContext *Parent, bool IsError, SourceLoc StartLoc,
23172314
SourceLoc EndLoc, StringLiteralExpr *Message)
@@ -2340,6 +2337,7 @@ class PoundDiagnosticDecl : public Decl {
23402337
}
23412338

23422339
SourceLoc getEndLoc() const { return EndLoc; };
2340+
SourceLoc getLoc() const { return StartLoc; }
23432341

23442342
SourceRange getSourceRange() const {
23452343
return SourceRange(StartLoc, EndLoc);
@@ -2402,8 +2400,7 @@ class ValueDecl : public Decl {
24022400
friend class IsFinalRequest;
24032401
friend class IsDynamicRequest;
24042402
friend class IsImplicitlyUnwrappedOptionalRequest;
2405-
friend class Decl;
2406-
SourceLoc getLocFromSource() const { return NameLoc; }
2403+
24072404
protected:
24082405
ValueDecl(DeclKind K,
24092406
llvm::PointerUnion<DeclContext *, ASTContext *> context,
@@ -2476,6 +2473,7 @@ class ValueDecl : public Decl {
24762473
bool canInferObjCFromRequirement(ValueDecl *requirement);
24772474

24782475
SourceLoc getNameLoc() const { return NameLoc; }
2476+
SourceLoc getLoc() const { return NameLoc; }
24792477

24802478
bool isUsableFromInline() const;
24812479

@@ -5691,8 +5689,7 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
56915689
/// Note that a true return value does not imply that the body was actually
56925690
/// parsed.
56935691
bool hasBody() const {
5694-
return getBodyKind() != BodyKind::None &&
5695-
getBodyKind() != BodyKind::Skipped;
5692+
return getBodyKind() != BodyKind::None;
56965693
}
56975694

56985695
/// Returns true if the text of this function's body can be retrieved either
@@ -5719,22 +5716,14 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
57195716
/// Note that the body was skipped for this function. Function body
57205717
/// cannot be attached after this call.
57215718
void setBodySkipped(SourceRange bodyRange) {
5722-
// FIXME: Remove 'Parsed' from this once we can delay parsing function
5723-
// bodies. Right now -experimental-skip-non-inlinable-function-bodies
5724-
// requires being able to change the state from Parsed to Skipped,
5725-
// because we're still eagerly parsing function bodies.
5726-
assert(getBodyKind() == BodyKind::None ||
5727-
getBodyKind() == BodyKind::Unparsed ||
5728-
getBodyKind() == BodyKind::Parsed);
5729-
assert(bodyRange.isValid());
5719+
assert(getBodyKind() == BodyKind::None);
57305720
BodyRange = bodyRange;
57315721
setBodyKind(BodyKind::Skipped);
57325722
}
57335723

57345724
/// Note that parsing for the body was delayed.
57355725
void setBodyDelayed(SourceRange bodyRange) {
57365726
assert(getBodyKind() == BodyKind::None);
5737-
assert(bodyRange.isValid());
57385727
BodyRange = bodyRange;
57395728
setBodyKind(BodyKind::Unparsed);
57405729
}
@@ -5780,10 +5769,6 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
57805769
return getBodyKind() == BodyKind::TypeChecked;
57815770
}
57825771

5783-
bool isBodySkipped() const {
5784-
return getBodyKind() == BodyKind::Skipped;
5785-
}
5786-
57875772
bool isMemberwiseInitializer() const {
57885773
return getBodyKind() == BodyKind::MemberwiseInitializer;
57895774
}
@@ -6283,7 +6268,6 @@ AbstractStorageDecl::AccessorRecord::getAccessor(AccessorKind kind) const {
62836268
class EnumCaseDecl final : public Decl,
62846269
private llvm::TrailingObjects<EnumCaseDecl, EnumElementDecl *> {
62856270
friend TrailingObjects;
6286-
friend class Decl;
62876271
SourceLoc CaseLoc;
62886272

62896273
EnumCaseDecl(SourceLoc CaseLoc,
@@ -6296,7 +6280,6 @@ class EnumCaseDecl final : public Decl,
62966280
std::uninitialized_copy(Elements.begin(), Elements.end(),
62976281
getTrailingObjects<EnumElementDecl *>());
62986282
}
6299-
SourceLoc getLocFromSource() const { return CaseLoc; }
63006283

63016284
public:
63026285
static EnumCaseDecl *create(SourceLoc CaseLoc,
@@ -6308,6 +6291,11 @@ class EnumCaseDecl final : public Decl,
63086291
return {getTrailingObjects<EnumElementDecl *>(),
63096292
Bits.EnumCaseDecl.NumElements};
63106293
}
6294+
6295+
SourceLoc getLoc() const {
6296+
return CaseLoc;
6297+
}
6298+
63116299
SourceRange getSourceRange() const;
63126300

63136301
static bool classof(const Decl *D) {
@@ -6341,7 +6329,9 @@ class EnumElementDecl : public DeclContext, public ValueDecl {
63416329

63426330
/// The raw value literal for the enum element, or null.
63436331
LiteralExpr *RawValueExpr;
6344-
6332+
/// The type-checked raw value expression.
6333+
Expr *TypeCheckedRawValueExpr = nullptr;
6334+
63456335
public:
63466336
EnumElementDecl(SourceLoc IdentifierLoc, DeclName Name,
63476337
ParameterList *Params,
@@ -6374,6 +6364,13 @@ class EnumElementDecl : public DeclContext, public ValueDecl {
63746364
bool hasRawValueExpr() const { return RawValueExpr; }
63756365
LiteralExpr *getRawValueExpr() const { return RawValueExpr; }
63766366
void setRawValueExpr(LiteralExpr *e) { RawValueExpr = e; }
6367+
6368+
Expr *getTypeCheckedRawValueExpr() const {
6369+
return TypeCheckedRawValueExpr;
6370+
}
6371+
void setTypeCheckedRawValueExpr(Expr *e) {
6372+
TypeCheckedRawValueExpr = e;
6373+
}
63776374

63786375
/// Return the containing EnumDecl.
63796376
EnumDecl *getParentEnum() const {
@@ -6720,8 +6717,7 @@ class PrecedenceGroupDecl : public Decl {
67206717
SourceLoc higherThanLoc, ArrayRef<Relation> higherThan,
67216718
SourceLoc lowerThanLoc, ArrayRef<Relation> lowerThan,
67226719
SourceLoc rbraceLoc);
6723-
friend class Decl;
6724-
SourceLoc getLocFromSource() const { return NameLoc; }
6720+
67256721
public:
67266722
static PrecedenceGroupDecl *create(DeclContext *dc,
67276723
SourceLoc precedenceGroupLoc,
@@ -6741,6 +6737,7 @@ class PrecedenceGroupDecl : public Decl {
67416737
SourceLoc rbraceLoc);
67426738

67436739

6740+
SourceLoc getLoc() const { return NameLoc; }
67446741
SourceRange getSourceRange() const {
67456742
return { PrecedenceGroupLoc, RBraceLoc };
67466743
}
@@ -6859,8 +6856,7 @@ class OperatorDecl : public Decl {
68596856
ArrayRef<Identifier> Identifiers;
68606857
ArrayRef<SourceLoc> IdentifierLocs;
68616858
ArrayRef<NominalTypeDecl *> DesignatedNominalTypes;
6862-
SourceLoc getLocFromSource() const { return NameLoc; }
6863-
friend class Decl;
6859+
68646860
public:
68656861
OperatorDecl(DeclKind kind, DeclContext *DC, SourceLoc OperatorLoc,
68666862
Identifier Name, SourceLoc NameLoc,
@@ -6875,6 +6871,7 @@ class OperatorDecl : public Decl {
68756871
: Decl(kind, DC), OperatorLoc(OperatorLoc), NameLoc(NameLoc), name(Name),
68766872
DesignatedNominalTypes(DesignatedNominalTypes) {}
68776873

6874+
SourceLoc getLoc() const { return NameLoc; }
68786875

68796876
SourceLoc getOperatorLoc() const { return OperatorLoc; }
68806877
SourceLoc getNameLoc() const { return NameLoc; }
@@ -7037,10 +7034,6 @@ class MissingMemberDecl : public Decl {
70377034
&& "not enough bits");
70387035
setImplicit();
70397036
}
7040-
friend class Decl;
7041-
SourceLoc getLocFromSource() const {
7042-
return SourceLoc();
7043-
}
70447037
public:
70457038
static MissingMemberDecl *
70467039
create(ASTContext &ctx, DeclContext *DC, DeclName name,
@@ -7065,6 +7058,10 @@ class MissingMemberDecl : public Decl {
70657058
return Bits.MissingMemberDecl.NumberOfFieldOffsetVectorEntries;
70667059
}
70677060

7061+
SourceLoc getLoc() const {
7062+
return SourceLoc();
7063+
}
7064+
70687065
SourceRange getSourceRange() const {
70697066
return SourceRange();
70707067
}

branches/master-next/include/swift/AST/DeclContext.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -409,15 +409,6 @@ class alignas(1 << DeclContextAlignInBits) DeclContext {
409409
const_cast<DeclContext *>(this)->getInnermostDeclarationDeclContext();
410410
}
411411

412-
/// Returns the innermost context that is an AbstractFunctionDecl whose
413-
/// body has been skipped.
414-
LLVM_READONLY
415-
DeclContext *getInnermostSkippedFunctionContext();
416-
const DeclContext *getInnermostSkippedFunctionContext() const {
417-
return
418-
const_cast<DeclContext *>(this)->getInnermostSkippedFunctionContext();
419-
}
420-
421412
/// Returns the semantic parent of this context. A context has a
422413
/// parent if and only if it is not a module context.
423414
DeclContext *getParent() const {

branches/master-next/include/swift/AST/DiagnosticEngine.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,15 @@
1818
#ifndef SWIFT_BASIC_DIAGNOSTICENGINE_H
1919
#define SWIFT_BASIC_DIAGNOSTICENGINE_H
2020

21+
#include "swift/AST/Attr.h"
2122
#include "swift/AST/TypeLoc.h"
2223
#include "swift/AST/DeclNameLoc.h"
2324
#include "swift/AST/DiagnosticConsumer.h"
2425
#include "llvm/ADT/StringMap.h"
2526
#include "llvm/Support/Allocator.h"
26-
#include "llvm/Support/VersionTuple.h"
2727

2828
namespace swift {
2929
class Decl;
30-
class DeclAttribute;
3130
class DiagnosticEngine;
3231
class SourceManager;
3332
class ValueDecl;

0 commit comments

Comments
 (0)