Skip to content

Commit 41e2d94

Browse files
committed
---
yaml --- r: 349236 b: refs/heads/master-next c: 24a5003 h: refs/heads/master
1 parent e03f50c commit 41e2d94

Some content is hidden

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

59 files changed

+503
-471
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: 40016b55e8ea2305a631e9c9775531d8f3141121
3+
refs/heads/master-next: 24a50030781919ea71269f3ba05aafb410ca8d12
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/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/Decl.h

Lines changed: 26 additions & 25 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

@@ -6283,7 +6281,6 @@ AbstractStorageDecl::AccessorRecord::getAccessor(AccessorKind kind) const {
62836281
class EnumCaseDecl final : public Decl,
62846282
private llvm::TrailingObjects<EnumCaseDecl, EnumElementDecl *> {
62856283
friend TrailingObjects;
6286-
friend class Decl;
62876284
SourceLoc CaseLoc;
62886285

62896286
EnumCaseDecl(SourceLoc CaseLoc,
@@ -6296,7 +6293,6 @@ class EnumCaseDecl final : public Decl,
62966293
std::uninitialized_copy(Elements.begin(), Elements.end(),
62976294
getTrailingObjects<EnumElementDecl *>());
62986295
}
6299-
SourceLoc getLocFromSource() const { return CaseLoc; }
63006296

63016297
public:
63026298
static EnumCaseDecl *create(SourceLoc CaseLoc,
@@ -6308,6 +6304,11 @@ class EnumCaseDecl final : public Decl,
63086304
return {getTrailingObjects<EnumElementDecl *>(),
63096305
Bits.EnumCaseDecl.NumElements};
63106306
}
6307+
6308+
SourceLoc getLoc() const {
6309+
return CaseLoc;
6310+
}
6311+
63116312
SourceRange getSourceRange() const;
63126313

63136314
static bool classof(const Decl *D) {
@@ -6720,8 +6721,7 @@ class PrecedenceGroupDecl : public Decl {
67206721
SourceLoc higherThanLoc, ArrayRef<Relation> higherThan,
67216722
SourceLoc lowerThanLoc, ArrayRef<Relation> lowerThan,
67226723
SourceLoc rbraceLoc);
6723-
friend class Decl;
6724-
SourceLoc getLocFromSource() const { return NameLoc; }
6724+
67256725
public:
67266726
static PrecedenceGroupDecl *create(DeclContext *dc,
67276727
SourceLoc precedenceGroupLoc,
@@ -6741,6 +6741,7 @@ class PrecedenceGroupDecl : public Decl {
67416741
SourceLoc rbraceLoc);
67426742

67436743

6744+
SourceLoc getLoc() const { return NameLoc; }
67446745
SourceRange getSourceRange() const {
67456746
return { PrecedenceGroupLoc, RBraceLoc };
67466747
}
@@ -6859,8 +6860,7 @@ class OperatorDecl : public Decl {
68596860
ArrayRef<Identifier> Identifiers;
68606861
ArrayRef<SourceLoc> IdentifierLocs;
68616862
ArrayRef<NominalTypeDecl *> DesignatedNominalTypes;
6862-
SourceLoc getLocFromSource() const { return NameLoc; }
6863-
friend class Decl;
6863+
68646864
public:
68656865
OperatorDecl(DeclKind kind, DeclContext *DC, SourceLoc OperatorLoc,
68666866
Identifier Name, SourceLoc NameLoc,
@@ -6875,6 +6875,7 @@ class OperatorDecl : public Decl {
68756875
: Decl(kind, DC), OperatorLoc(OperatorLoc), NameLoc(NameLoc), name(Name),
68766876
DesignatedNominalTypes(DesignatedNominalTypes) {}
68776877

6878+
SourceLoc getLoc() const { return NameLoc; }
68786879

68796880
SourceLoc getOperatorLoc() const { return OperatorLoc; }
68806881
SourceLoc getNameLoc() const { return NameLoc; }
@@ -7037,10 +7038,6 @@ class MissingMemberDecl : public Decl {
70377038
&& "not enough bits");
70387039
setImplicit();
70397040
}
7040-
friend class Decl;
7041-
SourceLoc getLocFromSource() const {
7042-
return SourceLoc();
7043-
}
70447041
public:
70457042
static MissingMemberDecl *
70467043
create(ASTContext &ctx, DeclContext *DC, DeclName name,
@@ -7065,6 +7062,10 @@ class MissingMemberDecl : public Decl {
70657062
return Bits.MissingMemberDecl.NumberOfFieldOffsetVectorEntries;
70667063
}
70677064

7065+
SourceLoc getLoc() const {
7066+
return SourceLoc();
7067+
}
7068+
70687069
SourceRange getSourceRange() const {
70697070
return SourceRange();
70707071
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ class TypeMatcher {
107107
TRIVIAL_CASE(BuiltinRawPointerType)
108108
TRIVIAL_CASE(BuiltinNativeObjectType)
109109
TRIVIAL_CASE(BuiltinBridgeObjectType)
110+
TRIVIAL_CASE(BuiltinUnknownObjectType)
110111
TRIVIAL_CASE(BuiltinUnsafeValueBufferType)
111112
TRIVIAL_CASE(BuiltinVectorType)
112113
TRIVIAL_CASE(SILTokenType)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ ABSTRACT_TYPE(Builtin, Type)
9898
BUILTIN_TYPE(BuiltinRawPointer, BuiltinType)
9999
BUILTIN_TYPE(BuiltinNativeObject, BuiltinType)
100100
BUILTIN_TYPE(BuiltinBridgeObject, BuiltinType)
101+
BUILTIN_TYPE(BuiltinUnknownObject, BuiltinType)
101102
BUILTIN_TYPE(BuiltinUnsafeValueBuffer, BuiltinType)
102103
BUILTIN_TYPE(BuiltinVector, BuiltinType)
103104
TYPE_RANGE(Builtin, BuiltinInteger, BuiltinVector)

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,6 +1311,19 @@ class BuiltinBridgeObjectType : public BuiltinType {
13111311
};
13121312
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinBridgeObjectType, BuiltinType);
13131313

1314+
/// BuiltinUnknownObjectType - The builtin opaque Objective-C pointer type.
1315+
/// Useful for pushing an Objective-C type through swift.
1316+
class BuiltinUnknownObjectType : public BuiltinType {
1317+
friend class ASTContext;
1318+
BuiltinUnknownObjectType(const ASTContext &C)
1319+
: BuiltinType(TypeKind::BuiltinUnknownObject, C) {}
1320+
public:
1321+
static bool classof(const TypeBase *T) {
1322+
return T->getKind() == TypeKind::BuiltinUnknownObject;
1323+
}
1324+
};
1325+
DEFINE_EMPTY_CAN_TYPE_WRAPPER(BuiltinUnknownObjectType, BuiltinType);
1326+
13141327
/// BuiltinUnsafeValueBufferType - The builtin opaque fixed-size value
13151328
/// buffer type, into which storage for an arbitrary value can be
13161329
/// allocated using Builtin.allocateValueBuffer.

0 commit comments

Comments
 (0)