Skip to content

Commit b0a8c9d

Browse files
committed
---
yaml --- r: 348958 b: refs/heads/master c: e9dfdea h: refs/heads/master
1 parent 3c9a059 commit b0a8c9d

File tree

95 files changed

+2058
-1454
lines changed

Some content is hidden

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

95 files changed

+2058
-1454
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: 54ec600c11e3252011faa3ad5932b55e41372c83
2+
refs/heads/master: e9dfdea6fdd3dc75dd5533795a894986100e0a79
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/.gitattributes

Lines changed: 0 additions & 2 deletions
This file was deleted.

trunk/cmake/modules/SwiftSource.cmake

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,6 @@ function(_compile_swift_files
333333
"-emit-module-interface-path" "${interface_file}")
334334
endif()
335335

336-
if (NOT SWIFTFILE_IS_STDLIB_CORE)
337-
list(APPEND swift_module_flags
338-
"-Xfrontend" "-experimental-skip-non-inlinable-function-bodies")
339-
endif()
340-
341336
# If we have extra regexp flags, check if we match any of the regexps. If so
342337
# add the relevant flags to our swift_flags.
343338
if (SWIFT_EXPERIMENTAL_EXTRA_REGEXP_FLAGS OR SWIFT_EXPERIMENTAL_EXTRA_NEGATIVE_REGEXP_FLAGS)

trunk/include/swift/AST/Attr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,7 @@ class DeclAttributes {
16721672
public:
16731673
template <typename ATTR, bool AllowInvalid>
16741674
using AttributeKindRange =
1675-
OptionalTransformRange<iterator_range<const_iterator>,
1675+
OptionalTransformRange<llvm::iterator_range<const_iterator>,
16761676
ToAttributeKind<ATTR, AllowInvalid>,
16771677
const_iterator>;
16781678

trunk/include/swift/AST/DeclContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ class DeclIterator {
667667

668668
/// The range of declarations stored within an iterable declaration
669669
/// context.
670-
using DeclRange = iterator_range<DeclIterator>;
670+
typedef IteratorRange<DeclIterator> DeclRange;
671671

672672
/// The kind of an \c IterableDeclContext.
673673
enum class IterableDeclContextKind : uint8_t {

trunk/include/swift/AST/DiagnosticsParse.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -970,8 +970,6 @@ ERROR(expected_expr_throw,PointsToFirstBadToken,
970970
// Yield Statment
971971
ERROR(expected_expr_yield,PointsToFirstBadToken,
972972
"expected expression in 'yield' statement", ())
973-
ERROR(unexpected_arg_label_yield,none,
974-
"unexpected argument label in 'yield' statement", ())
975973

976974
// Defer Statement
977975
ERROR(expected_lbrace_after_defer,PointsToFirstBadToken,

trunk/include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3493,8 +3493,6 @@ ERROR(single_tuple_parameter_mismatch_special,none,
34933493
ERROR(single_tuple_parameter_mismatch_normal,none,
34943494
"%0 %1 expects a single parameter of type %2%3",
34953495
(DescriptiveDeclKind, DeclBaseName, Type, StringRef))
3496-
NOTE(note_maybe_forgot_to_form_tuple,none,
3497-
"did you mean to pass a tuple?", ())
34983496
ERROR(unknown_single_tuple_parameter_mismatch,none,
34993497
"single parameter of type %0 is expected in call", (Type))
35003498
ERROR(cannot_convert_single_tuple_into_multiple_arguments,none,

trunk/include/swift/AST/FileUnit.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ class FileUnit : public DeclContext {
131131
return None;
132132
}
133133

134+
virtual Optional<BasicDeclLocs> getBasicLocsForDecl(const Decl *D) const {
135+
return None;
136+
}
137+
134138
virtual void collectAllGroups(std::vector<StringRef> &Names) const {}
135139

136140
/// Returns an implementation-defined "discriminator" for \p D, which

trunk/include/swift/AST/RawComment.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,19 @@ struct CommentInfo {
7878
uint32_t SourceOrder;
7979
};
8080

81+
struct LineColumn {
82+
uint32_t Line;
83+
uint32_t Column;
84+
};
85+
86+
struct BasicDeclLocs {
87+
StringRef SourceFilePath;
88+
Optional<LineColumn> Loc;
89+
Optional<LineColumn> NameLoc;
90+
Optional<LineColumn> StartLoc;
91+
Optional<LineColumn> EndLoc;
92+
};
93+
8194
} // namespace swift
8295

8396
#endif // LLVM_SWIFT_AST_RAW_COMMENT_H

trunk/include/swift/AST/TypeRepr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ struct TupleTypeReprElement {
653653
TypeRepr *Type;
654654
SourceLoc TrailingCommaLoc;
655655

656-
TupleTypeReprElement(): Type(nullptr) {}
656+
TupleTypeReprElement() {}
657657
TupleTypeReprElement(TypeRepr *Type): Type(Type) {}
658658
};
659659

trunk/include/swift/AST/Types.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3965,11 +3965,13 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
39653965
};
39663966
using IndirectFormalResultIter =
39673967
llvm::filter_iterator<const SILResultInfo *, IndirectFormalResultFilter>;
3968-
using IndirectFormalResultRange = iterator_range<IndirectFormalResultIter>;
3968+
using IndirectFormalResultRange = IteratorRange<IndirectFormalResultIter>;
39693969

39703970
/// A range of SILResultInfo for all formally indirect results.
39713971
IndirectFormalResultRange getIndirectFormalResults() const {
3972-
return llvm::make_filter_range(getResults(), IndirectFormalResultFilter());
3972+
auto filter =
3973+
llvm::make_filter_range(getResults(), IndirectFormalResultFilter());
3974+
return makeIteratorRange(filter.begin(), filter.end());
39733975
}
39743976

39753977
struct DirectFormalResultFilter {
@@ -3979,11 +3981,13 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
39793981
};
39803982
using DirectFormalResultIter =
39813983
llvm::filter_iterator<const SILResultInfo *, DirectFormalResultFilter>;
3982-
using DirectFormalResultRange = iterator_range<DirectFormalResultIter>;
3984+
using DirectFormalResultRange = IteratorRange<DirectFormalResultIter>;
39833985

39843986
/// A range of SILResultInfo for all formally direct results.
39853987
DirectFormalResultRange getDirectFormalResults() const {
3986-
return llvm::make_filter_range(getResults(), DirectFormalResultFilter());
3988+
auto filter =
3989+
llvm::make_filter_range(getResults(), DirectFormalResultFilter());
3990+
return makeIteratorRange(filter.begin(), filter.end());
39873991
}
39883992

39893993
/// Get a single non-address SILType that represents all formal direct

trunk/include/swift/AST/USRGeneration.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "swift/Basic/LLVM.h"
2323

2424
namespace swift {
25+
class Decl;
2526
class AbstractStorageDecl;
2627
class ValueDecl;
2728
class ExtensionDecl;
@@ -56,6 +57,10 @@ bool printAccessorUSR(const AbstractStorageDecl *D, AccessorKind AccKind,
5657
/// \returns true if it failed, false on success.
5758
bool printExtensionUSR(const ExtensionDecl *ED, raw_ostream &OS);
5859

60+
/// Prints out the Decl USRs suitable for keys .swiftdoc and .swiftsourceinfo files.
61+
/// \returns true if it failed, false on success.
62+
bool printDeclUSRForModuleDoc(const Decl *D, raw_ostream &OS);
63+
5964
} // namespace ide
6065
} // namespace swift
6166

trunk/include/swift/Basic/BlotSetVector.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ class BlotSetVector {
6767

6868
ArrayRef<Optional<ValueT>> getArray() const { return vector; }
6969

70-
iterator_range<const_iterator> getRange() const {
70+
llvm::iterator_range<const_iterator> getRange() const {
7171
return {begin(), end()};
7272
}
7373

7474
using const_reverse_iterator = typename VectorT::const_reverse_iterator;
7575
const_reverse_iterator rbegin() const { return vector.rbegin(); }
7676
const_reverse_iterator rend() const { return vector.rend(); }
77-
iterator_range<const_reverse_iterator> getReverseRange() const {
77+
llvm::iterator_range<const_reverse_iterator> getReverseRange() const {
7878
return {rbegin(), rend()};
7979
}
8080

trunk/include/swift/Basic/LLVM.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ namespace llvm {
4343
template<typename T> class TinyPtrVector;
4444
template<typename T> class Optional;
4545
template <typename ...PTs> class PointerUnion;
46-
template <typename IteratorT> class iterator_range;
4746
class SmallBitVector;
4847

4948
// Other common classes.
@@ -64,7 +63,6 @@ namespace swift {
6463

6564
// Containers.
6665
using llvm::ArrayRef;
67-
using llvm::iterator_range;
6866
using llvm::MutableArrayRef;
6967
using llvm::None;
7068
using llvm::Optional;

trunk/include/swift/Basic/Range.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444

4545
namespace swift {
4646
using llvm::make_range;
47+
using llvm::iterator_range;
4748

4849
template<typename T>
4950
inline auto reversed(T &&container)

trunk/include/swift/Basic/STLExtras.h

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,37 @@ inline Iterator prev_or_begin(Iterator it, Iterator begin) {
251251

252252
/// @}
253253

254+
/// A range of iterators.
255+
/// TODO: Add `llvm::iterator_range::empty()`, then remove this helper, along
256+
/// with the superfluous TransformIterator.
257+
template<typename Iterator>
258+
class IteratorRange {
259+
Iterator First, Last;
260+
261+
public:
262+
using iterator = Iterator;
263+
264+
IteratorRange(Iterator first, Iterator last) : First(first), Last(last) { }
265+
iterator begin() const { return First; }
266+
iterator end() const { return Last; }
267+
bool empty() const { return First == Last; }
268+
269+
typename std::iterator_traits<iterator>::value_type front() const {
270+
assert(!empty() && "Front of empty range");
271+
return *begin();
272+
}
273+
};
274+
275+
/// Create a new iterator range.
276+
template<typename Iterator>
277+
inline IteratorRange<Iterator>
278+
makeIteratorRange(Iterator first, Iterator last) {
279+
return IteratorRange<Iterator>(first, last);
280+
}
254281

255282
/// An iterator that transforms the result of an underlying bidirectional
256283
/// iterator with a given operation.
257284
///
258-
/// Slightly different semantics from llvm::map_iterator, but we should
259-
/// probably figure out how to merge them eventually.
260-
///
261285
/// \tparam Iterator the underlying iterator.
262286
///
263287
/// \tparam Operation A function object that transforms the underlying

trunk/include/swift/Frontend/Frontend.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ class CompilerInstance {
395395
struct PartialModuleInputs {
396396
std::unique_ptr<llvm::MemoryBuffer> ModuleBuffer;
397397
std::unique_ptr<llvm::MemoryBuffer> ModuleDocBuffer;
398+
std::unique_ptr<llvm::MemoryBuffer> ModuleSourceInfoBuffer;
398399
};
399400

400401
/// Contains \c MemoryBuffers for partial serialized module files and
@@ -555,20 +556,29 @@ class CompilerInstance {
555556

556557
Optional<unsigned> getRecordedBufferID(const InputFile &input, bool &failed);
557558

559+
struct ModuleBuffers {
560+
std::unique_ptr<llvm::MemoryBuffer> ModuleBuffer;
561+
std::unique_ptr<llvm::MemoryBuffer> ModuleDocBuffer;
562+
std::unique_ptr<llvm::MemoryBuffer> ModuleSourceInfoBuffer;
563+
};
564+
558565
/// Given an input file, return a buffer to use for its contents,
559566
/// and a buffer for the corresponding module doc file if one exists.
560567
/// On failure, return a null pointer for the first element of the returned
561568
/// pair.
562-
std::pair<std::unique_ptr<llvm::MemoryBuffer>,
563-
std::unique_ptr<llvm::MemoryBuffer>>
564-
getInputBufferAndModuleDocBufferIfPresent(const InputFile &input);
569+
ModuleBuffers getInputBuffersIfPresent(const InputFile &input);
565570

566571
/// Try to open the module doc file corresponding to the input parameter.
567572
/// Return None for error, nullptr if no such file exists, or the buffer if
568573
/// one was found.
569574
Optional<std::unique_ptr<llvm::MemoryBuffer>>
570575
openModuleDoc(const InputFile &input);
571576

577+
/// Try to open the module source info file corresponding to the input parameter.
578+
/// Return None for error, nullptr if no such file exists, or the buffer if
579+
/// one was found.
580+
Optional<std::unique_ptr<llvm::MemoryBuffer>>
581+
openModuleSourceInfo(const InputFile &input);
572582
public:
573583
/// Parses and type-checks all input files.
574584
void performSema();

trunk/include/swift/Frontend/ModuleInterfaceLoader.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,10 @@ class ModuleInterfaceLoader : public SerializedModuleLoaderBase {
149149
std::error_code findModuleFilesInDirectory(
150150
AccessPathElem ModuleID, StringRef DirPath, StringRef ModuleFilename,
151151
StringRef ModuleDocFilename,
152+
StringRef ModuleSourceInfoFilename,
152153
std::unique_ptr<llvm::MemoryBuffer> *ModuleBuffer,
153-
std::unique_ptr<llvm::MemoryBuffer> *ModuleDocBuffer) override;
154+
std::unique_ptr<llvm::MemoryBuffer> *ModuleDocBuffer,
155+
std::unique_ptr<llvm::MemoryBuffer> *ModuleSourceInfoBuffer) override;
154156

155157
bool isCached(StringRef DepPath) override;
156158

trunk/include/swift/Parse/ASTGen.h

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ class ASTGen {
3737

3838
// FIXME: remove when Syntax can represent all types and ASTGen can handle
3939
// them
40-
/// Exprs that cannot be represented by Syntax or generated by ASTGen.
41-
llvm::DenseMap<SourceLoc, Expr *> Exprs;
42-
4340
/// Decl attributes that cannot be represented by Syntax or generated by
4441
/// ASTGen.
4542
llvm::DenseMap<SourceLoc, DeclAttributes> ParsedDeclAttrs;
@@ -84,10 +81,6 @@ class ASTGen {
8481

8582
Expr *generate(const syntax::ExprSyntax &Expr, const SourceLoc Loc);
8683
Expr *generate(const syntax::IdentifierExprSyntax &Expr, const SourceLoc Loc);
87-
Expr *generate(const syntax::SuperRefExprSyntax &Expr, const SourceLoc Loc);
88-
Expr *generate(const syntax::ArrayExprSyntax &Expr, const SourceLoc Loc);
89-
Expr *generate(const syntax::DictionaryExprSyntax &Expr, const SourceLoc Loc);
90-
Expr *generate(const syntax::TupleExprSyntax &E, const SourceLoc Loc);
9184
Expr *generate(const syntax::EditorPlaceholderExprSyntax &Expr,
9285
const SourceLoc Loc);
9386
Expr *generate(const syntax::SpecializeExprSyntax &Expr, const SourceLoc Loc);
@@ -113,14 +106,7 @@ class ASTGen {
113106
const Optional<syntax::DeclNameArgumentsSyntax> &args,
114107
const SourceLoc Loc);
115108

116-
void generateExprTupleElementList(const syntax::TupleExprElementListSyntax &elements,
117-
const SourceLoc Loc, bool isForCallArguments,
118-
SmallVectorImpl<Expr *> &exprs,
119-
SmallVectorImpl<Identifier> &exprLabels,
120-
SmallVectorImpl<SourceLoc> &exprLabelLocs);
121-
122109
private:
123-
void validateCollectionElement(Expr *elementExpr);
124110

125111
Expr *generateMagicIdentifierLiteralExpression(
126112
const syntax::TokenSyntax &PoundToken, const SourceLoc Loc);
@@ -224,13 +210,6 @@ class ASTGen {
224210
static SourceLoc advanceLocBegin(const SourceLoc &Loc,
225211
const syntax::Syntax &Node);
226212

227-
/// Advance \p Loc to the last non-missing token of the \p Node or, if it
228-
/// doesn't contain any, the last non-missing token preceding it in the tree.
229-
/// \p Loc must be the leading trivia of the first token in the tree in which
230-
/// \p Node resides
231-
static SourceLoc advanceLocEnd(const SourceLoc &Loc,
232-
const syntax::Syntax &Node);
233-
234213
ValueDecl *lookupInScope(DeclName Name);
235214

236215
void addToScope(ValueDecl *D, bool diagnoseRedefinitions = true);
@@ -240,13 +219,9 @@ class ASTGen {
240219
TypeRepr *lookupType(syntax::TypeSyntax Type);
241220

242221
public:
243-
void addExpr(Expr *Expr, const SourceLoc Loc);
244-
bool hasExpr(const SourceLoc Loc) const;
245-
Expr *takeExpr(const SourceLoc Loc);
246-
247222
void addDeclAttributes(DeclAttributes attrs, const SourceLoc Loc);
248223
bool hasDeclAttributes(SourceLoc Loc) const;
249-
DeclAttributes takeDeclAttributes(const SourceLoc Loc);
224+
DeclAttributes getDeclAttributes(const SourceLoc Loc) const;
250225
};
251226
} // namespace swift
252227

0 commit comments

Comments
 (0)