Skip to content

Commit e03f50c

Browse files
authored
---
yaml --- r: 349235 b: refs/heads/master-next c: 40016b5 h: refs/heads/master i: 349233: dcd92bb 349231: 21fb095
1 parent 5838d9f commit e03f50c

File tree

99 files changed

+1588
-821
lines changed

Some content is hidden

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

99 files changed

+1588
-821
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: ed958a7e81e879ec86a6f7b272582df5b3636715
3+
refs/heads/master-next: 40016b55e8ea2305a631e9c9775531d8f3141121
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,7 @@ 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
9991000
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
10001001
-DCMAKE_LINKER=${CMAKE_LINKER}
10011002
-DCMAKE_RANLIB=${CMAKE_RANLIB}

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,6 @@ 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}")
331329

332330
if(SWIFT_ENABLE_MODULE_INTERFACES)
333331
set(interface_file "${module_base}.swiftinterface")
@@ -501,6 +499,7 @@ function(_compile_swift_files
501499
COMMAND
502500
"${PYTHON_EXECUTABLE}" "${line_directive_tool}" "@${file_path}" --
503501
"${swift_compiler_tool}" "-emit-module" "-o" "${module_file}"
502+
"-emit-module-source-info-path" "${source_info_file}"
504503
${swift_flags} ${swift_module_flags} "@${file_path}"
505504
${command_touch_module_outputs}
506505
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
484+
type ::= 'BO' // Builtin.UnknownObject (no longer a distinct type, but still used for AnyObject)
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-
(Builtin.UnknownObject, unknown class reference, class existential)
338+
(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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,6 @@ 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
609608
const CanType TheRawPointerType; /// Builtin.RawPointer
610609
const CanType TheUnsafeValueBufferType; /// Builtin.UnsafeValueBuffer
611610
const CanType TheSILTokenType; /// Builtin.SILToken

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

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

677677
Decl(const Decl&) = delete;
678678
void operator=(const Decl&) = delete;
679+
SourceLoc getLocFromSource() const;
679680

680681
protected:
681682

@@ -1582,7 +1583,7 @@ enum class ImportKind : uint8_t {
15821583
class ImportDecl final : public Decl,
15831584
private llvm::TrailingObjects<ImportDecl, std::pair<Identifier,SourceLoc>> {
15841585
friend TrailingObjects;
1585-
1586+
friend class Decl;
15861587
public:
15871588
typedef std::pair<Identifier, SourceLoc> AccessPathElement;
15881589

@@ -1654,7 +1655,7 @@ class ImportDecl final : public Decl,
16541655
}
16551656

16561657
SourceLoc getStartLoc() const { return ImportLoc; }
1657-
SourceLoc getLoc() const { return getFullAccessPath().front().second; }
1658+
SourceLoc getLocFromSource() const { return getFullAccessPath().front().second; }
16581659
SourceRange getSourceRange() const {
16591660
return SourceRange(ImportLoc, getFullAccessPath().back().second);
16601661
}
@@ -1716,6 +1717,7 @@ class ExtensionDecl final : public GenericContext, public Decl,
17161717
std::pair<LazyMemberLoader *, uint64_t> takeConformanceLoaderSlow();
17171718

17181719
friend class ExtendedNominalRequest;
1720+
friend class Decl;
17191721
public:
17201722
using Decl::getASTContext;
17211723

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

17301732
SourceLoc getStartLoc() const { return ExtensionLoc; }
1731-
SourceLoc getLoc() const { return ExtensionLoc; }
1733+
SourceLoc getLocFromSource() const { return ExtensionLoc; }
17321734
SourceRange getSourceRange() const {
17331735
return { ExtensionLoc, Braces.End };
17341736
}
@@ -2041,7 +2043,7 @@ class PatternBindingEntry {
20412043
class PatternBindingDecl final : public Decl,
20422044
private llvm::TrailingObjects<PatternBindingDecl, PatternBindingEntry> {
20432045
friend TrailingObjects;
2044-
2046+
friend class Decl;
20452047
SourceLoc StaticLoc; ///< Location of the 'static/class' keyword, if present.
20462048
SourceLoc VarLoc; ///< Location of the 'var' keyword.
20472049

@@ -2050,7 +2052,7 @@ class PatternBindingDecl final : public Decl,
20502052
PatternBindingDecl(SourceLoc StaticLoc, StaticSpellingKind StaticSpelling,
20512053
SourceLoc VarLoc, unsigned NumPatternEntries,
20522054
DeclContext *Parent);
2053-
2055+
SourceLoc getLocFromSource() const { return VarLoc; }
20542056
public:
20552057
static PatternBindingDecl *create(ASTContext &Ctx, SourceLoc StaticLoc,
20562058
StaticSpellingKind StaticSpelling,
@@ -2080,7 +2082,6 @@ class PatternBindingDecl final : public Decl,
20802082
SourceLoc getStartLoc() const {
20812083
return StaticLoc.isValid() ? StaticLoc : VarLoc;
20822084
}
2083-
SourceLoc getLoc() const { return VarLoc; }
20842085
SourceRange getSourceRange() const;
20852086

20862087
unsigned getNumPatternEntries() const {
@@ -2216,7 +2217,8 @@ class PatternBindingDecl final : public Decl,
22162217
/// global variables.
22172218
class TopLevelCodeDecl : public DeclContext, public Decl {
22182219
BraceStmt *Body;
2219-
2220+
SourceLoc getLocFromSource() const { return getStartLoc(); }
2221+
friend class Decl;
22202222
public:
22212223
TopLevelCodeDecl(DeclContext *Parent, BraceStmt *Body = nullptr)
22222224
: DeclContext(DeclContextKind::TopLevelCodeDecl, Parent),
@@ -2227,7 +2229,6 @@ class TopLevelCodeDecl : public DeclContext, public Decl {
22272229
void setBody(BraceStmt *b) { Body = b; }
22282230

22292231
SourceLoc getStartLoc() const;
2230-
SourceLoc getLoc() const { return getStartLoc(); }
22312232
SourceRange getSourceRange() const;
22322233

22332234
static bool classof(const Decl *D) {
@@ -2266,6 +2267,8 @@ class IfConfigDecl : public Decl {
22662267
/// The array is ASTContext allocated.
22672268
ArrayRef<IfConfigClause> Clauses;
22682269
SourceLoc EndLoc;
2270+
SourceLoc getLocFromSource() const { return Clauses[0].Loc; }
2271+
friend class Decl;
22692272
public:
22702273

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

22932296
SourceLoc getEndLoc() const { return EndLoc; }
2294-
SourceLoc getLoc() const { return Clauses[0].Loc; }
22952297

22962298
bool hadMissingEnd() const { return Bits.IfConfigDecl.HadMissingEnd; }
22972299

@@ -2308,7 +2310,8 @@ class PoundDiagnosticDecl : public Decl {
23082310
SourceLoc StartLoc;
23092311
SourceLoc EndLoc;
23102312
StringLiteralExpr *Message;
2311-
2313+
SourceLoc getLocFromSource() const { return StartLoc; }
2314+
friend class Decl;
23122315
public:
23132316
PoundDiagnosticDecl(DeclContext *Parent, bool IsError, SourceLoc StartLoc,
23142317
SourceLoc EndLoc, StringLiteralExpr *Message)
@@ -2337,7 +2340,6 @@ class PoundDiagnosticDecl : public Decl {
23372340
}
23382341

23392342
SourceLoc getEndLoc() const { return EndLoc; };
2340-
SourceLoc getLoc() const { return StartLoc; }
23412343

23422344
SourceRange getSourceRange() const {
23432345
return SourceRange(StartLoc, EndLoc);
@@ -2400,7 +2402,8 @@ class ValueDecl : public Decl {
24002402
friend class IsFinalRequest;
24012403
friend class IsDynamicRequest;
24022404
friend class IsImplicitlyUnwrappedOptionalRequest;
2403-
2405+
friend class Decl;
2406+
SourceLoc getLocFromSource() const { return NameLoc; }
24042407
protected:
24052408
ValueDecl(DeclKind K,
24062409
llvm::PointerUnion<DeclContext *, ASTContext *> context,
@@ -2473,7 +2476,6 @@ class ValueDecl : public Decl {
24732476
bool canInferObjCFromRequirement(ValueDecl *requirement);
24742477

24752478
SourceLoc getNameLoc() const { return NameLoc; }
2476-
SourceLoc getLoc() const { return NameLoc; }
24772479

24782480
bool isUsableFromInline() const;
24792481

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

56955698
/// Returns true if the text of this function's body can be retrieved either
@@ -5716,14 +5719,22 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
57165719
/// Note that the body was skipped for this function. Function body
57175720
/// cannot be attached after this call.
57185721
void setBodySkipped(SourceRange bodyRange) {
5719-
assert(getBodyKind() == BodyKind::None);
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());
57205730
BodyRange = bodyRange;
57215731
setBodyKind(BodyKind::Skipped);
57225732
}
57235733

57245734
/// Note that parsing for the body was delayed.
57255735
void setBodyDelayed(SourceRange bodyRange) {
57265736
assert(getBodyKind() == BodyKind::None);
5737+
assert(bodyRange.isValid());
57275738
BodyRange = bodyRange;
57285739
setBodyKind(BodyKind::Unparsed);
57295740
}
@@ -5769,6 +5780,10 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
57695780
return getBodyKind() == BodyKind::TypeChecked;
57705781
}
57715782

5783+
bool isBodySkipped() const {
5784+
return getBodyKind() == BodyKind::Skipped;
5785+
}
5786+
57725787
bool isMemberwiseInitializer() const {
57735788
return getBodyKind() == BodyKind::MemberwiseInitializer;
57745789
}
@@ -6268,6 +6283,7 @@ AbstractStorageDecl::AccessorRecord::getAccessor(AccessorKind kind) const {
62686283
class EnumCaseDecl final : public Decl,
62696284
private llvm::TrailingObjects<EnumCaseDecl, EnumElementDecl *> {
62706285
friend TrailingObjects;
6286+
friend class Decl;
62716287
SourceLoc CaseLoc;
62726288

62736289
EnumCaseDecl(SourceLoc CaseLoc,
@@ -6280,6 +6296,7 @@ class EnumCaseDecl final : public Decl,
62806296
std::uninitialized_copy(Elements.begin(), Elements.end(),
62816297
getTrailingObjects<EnumElementDecl *>());
62826298
}
6299+
SourceLoc getLocFromSource() const { return CaseLoc; }
62836300

62846301
public:
62856302
static EnumCaseDecl *create(SourceLoc CaseLoc,
@@ -6291,11 +6308,6 @@ class EnumCaseDecl final : public Decl,
62916308
return {getTrailingObjects<EnumElementDecl *>(),
62926309
Bits.EnumCaseDecl.NumElements};
62936310
}
6294-
6295-
SourceLoc getLoc() const {
6296-
return CaseLoc;
6297-
}
6298-
62996311
SourceRange getSourceRange() const;
63006312

63016313
static bool classof(const Decl *D) {
@@ -6708,7 +6720,8 @@ class PrecedenceGroupDecl : public Decl {
67086720
SourceLoc higherThanLoc, ArrayRef<Relation> higherThan,
67096721
SourceLoc lowerThanLoc, ArrayRef<Relation> lowerThan,
67106722
SourceLoc rbraceLoc);
6711-
6723+
friend class Decl;
6724+
SourceLoc getLocFromSource() const { return NameLoc; }
67126725
public:
67136726
static PrecedenceGroupDecl *create(DeclContext *dc,
67146727
SourceLoc precedenceGroupLoc,
@@ -6728,7 +6741,6 @@ class PrecedenceGroupDecl : public Decl {
67286741
SourceLoc rbraceLoc);
67296742

67306743

6731-
SourceLoc getLoc() const { return NameLoc; }
67326744
SourceRange getSourceRange() const {
67336745
return { PrecedenceGroupLoc, RBraceLoc };
67346746
}
@@ -6847,7 +6859,8 @@ class OperatorDecl : public Decl {
68476859
ArrayRef<Identifier> Identifiers;
68486860
ArrayRef<SourceLoc> IdentifierLocs;
68496861
ArrayRef<NominalTypeDecl *> DesignatedNominalTypes;
6850-
6862+
SourceLoc getLocFromSource() const { return NameLoc; }
6863+
friend class Decl;
68516864
public:
68526865
OperatorDecl(DeclKind kind, DeclContext *DC, SourceLoc OperatorLoc,
68536866
Identifier Name, SourceLoc NameLoc,
@@ -6862,7 +6875,6 @@ class OperatorDecl : public Decl {
68626875
: Decl(kind, DC), OperatorLoc(OperatorLoc), NameLoc(NameLoc), name(Name),
68636876
DesignatedNominalTypes(DesignatedNominalTypes) {}
68646877

6865-
SourceLoc getLoc() const { return NameLoc; }
68666878

68676879
SourceLoc getOperatorLoc() const { return OperatorLoc; }
68686880
SourceLoc getNameLoc() const { return NameLoc; }
@@ -7025,6 +7037,10 @@ class MissingMemberDecl : public Decl {
70257037
&& "not enough bits");
70267038
setImplicit();
70277039
}
7040+
friend class Decl;
7041+
SourceLoc getLocFromSource() const {
7042+
return SourceLoc();
7043+
}
70287044
public:
70297045
static MissingMemberDecl *
70307046
create(ASTContext &ctx, DeclContext *DC, DeclName name,
@@ -7049,10 +7065,6 @@ class MissingMemberDecl : public Decl {
70497065
return Bits.MissingMemberDecl.NumberOfFieldOffsetVectorEntries;
70507066
}
70517067

7052-
SourceLoc getLoc() const {
7053-
return SourceLoc();
7054-
}
7055-
70567068
SourceRange getSourceRange() const {
70577069
return SourceRange();
70587070
}

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,15 @@ 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+
412421
/// Returns the semantic parent of this context. A context has a
413422
/// parent if and only if it is not a module context.
414423
DeclContext *getParent() const {

branches/master-next/include/swift/AST/DiagnosticsFrontend.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ ERROR(error_mode_cannot_emit_module_source_info,none,
128128
"this mode does not support emitting module source info files", ())
129129
ERROR(error_mode_cannot_emit_interface,none,
130130
"this mode does not support emitting module interface files", ())
131+
ERROR(cannot_emit_ir_skipping_function_bodies,none,
132+
"-experimental-skip-non-inlinable-function-bodies does not support "
133+
"emitting IR", ())
131134

132135
WARNING(emit_reference_dependencies_without_primary_file,none,
133136
"ignoring -emit-reference-dependencies (requires -primary-file)", ())

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ class SILOptions {
7070
/// Whether to stop the optimization pipeline after serializing SIL.
7171
bool StopOptimizationAfterSerialization = false;
7272

73+
/// Whether to skip emitting non-inlinable function bodies.
74+
bool SkipNonInlinableFunctionBodies = false;
75+
7376
/// Optimization mode being used.
7477
OptimizationMode OptMode = OptimizationMode::NotSet;
7578

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ class TypeMatcher {
107107
TRIVIAL_CASE(BuiltinRawPointerType)
108108
TRIVIAL_CASE(BuiltinNativeObjectType)
109109
TRIVIAL_CASE(BuiltinBridgeObjectType)
110-
TRIVIAL_CASE(BuiltinUnknownObjectType)
111110
TRIVIAL_CASE(BuiltinUnsafeValueBufferType)
112111
TRIVIAL_CASE(BuiltinVectorType)
113112
TRIVIAL_CASE(SILTokenType)

branches/master-next/include/swift/AST/TypeNodes.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ ABSTRACT_TYPE(Builtin, Type)
9898
BUILTIN_TYPE(BuiltinRawPointer, BuiltinType)
9999
BUILTIN_TYPE(BuiltinNativeObject, BuiltinType)
100100
BUILTIN_TYPE(BuiltinBridgeObject, BuiltinType)
101-
BUILTIN_TYPE(BuiltinUnknownObject, BuiltinType)
102101
BUILTIN_TYPE(BuiltinUnsafeValueBuffer, BuiltinType)
103102
BUILTIN_TYPE(BuiltinVector, BuiltinType)
104103
TYPE_RANGE(Builtin, BuiltinInteger, BuiltinVector)

0 commit comments

Comments
 (0)