Skip to content

Commit 565bfaf

Browse files
committed
---
yaml --- r: 340475 b: refs/heads/rxwei-patch-1 c: 59bc60e h: refs/heads/master i: 340473: c8a4170 340471: 31ddc25
1 parent 0aa890f commit 565bfaf

File tree

58 files changed

+354
-619
lines changed

Some content is hidden

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

58 files changed

+354
-619
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-08-18-a: b10b1fce14385faa6d44f6b933e95
10151015
refs/heads/rdar-43033749-fix-batch-mode-no-diags-swift-5.0-branch: a14e64eaad30de89f0f5f0b2a782eed7ecdcb255
10161016
refs/heads/revert-19006-error-bridging-integer-type: 8a9065a3696535305ea53fe9b71f91cbe6702019
10171017
refs/heads/revert-19050-revert-19006-error-bridging-integer-type: ecf752d54b05dd0a20f510f0bfa54a3fec3bcaca
1018-
refs/heads/rxwei-patch-1: 90f636357eaa3f571135542a2a01459e7a035547
1018+
refs/heads/rxwei-patch-1: 59bc60eb201e35a2cf90a5a286c78d97500f8111
10191019
refs/heads/shahmishal-patch-1: e58ec0f7488258d42bef51bc3e6d7b3dc74d7b2a
10201020
refs/heads/typelist-existential: 4046359efd541fb5c72d69a92eefc0a784df8f5e
10211021
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-20-a: 4319ba09e4fb8650ee86061075c74a016b6baab9

branches/rxwei-patch-1/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Instructions for installing CMake and Ninja directly can be found [below](#build
9898

9999
For Ubuntu, you'll need the following development dependencies:
100100

101-
sudo apt-get install git cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config libcurl4-openssl-dev systemtap-sdt-dev tzdata rsync
101+
sudo apt-get install git cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config libblocksruntime-dev libcurl4-openssl-dev systemtap-sdt-dev tzdata rsync
102102

103103
**Note:** LLDB currently requires at least `swig-1.3.40` but will successfully build
104104
with version 2 shipped with Ubuntu.

branches/rxwei-patch-1/docs/ABI/Mangling.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,6 @@ Types
512512
FUNCTION-KIND ::= 'U' // uncurried function type (currently not used)
513513
FUNCTION-KIND ::= 'K' // @auto_closure function type (noescape)
514514
FUNCTION-KIND ::= 'B' // objc block function type
515-
FUNCTION-KIND ::= 'L' // objc block function type (escaping) (DWARF only; otherwise use 'B')
516515
FUNCTION-KIND ::= 'C' // C function pointer type
517516
FUNCTION-KIND ::= 'A' // @auto_closure function type (escaping)
518517
FUNCTION-KIND ::= 'E' // function type (noescape)

branches/rxwei-patch-1/include/swift/AST/Decl.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,9 @@ class alignas(1 << DeclAlignInBits) Decl {
387387
/// It is up to the debugger to instruct SIL how to access this variable.
388388
IsDebuggerVar : 1,
389389

390-
/// Whether this is the backing storage for a lazy property.
391-
IsLazyStorageProperty : 1,
390+
/// Whether this is a property defined in the debugger's REPL.
391+
/// FIXME: Remove this once LLDB has proper support for resilience.
392+
IsREPLVar : 1,
392393

393394
/// Whether this is the backing storage for a property wrapper.
394395
IsPropertyWrapperBackingProperty : 1
@@ -4805,7 +4806,7 @@ class VarDecl : public AbstractStorageDecl {
48054806
Bits.VarDecl.Specifier = static_cast<unsigned>(Sp);
48064807
Bits.VarDecl.IsCaptureList = IsCaptureList;
48074808
Bits.VarDecl.IsDebuggerVar = false;
4808-
Bits.VarDecl.IsLazyStorageProperty = false;
4809+
Bits.VarDecl.IsREPLVar = false;
48094810
Bits.VarDecl.HasNonPatternBindingInit = false;
48104811
Bits.VarDecl.IsPropertyWrapperBackingProperty = false;
48114812
}
@@ -5094,13 +5095,12 @@ class VarDecl : public AbstractStorageDecl {
50945095
void setDebuggerVar(bool IsDebuggerVar) {
50955096
Bits.VarDecl.IsDebuggerVar = IsDebuggerVar;
50965097
}
5097-
5098-
/// Is this the synthesized storage for a 'lazy' property?
5099-
bool isLazyStorageProperty() const {
5100-
return Bits.VarDecl.IsLazyStorageProperty;
5101-
}
5102-
void setLazyStorageProperty(bool IsLazyStorage) {
5103-
Bits.VarDecl.IsLazyStorageProperty = IsLazyStorage;
5098+
5099+
/// Is this a special debugger REPL variable?
5100+
/// FIXME: Remove this once LLDB has proper support for resilience.
5101+
bool isREPLVar() const { return Bits.VarDecl.IsREPLVar; }
5102+
void setREPLVar(bool IsREPLVar) {
5103+
Bits.VarDecl.IsREPLVar = IsREPLVar;
51045104
}
51055105

51065106
/// Retrieve the custom attribute that attaches a property wrapper to this

branches/rxwei-patch-1/include/swift/Demangling/DemangleNodes.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ NODE(NonObjCAttribute)
147147
NODE(Number)
148148
NODE(ObjCAttribute)
149149
NODE(ObjCBlock)
150-
NODE(EscapingObjCBlock)
151150
CONTEXT_NODE(OtherNominalType)
152151
CONTEXT_NODE(OwningAddressor)
153152
CONTEXT_NODE(OwningMutableAddressor)

branches/rxwei-patch-1/include/swift/Demangling/TypeDecoder.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,6 @@ class TypeDecoder {
487487
auto index = Node->getChild(1)->getIndex();
488488
return Builder.createGenericTypeParameterType(depth, index);
489489
}
490-
case NodeKind::EscapingObjCBlock:
491490
case NodeKind::ObjCBlock:
492491
case NodeKind::CFunctionPointer:
493492
case NodeKind::ThinFunctionType:
@@ -499,8 +498,7 @@ class TypeDecoder {
499498
return BuiltType();
500499

501500
FunctionTypeFlags flags;
502-
if (Node->getKind() == NodeKind::ObjCBlock ||
503-
Node->getKind() == NodeKind::EscapingObjCBlock) {
501+
if (Node->getKind() == NodeKind::ObjCBlock) {
504502
flags = flags.withConvention(FunctionMetadataConvention::Block);
505503
} else if (Node->getKind() == NodeKind::CFunctionPointer) {
506504
flags =
@@ -526,8 +524,7 @@ class TypeDecoder {
526524
.withParameterFlags(hasParamFlags)
527525
.withEscaping(
528526
Node->getKind() == NodeKind::FunctionType ||
529-
Node->getKind() == NodeKind::EscapingAutoClosureType ||
530-
Node->getKind() == NodeKind::EscapingObjCBlock);
527+
Node->getKind() == NodeKind::EscapingAutoClosureType);
531528

532529
auto result = decodeMangledType(Node->getChild(isThrow ? 2 : 1));
533530
if (!result) return BuiltType();

branches/rxwei-patch-1/include/swift/SIL/SILDebugScope.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,8 @@ class SILDebugScope : public SILAllocated<SILDebugScope> {
6565
SILFunction *getParentFunction() const;
6666

6767
#ifndef NDEBUG
68-
LLVM_ATTRIBUTE_DEPRECATED(void dump(SourceManager &SM, llvm::raw_ostream &OS = llvm::errs(),
69-
unsigned Indent = 0) const,
70-
"only for use in the debugger");
71-
LLVM_ATTRIBUTE_DEPRECATED(void dump(SILModule &Mod) const, "only for use in the debugger");
68+
void dump(SourceManager &SM, llvm::raw_ostream &OS = llvm::errs(),
69+
unsigned Indent = 0) const;
7270
#endif
7371
};
7472

branches/rxwei-patch-1/lib/AST/ASTDemangler.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -378,14 +378,10 @@ Type ASTBuilder::createFunctionType(
378378

379379
auto einfo = AnyFunctionType::ExtInfo(representation,
380380
/*throws*/ flags.throws());
381-
382-
if (representation == FunctionTypeRepresentation::Swift ||
383-
representation == FunctionTypeRepresentation::Block) {
384-
if (flags.isEscaping())
385-
einfo = einfo.withNoEscape(false);
386-
else
387-
einfo = einfo.withNoEscape(true);
388-
}
381+
if (flags.isEscaping())
382+
einfo = einfo.withNoEscape(false);
383+
else
384+
einfo = einfo.withNoEscape(true);
389385

390386
// The result type must be materializable.
391387
if (!output->isMaterializable()) return Type();

branches/rxwei-patch-1/lib/AST/ASTMangler.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,10 +1911,6 @@ void ASTMangler::appendFunctionType(AnyFunctionType *fn, bool isAutoClosure,
19111911
// changes to better support thin functions.
19121912
switch (fn->getRepresentation()) {
19131913
case AnyFunctionType::Representation::Block:
1914-
// We distinguish escaping and non-escaping blocks, but only in the DWARF
1915-
// mangling, because the ABI is already set.
1916-
if (!fn->isNoEscape() && DWARFMangling)
1917-
return appendOperator("XL");
19181914
return appendOperator("XB");
19191915
case AnyFunctionType::Representation::Thin:
19201916
return appendOperator("Xf");

branches/rxwei-patch-1/lib/ClangImporter/ClangImporter.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,7 +1746,7 @@ PlatformAvailability::PlatformAvailability(LangOptions &langOpts)
17461746
"APIs deprecated as of macOS 10.9 and earlier are unavailable in Swift";
17471747
break;
17481748

1749-
case PlatformKind::none:
1749+
default:
17501750
break;
17511751
}
17521752
}
@@ -1787,11 +1787,7 @@ bool PlatformAvailability::treatDeprecatedAsUnavailable(
17871787
Optional<unsigned> minor = version.getMinor();
17881788

17891789
switch (platformKind) {
1790-
case PlatformKind::none:
1791-
llvm_unreachable("version but no platform?");
1792-
17931790
case PlatformKind::OSX:
1794-
case PlatformKind::OSXApplicationExtension:
17951791
// Anything deprecated in OSX 10.9.x and earlier is unavailable in Swift.
17961792
return major < 10 ||
17971793
(major == 10 && (!minor.hasValue() || minor.getValue() <= 9));
@@ -1807,9 +1803,10 @@ bool PlatformAvailability::treatDeprecatedAsUnavailable(
18071803
case PlatformKind::watchOSApplicationExtension:
18081804
// No deprecation filter on watchOS
18091805
return false;
1810-
}
18111806

1812-
llvm_unreachable("Unexpected platform");
1807+
default:
1808+
return false;
1809+
}
18131810
}
18141811

18151812
ClangImporter::Implementation::Implementation(ASTContext &ctx,

branches/rxwei-patch-1/lib/Demangling/Demangler.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2709,8 +2709,6 @@ NodePointer Demangler::demangleSpecialType() {
27092709
return popFunctionType(Node::Kind::AutoClosureType);
27102710
case 'U':
27112711
return popFunctionType(Node::Kind::UncurriedFunctionType);
2712-
case 'L':
2713-
return popFunctionType(Node::Kind::EscapingObjCBlock);
27142712
case 'B':
27152713
return popFunctionType(Node::Kind::ObjCBlock);
27162714
case 'C':

branches/rxwei-patch-1/lib/Demangling/NodePrinter.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ class NodePrinter {
349349
case Node::Kind::Directness:
350350
case Node::Kind::DynamicAttribute:
351351
case Node::Kind::EscapingAutoClosureType:
352-
case Node::Kind::EscapingObjCBlock:
353352
case Node::Kind::NoEscapeFunctionType:
354353
case Node::Kind::ExplicitClosure:
355354
case Node::Kind::Extension:
@@ -1789,11 +1788,6 @@ NodePointer NodePrinter::print(NodePointer Node, bool asPrefixContext) {
17891788
printFunctionType(nullptr, Node);
17901789
return nullptr;
17911790
}
1792-
case Node::Kind::EscapingObjCBlock: {
1793-
Printer << "@escaping @convention(block) ";
1794-
printFunctionType(nullptr, Node);
1795-
return nullptr;
1796-
}
17971791
case Node::Kind::SILBoxType: {
17981792
Printer << "@box ";
17991793
NodePointer type = Node->getChild(0);

branches/rxwei-patch-1/lib/Demangling/OldRemangler.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,11 +1129,6 @@ void Remangler::mangleObjCBlock(Node *node) {
11291129
mangleChildNodes(node); // argument tuple, result type
11301130
}
11311131

1132-
void Remangler::mangleEscapingObjCBlock(Node *node) {
1133-
// We shouldn't ever be remangling anything with a DWARF-only mangling.
1134-
Buffer << "<escaping block type>";
1135-
}
1136-
11371132
void Remangler::mangleCFunctionPointer(Node *node) {
11381133
Buffer << 'c';
11391134
mangleChildNodes(node); // argument tuple, result type

branches/rxwei-patch-1/lib/Demangling/Remangler.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,11 +1646,6 @@ void Remangler::mangleObjCBlock(Node *node) {
16461646
Buffer << "XB";
16471647
}
16481648

1649-
void Remangler::mangleEscapingObjCBlock(Node *node) {
1650-
mangleChildNodesReversed(node);
1651-
Buffer << "XL";
1652-
}
1653-
16541649
void Remangler::mangleOwningAddressor(Node *node) {
16551650
mangleAbstractStorage(node->getFirstChild(), "lO");
16561651
}

branches/rxwei-patch-1/lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,28 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
761761
return Size(size);
762762
}
763763

764+
#ifndef NDEBUG
765+
static bool areTypesReallyEqual(Type lhs, Type rhs) {
766+
// Due to an oversight, escaping and non-escaping @convention(block)
767+
// are mangled identically.
768+
auto eraseEscapingBlock = [](Type t) -> Type {
769+
return t.transform([](Type t) -> Type {
770+
if (auto *fnType = t->getAs<FunctionType>()) {
771+
if (fnType->getExtInfo().getRepresentation()
772+
== FunctionTypeRepresentation::Block) {
773+
return FunctionType::get(fnType->getParams(),
774+
fnType->getResult(),
775+
fnType->getExtInfo().withNoEscape(true));
776+
}
777+
}
778+
return t;
779+
});
780+
};
781+
782+
return eraseEscapingBlock(lhs)->isEqual(eraseEscapingBlock(rhs));
783+
}
784+
#endif
785+
764786
StringRef getMangledName(DebugTypeInfo DbgTy) {
765787
if (DbgTy.IsMetadataType)
766788
return MetadataTypeDeclCache.find(DbgTy.getDecl()->getName().str())
@@ -803,12 +825,14 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
803825
Ty->dump();
804826
abort();
805827
} else if (!Reconstructed->isEqual(Ty)) {
806-
llvm::errs() << "Incorrect reconstructed type for " << Result << "\n";
807-
llvm::errs() << "Original type:\n";
808-
Ty->dump();
809-
llvm::errs() << "Reconstructed type:\n";
810-
Reconstructed->dump();
811-
abort();
828+
if (!areTypesReallyEqual(Reconstructed, Ty)) {
829+
llvm::errs() << "Incorrect reconstructed type for " << Result << "\n";
830+
llvm::errs() << "Original type:\n";
831+
Ty->dump();
832+
llvm::errs() << "Reconstructed type:\n";
833+
Reconstructed->dump();
834+
abort();
835+
}
812836
}
813837
#endif
814838
}

branches/rxwei-patch-1/lib/Parse/ParseExpr.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,9 +1963,8 @@ ParserResult<Expr> Parser::parseExprStringLiteral() {
19631963
unsigned QuoteLength;
19641964
tok QuoteKind;
19651965
std::tie(QuoteLength, QuoteKind) =
1966-
Tok.isMultilineString() ? std::make_tuple(3, tok::multiline_string_quote)
1967-
: std::make_tuple(1, Tok.getText().startswith("\'") ?
1968-
tok::single_quote: tok::string_quote);
1966+
Tok.isMultilineString() ? std::make_tuple(3, tok::multiline_string_quote)
1967+
: std::make_tuple(1, tok::string_quote);
19691968
unsigned CloseQuoteBegin = Tok.getLength() - DelimiterLength - QuoteLength;
19701969

19711970
OpenDelimiterStr = Tok.getRawText().take_front(DelimiterLength);

branches/rxwei-patch-1/lib/SIL/SILPrinter.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3005,12 +3005,6 @@ void SILDebugScope::dump(SourceManager &SM, llvm::raw_ostream &OS,
30053005
}
30063006
OS << "}\n";
30073007
}
3008-
3009-
void SILDebugScope::dump(SILModule &Mod) const {
3010-
// We just use the default indent and llvm::errs().
3011-
dump(Mod.getASTContext().SourceMgr);
3012-
}
3013-
30143008
#endif
30153009

30163010
void SILSpecializeAttr::print(llvm::raw_ostream &OS) const {

branches/rxwei-patch-1/lib/SILOptimizer/Mandatory/DIMemoryUseCollector.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,15 +1568,11 @@ collectDelegatingInitUses(const DIMemoryObjectInfo &TheMemory,
15681568
// be an end_borrow use in addition to the value_metatype.
15691569
if (isa<LoadBorrowInst>(User)) {
15701570
auto UserVal = cast<SingleValueInstruction>(User);
1571-
bool onlyUseIsValueMetatype = false;
1571+
bool onlyUseIsValueMetatype = true;
15721572
for (auto use : UserVal->getUses()) {
1573-
auto *user = use->getUser();
1574-
if (isa<EndBorrowInst>(user))
1573+
if (isa<EndBorrowInst>(use->getUser())
1574+
|| isa<ValueMetatypeInst>(use->getUser()))
15751575
continue;
1576-
if (isa<ValueMetatypeInst>(user)) {
1577-
onlyUseIsValueMetatype = true;
1578-
continue;
1579-
}
15801576
onlyUseIsValueMetatype = false;
15811577
break;
15821578
}

0 commit comments

Comments
 (0)