Skip to content

Commit 0abb008

Browse files
committed
---
yaml --- r: 349167 b: refs/heads/master-next c: 59a57ed h: refs/heads/master i: 349165: 38d8713 349163: 8221546 349159: 11743b5 349151: 6cb0da7
1 parent 339f1c3 commit 0abb008

File tree

321 files changed

+2243
-2524
lines changed

Some content is hidden

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

321 files changed

+2243
-2524
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: cef5eeb03947b68b5937744bbd626d46e250c54d
3+
refs/heads/master-next: 59a57ed0449f1b21f451cbfd1f98b27351a1b313
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/cmake/modules/SwiftXcodeSupport.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ macro(swift_common_xcode_cxx_config)
100100
# Force usage of Clang.
101101
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0"
102102
CACHE STRING "Xcode Compiler")
103-
# Use C++'14.
104-
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14"
103+
# Use C++'11.
104+
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11"
105105
CACHE STRING "Xcode C++ Language Standard")
106106
# Use libc++.
107107
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++"

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ namespace swift {
3636
enum class DeclKind : uint8_t;
3737
enum class StmtKind;
3838

39-
struct ASTNode : public llvm::PointerUnion<Expr*, Stmt*, Decl*> {
39+
struct ASTNode : public llvm::PointerUnion3<Expr*, Stmt*, Decl*> {
4040
// Inherit the constructors from PointerUnion.
41-
using PointerUnion::PointerUnion;
42-
41+
using PointerUnion3::PointerUnion3;
42+
4343
SourceRange getSourceRange() const;
4444

4545
/// Return the location of the start of the statement.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4785,7 +4785,7 @@ class VarDecl : public AbstractStorageDecl {
47854785
};
47864786

47874787
protected:
4788-
PointerUnion<PatternBindingDecl *, Stmt *, VarDecl *> Parent;
4788+
PointerUnion3<PatternBindingDecl *, Stmt *, VarDecl *> Parent;
47894789

47904790
VarDecl(DeclKind kind, bool isStatic, Introducer introducer,
47914791
bool issCaptureList, SourceLoc nameLoc, Identifier name,

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ WARNING(implicit_bridging_header_imported_from_module,none,
9191
"is deprecated and will be removed in a later version of Swift",
9292
(StringRef, Identifier))
9393

94+
WARNING(clang_vfs_overlay_is_ignored,none,
95+
"ignoring '-ivfsoverlay' options provided to '-Xcc' in favor of "
96+
"'-vfsoverlay'", ())
97+
9498
#ifndef DIAG_NO_UNDEF
9599
# if defined(DIAG)
96100
# undef DIAG

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ class Evaluator {
260260
// Check for a cycle.
261261
if (checkDependency(getCanonicalRequest(request))) {
262262
return llvm::Error(
263-
std::make_unique<CyclicalRequestError<Request>>(request, *this));
263+
llvm::make_unique<CyclicalRequestError<Request>>(request, *this));
264264
}
265265

266266
// Make sure we remove this from the set of active requests once we're

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ class GenericSignatureBuilder {
9292
class ResolvedType;
9393

9494
using UnresolvedRequirementRHS =
95-
llvm::PointerUnion<Type, PotentialArchetype *, LayoutConstraint>;
95+
llvm::PointerUnion3<Type, PotentialArchetype *, LayoutConstraint>;
9696

9797
using RequirementRHS =
98-
llvm::PointerUnion<Type, PotentialArchetype *, LayoutConstraint>;
98+
llvm::PointerUnion3<Type, PotentialArchetype *, LayoutConstraint>;
9999

100100
/// The location of a requirement as written somewhere in the source.
101101
typedef llvm::PointerUnion<const TypeRepr *, const RequirementRepr *>
@@ -1373,8 +1373,8 @@ class GenericSignatureBuilder::FloatingRequirementSource {
13731373
} kind;
13741374

13751375
using Storage =
1376-
llvm::PointerUnion<const RequirementSource *, const TypeRepr *,
1377-
const RequirementRepr *>;
1376+
llvm::PointerUnion3<const RequirementSource *, const TypeRepr *,
1377+
const RequirementRepr *>;
13781378

13791379
Storage storage;
13801380

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424
#include "llvm/ADT/SmallSet.h"
2525
#include "llvm/ADT/TinyPtrVector.h"
2626

27-
namespace llvm {
28-
class FileCollector;
29-
}
30-
3127
namespace clang {
3228
class DependencyCollector;
3329
}
@@ -58,9 +54,8 @@ enum class Bridgeability : unsigned {
5854
class DependencyTracker {
5955
std::shared_ptr<clang::DependencyCollector> clangCollector;
6056
public:
61-
explicit DependencyTracker(
62-
bool TrackSystemDeps,
63-
std::shared_ptr<llvm::FileCollector> FileCollector = {});
57+
58+
explicit DependencyTracker(bool TrackSystemDeps);
6459

6560
/// Adds a file as a dependency.
6661
///

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class SimpleRequest<Derived, Output(Inputs...), Caching> {
195195

196196
template<size_t ...Indices>
197197
llvm::Expected<Output>
198-
callDerived(Evaluator &evaluator, std::index_sequence<Indices...>) const {
198+
callDerived(Evaluator &evaluator, llvm::index_sequence<Indices...>) const {
199199
static_assert(sizeof...(Indices) > 0, "Subclass must define evaluate()");
200200
return asDerived().evaluate(evaluator, std::get<Indices>(storage)...);
201201
}
@@ -217,7 +217,7 @@ class SimpleRequest<Derived, Output(Inputs...), Caching> {
217217
static llvm::Expected<OutputType>
218218
evaluateRequest(const Derived &request, Evaluator &evaluator) {
219219
return request.callDerived(evaluator,
220-
std::index_sequence_for<Inputs...>());
220+
llvm::index_sequence_for<Inputs...>());
221221
}
222222

223223
/// Retrieve the nearest source location to which this request applies.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ struct WhereClauseOwner {
366366

367367
/// The source of the where clause, which can be a generic parameter list
368368
/// or a declaration that can have a where clause.
369-
llvm::PointerUnion<GenericParamList *, Decl *, SpecializeAttr *> source;
369+
llvm::PointerUnion3<GenericParamList *, Decl *, SpecializeAttr *> source;
370370

371371
WhereClauseOwner(Decl *decl);
372372

branches/master-next/include/swift/Basic/LLVM.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ namespace llvm {
4242
template<typename T> class MutableArrayRef;
4343
template<typename T> class TinyPtrVector;
4444
template<typename T> class Optional;
45-
template <typename ...PTs> class PointerUnion;
45+
template <typename PT1, typename PT2> class PointerUnion;
46+
template <typename PT1, typename PT2, typename PT3> class PointerUnion3;
4647
class SmallBitVector;
4748

4849
// Other common classes.
@@ -67,6 +68,7 @@ namespace swift {
6768
using llvm::None;
6869
using llvm::Optional;
6970
using llvm::PointerUnion;
71+
using llvm::PointerUnion3;
7072
using llvm::SmallBitVector;
7173
using llvm::SmallPtrSet;
7274
using llvm::SmallPtrSetImpl;

branches/master-next/include/swift/ClangImporter/ClangImporter.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
namespace llvm {
2525
class Triple;
26-
class FileCollector;
2726
template<typename Fn> class function_ref;
2827
}
2928

@@ -150,8 +149,7 @@ class ClangImporter final : public ClangModuleLoader {
150149
/// Create a new clang::DependencyCollector customized to
151150
/// ClangImporter's specific uses.
152151
static std::shared_ptr<clang::DependencyCollector>
153-
createDependencyCollector(bool TrackSystemDeps,
154-
std::shared_ptr<llvm::FileCollector> FileCollector);
152+
createDependencyCollector(bool TrackSystemDeps);
155153

156154
/// Append visible module names to \p names. Note that names are possibly
157155
/// duplicated, and not guaranteed to be ordered in any way.

branches/master-next/include/swift/ClangImporter/ClangImporterOptions.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ class ClangImporterOptions {
9696
/// When set, don't enforce warnings with -Werror.
9797
bool DebuggerSupport = false;
9898

99+
/// When set, clobber the Clang instance's virtual file system with the Swift
100+
/// virtual file system.
101+
bool ForceUseSwiftVirtualFileSystem = false;
102+
99103
/// Return a hash code of any components from these options that should
100104
/// contribute to a Swift Bridging PCH hash.
101105
llvm::hash_code getPCHHashComponents() const {

branches/master-next/include/swift/Frontend/Frontend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ class CompilerInstance {
462462

463463
void createDependencyTracker(bool TrackSystemDeps) {
464464
assert(!Context && "must be called before setup()");
465-
DepTracker = std::make_unique<DependencyTracker>(TrackSystemDeps);
465+
DepTracker = llvm::make_unique<DependencyTracker>(TrackSystemDeps);
466466
}
467467
DependencyTracker *getDependencyTracker() { return DepTracker.get(); }
468468

branches/master-next/include/swift/LLVMPasses/Passes.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,8 @@ namespace swift {
3030
const llvm::PreservedAnalyses &) { return false; }
3131

3232
using AAResultBase::getModRefInfo;
33-
llvm::ModRefInfo getModRefInfo(const llvm::CallBase *Call,
34-
const llvm::MemoryLocation &Loc) {
35-
llvm::AAQueryInfo AAQI;
36-
return getModRefInfo(Call, Loc, AAQI);
37-
}
38-
llvm::ModRefInfo getModRefInfo(const llvm::CallBase *Call,
39-
const llvm::MemoryLocation &Loc,
40-
llvm::AAQueryInfo &AAQI);
33+
llvm::ModRefInfo getModRefInfo(llvm::ImmutableCallSite CS,
34+
const llvm::MemoryLocation &Loc);
4135
};
4236

4337
class SwiftAAWrapperPass : public llvm::ImmutablePass {

branches/master-next/include/swift/Parse/Parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
#include "llvm/ADT/SetVector.h"
4141

4242
namespace llvm {
43-
template <typename... PTs> class PointerUnion;
43+
template <typename PT1, typename PT2, typename PT3> class PointerUnion3;
4444
}
4545

4646
namespace swift {

branches/master-next/include/swift/SIL/OwnershipUtils.h

Lines changed: 88 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,76 @@ bool isOwnershipForwardingInst(SILInstruction *i);
200200

201201
bool isGuaranteedForwardingInst(SILInstruction *i);
202202

203-
struct BorrowScopeIntroducerKind {
203+
struct BorrowScopeOperandKind {
204+
using UnderlyingKindTy = std::underlying_type<SILInstructionKind>::type;
205+
206+
enum Kind : UnderlyingKindTy {
207+
BeginBorrow = UnderlyingKindTy(SILInstructionKind::BeginBorrowInst),
208+
};
209+
210+
Kind value;
211+
212+
BorrowScopeOperandKind(Kind newValue) : value(newValue) {}
213+
BorrowScopeOperandKind(const BorrowScopeOperandKind &other)
214+
: value(other.value) {}
215+
operator Kind() const { return value; }
216+
217+
static Optional<BorrowScopeOperandKind> get(SILInstructionKind kind) {
218+
switch (kind) {
219+
default:
220+
return None;
221+
case SILInstructionKind::BeginBorrowInst:
222+
return BorrowScopeOperandKind(BeginBorrow);
223+
}
224+
}
225+
226+
void print(llvm::raw_ostream &os) const;
227+
LLVM_ATTRIBUTE_DEPRECATED(void dump() const, "only for use in the debugger");
228+
};
229+
230+
/// An operand whose user instruction introduces a new borrow scope for the
231+
/// operand's value. The value of the operand must be considered as implicitly
232+
/// borrowed until the user's corresponding end scope instruction.
233+
struct BorrowScopeOperand {
234+
BorrowScopeOperandKind kind;
235+
Operand *op;
236+
237+
BorrowScopeOperand(Operand *op)
238+
: kind(*BorrowScopeOperandKind::get(op->getUser()->getKind())), op(op) {}
239+
240+
/// If value is a borrow introducer return it after doing some checks.
241+
static Optional<BorrowScopeOperand> get(Operand *op) {
242+
auto *user = op->getUser();
243+
auto kind = BorrowScopeOperandKind::get(user->getKind());
244+
if (!kind)
245+
return None;
246+
return BorrowScopeOperand(*kind, op);
247+
}
248+
249+
void visitEndScopeInstructions(function_ref<void(Operand *)> func) const {
250+
switch (kind) {
251+
case BorrowScopeOperandKind::BeginBorrow:
252+
for (auto *use : cast<BeginBorrowInst>(op->getUser())->getUses()) {
253+
if (isa<EndBorrowInst>(use->getUser())) {
254+
func(use);
255+
}
256+
}
257+
return;
258+
}
259+
llvm_unreachable("Covered switch isn't covered");
260+
}
261+
262+
private:
263+
/// Internal constructor for failable static constructor. Please do not expand
264+
/// its usage since it assumes the code passed in is well formed.
265+
BorrowScopeOperand(BorrowScopeOperandKind kind, Operand *op)
266+
: kind(kind), op(op) {}
267+
};
268+
269+
llvm::raw_ostream &operator<<(llvm::raw_ostream &os,
270+
BorrowScopeOperandKind kind);
271+
272+
struct BorrowScopeIntroducingValueKind {
204273
using UnderlyingKindTy = std::underlying_type<ValueKind>::type;
205274

206275
/// Enum we use for exhaustive pattern matching over borrow scope introducers.
@@ -210,23 +279,23 @@ struct BorrowScopeIntroducerKind {
210279
SILFunctionArgument = UnderlyingKindTy(ValueKind::SILFunctionArgument),
211280
};
212281

213-
static Optional<BorrowScopeIntroducerKind> get(ValueKind kind) {
282+
static Optional<BorrowScopeIntroducingValueKind> get(ValueKind kind) {
214283
switch (kind) {
215284
default:
216285
return None;
217286
case ValueKind::LoadBorrowInst:
218-
return BorrowScopeIntroducerKind(LoadBorrow);
287+
return BorrowScopeIntroducingValueKind(LoadBorrow);
219288
case ValueKind::BeginBorrowInst:
220-
return BorrowScopeIntroducerKind(BeginBorrow);
289+
return BorrowScopeIntroducingValueKind(BeginBorrow);
221290
case ValueKind::SILFunctionArgument:
222-
return BorrowScopeIntroducerKind(SILFunctionArgument);
291+
return BorrowScopeIntroducingValueKind(SILFunctionArgument);
223292
}
224293
}
225294

226295
Kind value;
227296

228-
BorrowScopeIntroducerKind(Kind newValue) : value(newValue) {}
229-
BorrowScopeIntroducerKind(const BorrowScopeIntroducerKind &other)
297+
BorrowScopeIntroducingValueKind(Kind newValue) : value(newValue) {}
298+
BorrowScopeIntroducingValueKind(const BorrowScopeIntroducingValueKind &other)
230299
: value(other.value) {}
231300
operator Kind() const { return value; }
232301

@@ -238,10 +307,10 @@ struct BorrowScopeIntroducerKind {
238307
/// of the scope.
239308
bool isLocalScope() const {
240309
switch (value) {
241-
case BorrowScopeIntroducerKind::BeginBorrow:
242-
case BorrowScopeIntroducerKind::LoadBorrow:
310+
case BorrowScopeIntroducingValueKind::BeginBorrow:
311+
case BorrowScopeIntroducingValueKind::LoadBorrow:
243312
return true;
244-
case BorrowScopeIntroducerKind::SILFunctionArgument:
313+
case BorrowScopeIntroducingValueKind::SILFunctionArgument:
245314
return false;
246315
}
247316
llvm_unreachable("Covered switch isnt covered?!");
@@ -252,7 +321,7 @@ struct BorrowScopeIntroducerKind {
252321
};
253322

254323
llvm::raw_ostream &operator<<(llvm::raw_ostream &os,
255-
BorrowScopeIntroducerKind kind);
324+
BorrowScopeIntroducingValueKind kind);
256325

257326
/// A higher level construct for working with values that represent the
258327
/// introduction of a new borrow scope.
@@ -271,26 +340,26 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &os,
271340
/// borrow introducers can not have guaranteed results that are not creating a
272341
/// new borrow scope. No such instructions exist today.
273342
struct BorrowScopeIntroducingValue {
274-
BorrowScopeIntroducerKind kind;
343+
BorrowScopeIntroducingValueKind kind;
275344
SILValue value;
276345

277346
BorrowScopeIntroducingValue(LoadBorrowInst *lbi)
278-
: kind(BorrowScopeIntroducerKind::LoadBorrow), value(lbi) {}
347+
: kind(BorrowScopeIntroducingValueKind::LoadBorrow), value(lbi) {}
279348
BorrowScopeIntroducingValue(BeginBorrowInst *bbi)
280-
: kind(BorrowScopeIntroducerKind::BeginBorrow), value(bbi) {}
349+
: kind(BorrowScopeIntroducingValueKind::BeginBorrow), value(bbi) {}
281350
BorrowScopeIntroducingValue(SILFunctionArgument *arg)
282-
: kind(BorrowScopeIntroducerKind::SILFunctionArgument), value(arg) {
351+
: kind(BorrowScopeIntroducingValueKind::SILFunctionArgument), value(arg) {
283352
assert(arg->getOwnershipKind() == ValueOwnershipKind::Guaranteed);
284353
}
285354

286355
BorrowScopeIntroducingValue(SILValue v)
287-
: kind(*BorrowScopeIntroducerKind::get(v->getKind())), value(v) {
356+
: kind(*BorrowScopeIntroducingValueKind::get(v->getKind())), value(v) {
288357
assert(v.getOwnershipKind() == ValueOwnershipKind::Guaranteed);
289358
}
290359

291360
/// If value is a borrow introducer return it after doing some checks.
292361
static Optional<BorrowScopeIntroducingValue> get(SILValue value) {
293-
auto kind = BorrowScopeIntroducerKind::get(value->getKind());
362+
auto kind = BorrowScopeIntroducingValueKind::get(value->getKind());
294363
if (!kind || value.getOwnershipKind() != ValueOwnershipKind::Guaranteed)
295364
return None;
296365
return BorrowScopeIntroducingValue(*kind, value);
@@ -334,7 +403,8 @@ struct BorrowScopeIntroducingValue {
334403
private:
335404
/// Internal constructor for failable static constructor. Please do not expand
336405
/// its usage since it assumes the code passed in is well formed.
337-
BorrowScopeIntroducingValue(BorrowScopeIntroducerKind kind, SILValue value)
406+
BorrowScopeIntroducingValue(BorrowScopeIntroducingValueKind kind,
407+
SILValue value)
338408
: kind(kind), value(value) {}
339409
};
340410

0 commit comments

Comments
 (0)