Skip to content

Commit 859f701

Browse files
committed
---
yaml --- r: 348762 b: refs/heads/master c: d535e3e h: refs/heads/master
1 parent d5bbe87 commit 859f701

File tree

136 files changed

+4703
-4989
lines changed

Some content is hidden

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

136 files changed

+4703
-4989
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: 03edea344d190b65131d4efc2839b8e1b713ed20
2+
refs/heads/master: d535e3e6cf767f40620ca1e5eeb21fd3e7bf3b1c
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/docs/WindowsBuild.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,13 @@ cmake -G "Visual Studio 2017" -A x64 -T "host=x64"^ ...
186186
md "S:\b\lldb"
187187
cd "S:\b\lldb"
188188
cmake -G Ninja^
189-
-DLLVM_DIR="S:/b/llvm/lib/cmake/llvm"^
190-
-DClang_DIR="S:/b/llvm/lib/cmake/clang"^
191-
-DSwift_DIR="S:/b/swift/lib/cmake/swift"^
192189
-DCMAKE_BUILD_TYPE=RelWithDebInfo^
193190
-DLLDB_ALLOW_STATIC_BINDINGS=YES^
191+
-DLLDB_PATH_TO_CLANG_SOURCE="S:\clang"^
192+
-DLLDB_PATH_TO_SWIFT_SOURCE="S:\swift"^
193+
-DLLDB_PATH_TO_CLANG_BUILD="S:\b\llvm"^
194+
-DLLDB_PATH_TO_LLVM_BUILD="S:\b\llvm"^
195+
-DLLDB_PATH_TO_SWIFT_BUILD="S:\b\swift"^
194196
-DLLVM_ENABLE_ASSERTIONS=ON^
195197
-DPYTHON_HOME="%ProgramFiles(x86)%\Microsoft Visual Studio\Shared\Python37_64"^
196198
S:\lldb

trunk/include/swift/AST/DiagnosticConsumer.h

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,10 @@ enum class DiagnosticKind : uint8_t {
3838
Note
3939
};
4040

41-
/// Information about a diagnostic passed to DiagnosticConsumers.
41+
/// Extra information carried along with a diagnostic, which may or
42+
/// may not be of interest to a given diagnostic consumer.
4243
struct DiagnosticInfo {
4344
DiagID ID = DiagID(0);
44-
SourceLoc Loc;
45-
DiagnosticKind Kind;
46-
StringRef FormatString;
47-
ArrayRef<DiagnosticArgument> FormatArgs;
48-
SourceLoc BufferIndirectlyCausingDiagnostic;
49-
50-
/// DiagnosticInfo of notes which are children of this diagnostic, if any
51-
ArrayRef<DiagnosticInfo *> ChildDiagnosticInfo;
5245

5346
/// Represents a fix-it, a replacement of one range of text with another.
5447
class FixIt {
@@ -67,24 +60,6 @@ struct DiagnosticInfo {
6760

6861
/// Extra source ranges that are attached to the diagnostic.
6962
ArrayRef<FixIt> FixIts;
70-
71-
/// This is a note which has a parent error or warning
72-
bool IsChildNote = false;
73-
74-
DiagnosticInfo() {}
75-
76-
DiagnosticInfo(DiagID ID, SourceLoc Loc, DiagnosticKind Kind,
77-
StringRef FormatString,
78-
ArrayRef<DiagnosticArgument> FormatArgs,
79-
SourceLoc BufferIndirectlyCausingDiagnostic,
80-
ArrayRef<DiagnosticInfo *> ChildDiagnosticInfo,
81-
ArrayRef<CharSourceRange> Ranges, ArrayRef<FixIt> FixIts,
82-
bool IsChildNote)
83-
: ID(ID), Loc(Loc), Kind(Kind), FormatString(FormatString),
84-
FormatArgs(FormatArgs),
85-
BufferIndirectlyCausingDiagnostic(BufferIndirectlyCausingDiagnostic),
86-
ChildDiagnosticInfo(ChildDiagnosticInfo), Ranges(Ranges),
87-
FixIts(FixIts), IsChildNote(IsChildNote) {}
8863
};
8964

9065
/// Abstract interface for classes that present diagnostics to the user.

trunk/include/swift/AST/DiagnosticEngine.h

Lines changed: 2 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,7 @@ namespace swift {
337337
SmallVector<DiagnosticArgument, 3> Args;
338338
SmallVector<CharSourceRange, 2> Ranges;
339339
SmallVector<FixIt, 2> FixIts;
340-
std::vector<Diagnostic> ChildNotes;
341340
SourceLoc Loc;
342-
bool IsChildNote = false;
343341
const Decl *Decl = nullptr;
344342

345343
friend DiagnosticEngine;
@@ -364,13 +362,10 @@ namespace swift {
364362
ArrayRef<DiagnosticArgument> getArgs() const { return Args; }
365363
ArrayRef<CharSourceRange> getRanges() const { return Ranges; }
366364
ArrayRef<FixIt> getFixIts() const { return FixIts; }
367-
ArrayRef<Diagnostic> getChildNotes() const { return ChildNotes; }
368-
bool isChildNote() const { return IsChildNote; }
369365
SourceLoc getLoc() const { return Loc; }
370366
const class Decl *getDecl() const { return Decl; }
371367

372368
void setLoc(SourceLoc loc) { Loc = loc; }
373-
void setIsChildNote(bool isChildNote) { IsChildNote = isChildNote; }
374369
void setDecl(const class Decl *decl) { Decl = decl; }
375370

376371
/// Returns true if this object represents a particular diagnostic.
@@ -391,8 +386,6 @@ namespace swift {
391386
void addFixIt(FixIt &&F) {
392387
FixIts.push_back(std::move(F));
393388
}
394-
395-
void addChildNote(Diagnostic &&D);
396389
};
397390

398391
/// Describes an in-flight diagnostic, which is currently active
@@ -672,8 +665,7 @@ namespace swift {
672665

673666
friend class InFlightDiagnostic;
674667
friend class DiagnosticTransaction;
675-
friend class CompoundDiagnosticTransaction;
676-
668+
677669
public:
678670
explicit DiagnosticEngine(SourceManager &SourceMgr)
679671
: SourceMgr(SourceMgr), ActiveDiagnostic(),
@@ -886,15 +878,6 @@ namespace swift {
886878
return diagnose(decl, Diagnostic(id, std::move(args)...));
887879
}
888880

889-
/// Emit a parent diagnostic and attached notes.
890-
///
891-
/// \param parentDiag An InFlightDiagnostic representing the parent diag.
892-
///
893-
/// \param builder A closure which builds and emits notes to be attached to
894-
/// the parent diag.
895-
void diagnoseWithNotes(InFlightDiagnostic parentDiag,
896-
llvm::function_ref<void(void)> builder);
897-
898881
/// \returns true if diagnostic is marked with PointsToFirstBadToken
899882
/// option.
900883
bool isDiagnosticPointsToFirstBadToken(DiagID id) const;
@@ -922,10 +905,6 @@ namespace swift {
922905
/// Retrieve the active diagnostic.
923906
Diagnostic &getActiveDiagnostic() { return *ActiveDiagnostic; }
924907

925-
/// Generate DiagnosticInfo for a Diagnostic to be passed to consumers.
926-
Optional<DiagnosticInfo>
927-
diagnosticInfoForDiagnostic(const Diagnostic &diagnostic);
928-
929908
/// Send \c diag to all diagnostic consumers.
930909
void emitDiagnostic(const Diagnostic &diag);
931910

@@ -966,7 +945,6 @@ namespace swift {
966945
/// in LIFO order. An open transaction is implicitly committed upon
967946
/// destruction.
968947
class DiagnosticTransaction {
969-
protected:
970948
DiagnosticEngine &Engine;
971949

972950
/// How many tentative diagnostics there were when the transaction
@@ -990,6 +968,7 @@ namespace swift {
990968
Depth(Engine.TransactionCount),
991969
IsOpen(true)
992970
{
971+
assert(!Engine.ActiveDiagnostic);
993972
Engine.TransactionCount++;
994973
}
995974

@@ -1032,61 +1011,6 @@ namespace swift {
10321011
"transactions must be closed LIFO");
10331012
}
10341013
};
1035-
1036-
/// Represents a diagnostic transaction which constructs a compound diagnostic
1037-
/// from any diagnostics emitted inside. A compound diagnostic consists of a
1038-
/// parent error, warning, or remark followed by a variable number of child
1039-
/// notes. The semantics are otherwise the same as a regular
1040-
/// DiagnosticTransaction.
1041-
class CompoundDiagnosticTransaction : public DiagnosticTransaction {
1042-
public:
1043-
explicit CompoundDiagnosticTransaction(DiagnosticEngine &engine)
1044-
: DiagnosticTransaction(engine) {}
1045-
1046-
~CompoundDiagnosticTransaction() {
1047-
if (IsOpen) {
1048-
commit();
1049-
}
1050-
1051-
if (Depth == 0) {
1052-
Engine.TransactionStrings.clear();
1053-
Engine.TransactionAllocator.Reset();
1054-
}
1055-
}
1056-
1057-
void commit() {
1058-
assert(PrevDiagnostics < Engine.TentativeDiagnostics.size() &&
1059-
"CompoundDiagnosticTransaction must contain at least one diag");
1060-
1061-
// The first diagnostic is assumed to be the parent. If this is not an
1062-
// error or warning, we'll assert later when trying to add children.
1063-
Diagnostic &parent = Engine.TentativeDiagnostics[PrevDiagnostics];
1064-
1065-
// Associate the children with the parent.
1066-
for (auto diag =
1067-
Engine.TentativeDiagnostics.begin() + PrevDiagnostics + 1;
1068-
diag != Engine.TentativeDiagnostics.end(); ++diag) {
1069-
diag->setIsChildNote(true);
1070-
parent.addChildNote(std::move(*diag));
1071-
}
1072-
1073-
// Erase the children, they'll be emitted alongside their parent.
1074-
Engine.TentativeDiagnostics.erase(Engine.TentativeDiagnostics.begin() +
1075-
PrevDiagnostics + 1,
1076-
Engine.TentativeDiagnostics.end());
1077-
1078-
DiagnosticTransaction::commit();
1079-
}
1080-
};
1081-
1082-
inline void
1083-
DiagnosticEngine::diagnoseWithNotes(InFlightDiagnostic parentDiag,
1084-
llvm::function_ref<void(void)> builder) {
1085-
CompoundDiagnosticTransaction transaction(*this);
1086-
parentDiag.flush();
1087-
builder();
1088-
}
1089-
10901014
} // end namespace swift
10911015

10921016
#endif

trunk/include/swift/ClangImporter/ClangImporterOptions.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ class ClangImporterOptions {
103103
using llvm::hash_combine;
104104

105105
auto Code = hash_value(ModuleCachePath);
106-
Code = hash_combine(Code, llvm::hash_combine_range(ExtraArgs.begin(),
107-
ExtraArgs.end()));
106+
// ExtraArgs ignored - already considered in Clang's module hashing.
108107
Code = hash_combine(Code, OverrideResourceDir);
109108
Code = hash_combine(Code, TargetCPU);
110109
Code = hash_combine(Code, BridgingHeader);

trunk/include/swift/Frontend/PrintingDiagnosticConsumer.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,6 @@ class PrintingDiagnosticConsumer : public DiagnosticConsumer {
5050
bool didErrorOccur() {
5151
return DidErrorOccur;
5252
}
53-
54-
private:
55-
void printDiagnostic(SourceManager &SM, SourceLoc Loc, DiagnosticKind Kind,
56-
StringRef FormatString,
57-
ArrayRef<DiagnosticArgument> FormatArgs,
58-
const DiagnosticInfo &Info,
59-
SourceLoc bufferIndirectlyCausingDiagnostic);
6053
};
6154

6255
}

trunk/include/swift/SIL/OptimizationRemark.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ class Emitter {
157157
using RemarkT = decltype(RemarkBuilder());
158158
// Avoid building the remark unless remarks are enabled.
159159
if (isEnabled<RemarkT>() || Module.getOptRecordStream()) {
160-
auto rb = RemarkBuilder();
161-
rb.setPassName(PassName);
162-
emit(rb);
160+
auto R = RemarkBuilder();
161+
R.setPassName(PassName);
162+
emit(R);
163163
}
164164
}
165165

trunk/include/swift/SIL/SILGlobalVariable.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#ifndef SWIFT_SIL_SILGLOBALVARIABLE_H
1818
#define SWIFT_SIL_SILGLOBALVARIABLE_H
1919

20+
#include <string>
2021
#include "swift/SIL/SILLinkage.h"
2122
#include "swift/SIL/SILLocation.h"
2223
#include "swift/SIL/SILBasicBlock.h"

trunk/include/swift/SIL/SILInstructionWorklist.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#include "swift/Basic/BlotSetVector.h"
3434
#include "swift/SIL/SILInstruction.h"
3535
#include "swift/SIL/SILValue.h"
36-
#include "swift/SILOptimizer/Utils/InstOptUtils.h"
36+
#include "swift/SILOptimizer/Utils/Local.h"
3737
#include "llvm/ADT/DenseMap.h"
3838
#include "llvm/ADT/SmallVector.h"
3939

trunk/include/swift/SIL/SILValue.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,18 @@ class SILValue {
387387
NumLowBitsAvailable
388388
};
389389

390+
/// If this SILValue is a result of an instruction, return its
391+
/// defining instruction. Returns nullptr otherwise.
392+
SILInstruction *getDefiningInstruction() {
393+
return Value->getDefiningInstruction();
394+
}
395+
396+
/// If this SILValue is a result of an instruction, return its
397+
/// defining instruction. Returns nullptr otherwise.
398+
const SILInstruction *getDefiningInstruction() const {
399+
return Value->getDefiningInstruction();
400+
}
401+
390402
/// Returns the ValueOwnershipKind that describes this SILValue's ownership
391403
/// semantics if the SILValue has ownership semantics. Returns is a value
392404
/// without any Ownership Semantics.

trunk/include/swift/SIL/TypeSubstCloner.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
#include "swift/AST/GenericEnvironment.h"
2222
#include "swift/AST/ProtocolConformance.h"
2323
#include "swift/AST/Type.h"
24-
#include "swift/SIL/DynamicCasts.h"
2524
#include "swift/SIL/SILCloner.h"
25+
#include "swift/SIL/DynamicCasts.h"
2626
#include "swift/SIL/SILFunctionBuilder.h"
27-
#include "swift/SILOptimizer/Utils/InstOptUtils.h"
27+
#include "swift/SILOptimizer/Utils/Local.h"
2828
#include "swift/SILOptimizer/Utils/SpecializationMangler.h"
2929
#include "llvm/Support/Debug.h"
3030

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
//===--- CFG.h - Routines which analyze the CFG of a function ---*- C++ -*-===//
2+
//
3+
// This source file is part of the Swift.org open source project
4+
//
5+
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
#ifndef SWIFT_SILOPTIMIZER_ANALYSIS_CFG_H
14+
#define SWIFT_SILOPTIMIZER_ANALYSIS_CFG_H
15+
16+
namespace llvm {
17+
18+
template <typename T> class TinyPtrVector;
19+
20+
} // end namespace llvm
21+
22+
namespace swift {
23+
24+
class SILFunction;
25+
class SILBasicBlock;
26+
27+
/// Return true if we conservatively find all BB's that are non-failure exit
28+
/// basic blocks and place them in \p BBs. If we find something we don't
29+
/// understand, bail.
30+
///
31+
/// A non-failure exit BB is defined as a BB that:
32+
///
33+
/// 1. Has a return terminator.
34+
/// 2. unreachable + noreturn terminator sequence.
35+
/// 3. has a throw terminator.
36+
///
37+
/// If we just have an unreachable without a noreturn call before it, we must
38+
/// have a failure BB.
39+
///
40+
/// We use a TinyPtrVector since in most cases this will only return one
41+
/// SILBasicBlock since non-failure noreturn functions should not occur often
42+
/// implying in most cases this will be one element.
43+
///
44+
/// TODO:
45+
bool findAllNonFailureExitBBs(SILFunction *F,
46+
llvm::TinyPtrVector<SILBasicBlock *> &BBs);
47+
48+
} // end namespace swift
49+
50+
#endif

trunk/include/swift/SILOptimizer/Analysis/CallerAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "swift/SIL/SILInstruction.h"
1818
#include "swift/SIL/SILModule.h"
1919
#include "swift/SILOptimizer/Analysis/Analysis.h"
20-
#include "swift/SILOptimizer/Utils/InstOptUtils.h"
20+
#include "swift/SILOptimizer/Utils/Local.h"
2121
#include "llvm/ADT/ArrayRef.h"
2222
#include "llvm/ADT/DenseMap.h"
2323
#include "llvm/ADT/SmallSet.h"

0 commit comments

Comments
 (0)