Skip to content

Commit 2ad9bae

Browse files
committed
---
yaml --- r: 348911 b: refs/heads/master c: 7e6b4e4 h: refs/heads/master i: 348909: 53f0422 348907: c779df1 348903: b334f25 348895: 04930ee
1 parent 45b1b9e commit 2ad9bae

File tree

82 files changed

+886
-1081
lines changed

Some content is hidden

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

82 files changed

+886
-1081
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: 0587470a2bb22f7e3f8a8f4b02d207fbcf7f4ce5
2+
refs/heads/master: 7e6b4e4d57a9bd0dc01641b0fdcfcb68e11452c8
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/cmake/modules/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ set(SWIFT_LIBRARY_DIRS ${SWIFT_LIBRARY_OUTPUT_INTDIR})
1616
configure_file(
1717
SwiftConfig.cmake.in
1818
${swift_cmake_builddir}/SwiftConfig.cmake
19-
@ONLY)
19+
@ONLY)

trunk/cmake/modules/SwiftConfig.cmake.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ set(SWIFT_VERSION @SWIFT_VERSION@)
66
set(SWIFT_MAIN_SRC_DIR @SWIFT_SOURCE_DIR@)
77

88
set(SWIFT_INCLUDE_DIRS "@SWIFT_INCLUDE_DIRS@")
9-
set(SWIFT_LIBRARY_DIRS "@SWIFT_LIBRARY_DIRS@")
9+
set(SWIFT_LIBRARY_DIRS "@SWIFT_CONFIG_LIBRARY_DIRS@")
1010

1111
# These variables are duplicated, but they must match the LLVM variables of the
1212
# same name. The variables ending in "S" could some day become lists, and are
1313
# preserved for convention and compatibility.
1414
set(SWIFT_INCLUDE_DIR "@SWIFT_INCLUDE_DIRS@")
15-
set(SWIFT_LIBRARY_DIR "@SWIFT_LIBRARY_DIRS@")
15+
set(SWIFT_LIBRARY_DIR "@SWIFT_CONFIG_LIBRARY_DIRS@")
1616

1717
set(SWIFT_CMAKE_DIR "@SWIFT_CMAKE_DIR@")
1818
set(SWIFT_BINARY_DIR "@SWIFT_BINARY_DIR@")

trunk/include/swift/AST/Decl.h

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ class alignas(1 << DeclAlignInBits) Decl {
388388
SWIFT_INLINE_BITFIELD(SubscriptDecl, VarDecl, 2,
389389
StaticSpelling : 2
390390
);
391-
SWIFT_INLINE_BITFIELD(AbstractFunctionDecl, ValueDecl, 3+8+1+1+1+1+1+1,
391+
SWIFT_INLINE_BITFIELD(AbstractFunctionDecl, ValueDecl, 3+8+1+1+1+1+1+1+1+1,
392392
/// \see AbstractFunctionDecl::BodyKind
393393
BodyKind : 3,
394394

@@ -404,6 +404,12 @@ class alignas(1 << DeclAlignInBits) Decl {
404404
/// Whether the function body throws.
405405
Throws : 1,
406406

407+
/// Whether this function requires a new vtable entry.
408+
NeedsNewVTableEntry : 1,
409+
410+
/// Whether NeedsNewVTableEntry is valid.
411+
HasComputedNeedsNewVTableEntry : 1,
412+
407413
/// Whether this member was synthesized as part of a derived
408414
/// protocol conformance.
409415
Synthesized : 1,
@@ -3541,6 +3547,8 @@ class EnumDecl final : public NominalTypeDecl {
35413547
return SourceRange(EnumLoc, getBraces().End);
35423548
}
35433549

3550+
EnumElementDecl *getElement(Identifier Name) const;
3551+
35443552
public:
35453553
/// A range for iterating the elements of an enum.
35463554
using ElementRange = DowncastFilterRange<EnumElementDecl, DeclRange>;
@@ -5545,8 +5553,6 @@ class ImportAsMemberStatus {
55455553

55465554
/// Base class for function-like declarations.
55475555
class AbstractFunctionDecl : public GenericContext, public ValueDecl {
5548-
friend class NeedsNewVTableEntryRequest;
5549-
55505556
public:
55515557
enum class BodyKind {
55525558
/// The function did not have a body in the source code file.
@@ -5616,11 +5622,6 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
56165622
/// Location of the 'throws' token.
56175623
SourceLoc ThrowsLoc;
56185624

5619-
struct {
5620-
unsigned NeedsNewVTableEntryComputed : 1;
5621-
unsigned NeedsNewVTableEntry : 1;
5622-
} LazySemanticInfo = { };
5623-
56245625
AbstractFunctionDecl(DeclKind Kind, DeclContext *Parent, DeclName Name,
56255626
SourceLoc NameLoc, bool Throws, SourceLoc ThrowsLoc,
56265627
bool HasImplicitSelfDecl,
@@ -5632,6 +5633,8 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
56325633
Bits.AbstractFunctionDecl.HasImplicitSelfDecl = HasImplicitSelfDecl;
56335634
Bits.AbstractFunctionDecl.Overridden = false;
56345635
Bits.AbstractFunctionDecl.Throws = Throws;
5636+
Bits.AbstractFunctionDecl.NeedsNewVTableEntry = false;
5637+
Bits.AbstractFunctionDecl.HasComputedNeedsNewVTableEntry = false;
56355638
Bits.AbstractFunctionDecl.Synthesized = false;
56365639
Bits.AbstractFunctionDecl.HasSingleExpressionBody = false;
56375640
}
@@ -5801,9 +5804,16 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
58015804
return getBodyKind() == BodyKind::MemberwiseInitializer;
58025805
}
58035806

5804-
/// For a method of a class, checks whether it will require a new entry in the
5805-
/// vtable.
5806-
bool needsNewVTableEntry() const;
5807+
void setNeedsNewVTableEntry(bool value) {
5808+
Bits.AbstractFunctionDecl.HasComputedNeedsNewVTableEntry = true;
5809+
Bits.AbstractFunctionDecl.NeedsNewVTableEntry = value;
5810+
}
5811+
5812+
bool needsNewVTableEntry() const {
5813+
if (!Bits.AbstractFunctionDecl.HasComputedNeedsNewVTableEntry)
5814+
const_cast<AbstractFunctionDecl *>(this)->computeNeedsNewVTableEntry();
5815+
return Bits.AbstractFunctionDecl.NeedsNewVTableEntry;
5816+
}
58075817

58085818
bool isEffectiveLinkageMoreVisibleThan(ValueDecl *other) const {
58095819
return (std::min(getEffectiveAccess(), AccessLevel::Public) >
@@ -6353,7 +6363,13 @@ class EnumElementDecl : public DeclContext, public ValueDecl {
63536363
ParameterList *Params,
63546364
SourceLoc EqualsLoc,
63556365
LiteralExpr *RawValueExpr,
6356-
DeclContext *DC);
6366+
DeclContext *DC)
6367+
: DeclContext(DeclContextKind::EnumElementDecl, DC),
6368+
ValueDecl(DeclKind::EnumElement, DC, Name, IdentifierLoc),
6369+
Params(Params),
6370+
EqualsLoc(EqualsLoc),
6371+
RawValueExpr(RawValueExpr)
6372+
{}
63576373

63586374
Identifier getName() const { return getFullName().getBaseIdentifier(); }
63596375

@@ -6369,7 +6385,6 @@ class EnumElementDecl : public DeclContext, public ValueDecl {
63696385

63706386
Type getArgumentInterfaceType() const;
63716387

6372-
void setParameterList(ParameterList *params);
63736388
ParameterList *getParameterList() const { return Params; }
63746389

63756390
/// Retrieves a fully typechecked raw value expression associated

trunk/include/swift/AST/TypeCheckRequests.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,27 +1314,6 @@ class IsStaticRequest :
13141314
void cacheResult(bool value) const;
13151315
};
13161316

1317-
class NeedsNewVTableEntryRequest
1318-
: public SimpleRequest<NeedsNewVTableEntryRequest,
1319-
bool(AbstractFunctionDecl *),
1320-
CacheKind::SeparatelyCached> {
1321-
public:
1322-
using SimpleRequest::SimpleRequest;
1323-
1324-
private:
1325-
friend SimpleRequest;
1326-
1327-
// Evaluation.
1328-
llvm::Expected<bool> evaluate(Evaluator &evaluator,
1329-
AbstractFunctionDecl *decl) const;
1330-
1331-
public:
1332-
// Separate caching.
1333-
bool isCached() const { return true; }
1334-
Optional<bool> getCachedResult() const;
1335-
void cacheResult(bool value) const;
1336-
};
1337-
13381317
// Allow AnyValue to compare two Type values, even though Type doesn't
13391318
// support ==.
13401319
template<>

trunk/include/swift/AST/TypeCheckerTypeIDZone.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,5 +149,3 @@ SWIFT_REQUEST(TypeChecker, IsABICompatibleOverrideRequest,
149149
bool(ValueDecl *), Cached, NoLocationInfo)
150150
SWIFT_REQUEST(TypeChecker, IsStaticRequest,
151151
bool(FuncDecl *), SeparatelyCached, NoLocationInfo)
152-
SWIFT_REQUEST(TypeChecker, NeedsNewVTableEntryRequest,
153-
bool(AbstractFunctionDecl *), SeparatelyCached, NoLocationInfo)

trunk/include/swift/AST/USRGeneration.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@
99
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
12-
//
13-
// Unique Symbol References (USRs) provide a textual encoding for
14-
// declarations. These are used for indexing, analogous to how mangled names
15-
// are used in object files.
16-
//
17-
//===----------------------------------------------------------------------===//
1812

1913
#ifndef SWIFT_AST_USRGENERATION_H
2014
#define SWIFT_AST_USRGENERATION_H

trunk/include/swift/Basic/StringExtras.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "swift/Basic/LLVM.h"
2222
#include "swift/Basic/OptionSet.h"
2323
#include "llvm/ADT/SmallVector.h"
24+
#include "llvm/ADT/StringMap.h"
2425
#include "llvm/ADT/StringRef.h"
2526
#include "llvm/ADT/StringSet.h"
2627
#include "llvm/Support/Allocator.h"
@@ -64,8 +65,6 @@ namespace swift {
6465

6566
public:
6667
StringRef copyString(StringRef string);
67-
68-
llvm::BumpPtrAllocator &getAllocator() { return Allocator; }
6968
};
7069

7170
namespace camel_case {
@@ -431,13 +430,11 @@ StringRef matchLeadingTypeName(StringRef name, OmissionTypeName typeName);
431430
/// Describes a set of names with an inheritance relationship.
432431
class InheritedNameSet {
433432
const InheritedNameSet *Parent;
434-
llvm::StringSet<llvm::BumpPtrAllocator &> Names;
433+
llvm::StringSet<> Names;
435434

436435
public:
437436
/// Construct a new inherited name set with the given parent.
438-
InheritedNameSet(const InheritedNameSet *parent,
439-
llvm::BumpPtrAllocator &allocator)
440-
: Parent(parent), Names(allocator) { }
437+
explicit InheritedNameSet(const InheritedNameSet *parent) : Parent(parent) { }
441438

442439
// Add a new name to the set.
443440
void add(StringRef name);

trunk/include/swift/Parse/ASTGen.h

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ class ASTGen {
7979
//===--------------------------------------------------------------------===//
8080
// Expressions.
8181

82-
Expr *generate(const syntax::ExprSyntax &Expr, const SourceLoc Loc);
83-
Expr *generate(const syntax::IdentifierExprSyntax &Expr, const SourceLoc Loc);
84-
Expr *generate(const syntax::EditorPlaceholderExprSyntax &Expr,
85-
const SourceLoc Loc);
86-
Expr *generate(const syntax::SpecializeExprSyntax &Expr, const SourceLoc Loc);
8782
Expr *generate(const syntax::IntegerLiteralExprSyntax &Expr,
8883
const SourceLoc Loc);
8984
Expr *generate(const syntax::FloatLiteralExprSyntax &Expr,
@@ -101,13 +96,7 @@ class ASTGen {
10196
const SourceLoc Loc);
10297
Expr *generate(const syntax::UnknownExprSyntax &Expr, const SourceLoc Loc);
10398

104-
std::pair<DeclName, DeclNameLoc> generateUnqualifiedDeclName(
105-
const syntax::TokenSyntax &idTok,
106-
const Optional<syntax::DeclNameArgumentsSyntax> &args,
107-
const SourceLoc Loc);
108-
10999
private:
110-
111100
Expr *generateMagicIdentifierLiteralExpression(
112101
const syntax::TokenSyntax &PoundToken, const SourceLoc Loc);
113102

@@ -179,9 +168,10 @@ class ASTGen {
179168
//===--------------------------------------------------------------------===//
180169
// Generics.
181170

182-
void generate(const syntax::GenericArgumentClauseSyntax &Arg,
183-
const SourceLoc Loc, SourceLoc &lAngleLoc, SourceLoc &rAngleLoc,
184-
SmallVectorImpl<TypeRepr *> &args);
171+
TypeRepr *generate(const syntax::GenericArgumentSyntax &Arg,
172+
const SourceLoc Loc);
173+
llvm::SmallVector<TypeRepr *, 4>
174+
generate(const syntax::GenericArgumentListSyntax &Args, const SourceLoc Loc);
185175

186176
GenericParamList *
187177
generate(const syntax::GenericParameterClauseListSyntax &clause,

trunk/include/swift/Parse/Parser.h

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,8 +1480,6 @@ class Parser {
14801480
/// _)
14811481
/// \param loc The location of the label (empty if it doesn't exist)
14821482
void parseOptionalArgumentLabel(Identifier &name, SourceLoc &loc);
1483-
bool parseOptionalArgumentLabelSyntax(Optional<ParsedTokenSyntax> &name,
1484-
Optional<ParsedTokenSyntax> &colon);
14851483

14861484
/// Parse an unqualified-decl-name.
14871485
///
@@ -1500,20 +1498,10 @@ class Parser {
15001498
bool allowOperators=false,
15011499
bool allowZeroArgCompoundNames=false,
15021500
bool allowDeinitAndSubscript=false);
1503-
ParserStatus
1504-
parseUnqualifiedDeclNameSyntax(Optional<ParsedTokenSyntax> &identTok,
1505-
Optional<ParsedDeclNameArgumentsSyntax> &declNameArg,
1506-
bool afterDot, const Diagnostic &diag,
1507-
bool allowOperators=false,
1508-
bool allowZeroArgCompoundNames=false,
1509-
bool allowDeinitAndSubscript=false);
1510-
1511-
ParsedSyntaxResult<ParsedExprSyntax> parseExprIdentifierSyntax();
1512-
ParsedSyntaxResult<ParsedExprSyntax>
1513-
parseExprSpecializeSyntax(ParsedExprSyntax &&);
15141501

15151502
Expr *parseExprIdentifier();
1516-
Expr *parseExprEditorPlaceholder(SourceLoc loc, StringRef text);
1503+
Expr *parseExprEditorPlaceholder(Token PlaceholderTok,
1504+
Identifier PlaceholderId);
15171505

15181506
/// Parse a closure expression after the opening brace.
15191507
///

trunk/include/swift/SIL/SILConstants.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ class SymbolicValue {
556556
void dump() const;
557557
};
558558

559-
static_assert(sizeof(SymbolicValue) == 2 * sizeof(uint64_t),
559+
static_assert(sizeof(SymbolicValue) == 2 * sizeof(void *),
560560
"SymbolicValue should stay small");
561561
static_assert(std::is_pod<SymbolicValue>::value,
562562
"SymbolicValue should stay POD");

trunk/lib/AST/ASTMangler.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2372,9 +2372,13 @@ CanType ASTMangler::getDeclTypeForMangling(
23722372
}
23732373

23742374

2375-
auto canTy = decl->getInterfaceType()
2376-
->getReferenceStorageReferent()
2377-
->getCanonicalType();
2375+
Type type = decl->getInterfaceType()
2376+
->getReferenceStorageReferent();
2377+
if (type->hasArchetype()) {
2378+
assert(isa<ParamDecl>(decl) && "Only ParamDecl's still have archetypes");
2379+
type = type->mapTypeOutOfContext();
2380+
}
2381+
CanType canTy = type->getCanonicalType();
23782382

23792383
if (auto gft = dyn_cast<GenericFunctionType>(canTy)) {
23802384
genericSig = gft.getGenericSignature();

0 commit comments

Comments
 (0)