Skip to content

Commit be1dd0d

Browse files
committed
---
yaml --- r: 278511 b: refs/heads/swift-5.1-old-llvm-branch c: 82b5f2a h: refs/heads/master i: 278509: 3f04660 278507: 24c730b 278503: 7885493 278495: 0680f71
1 parent 09d884d commit be1dd0d

File tree

121 files changed

+1545
-3384
lines changed

Some content is hidden

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

121 files changed

+1545
-3384
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-01-24-a: b6f62823aa5010b2ae53f15f72a57
12411241
refs/heads/marcrasi-astverifier-disable: 3fac766a23a77ebd0640296bfd7fc116ea60a4e0
12421242
refs/heads/revert-22227-a-tall-white-fountain-played: adfce60b2eaa54903ea189bed8a783bca609fa53
12431243
refs/heads/revert-22300-revert-22227-a-tall-white-fountain-played: 5f92040224df7dd4e618fdfb367349df64d8acad
1244-
refs/heads/swift-5.1-old-llvm-branch: 003850fb0d886493305f7f7a0b23dbadc2bbfd07
1244+
refs/heads/swift-5.1-old-llvm-branch: 82b5f2a19563341a87afbd2f574e7b80aecd08e1
12451245
refs/heads/swift-5.1-branch: 8060872acb4105d9655e020fe047e1ebcd77d0fb
12461246
refs/tags/swift-4.2.2-RELEASE: e429d1f1aaf59e69d38207a96e56265c7f6fccec
12471247
refs/tags/swift-5.0-DEVELOPMENT-SNAPSHOT-2019-02-02-a: 3e5a03d32ff3b1e9af90d6c1198c14f938379a6e

branches/swift-5.1-old-llvm-branch/cmake/modules/SwiftSharedCMakeConfig.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,10 @@ endmacro()
213213
# The product name, e.g. Swift or SourceKit. Used as prefix for some
214214
# cmake variables.
215215
macro(swift_common_unified_build_config product)
216+
set(PATH_TO_LLVM_SOURCE "${CMAKE_SOURCE_DIR}")
217+
set(PATH_TO_LLVM_BUILD "${CMAKE_BINARY_DIR}")
216218
set(${product}_PATH_TO_CLANG_BUILD "${CMAKE_BINARY_DIR}")
219+
set(PATH_TO_CLANG_BUILD "${CMAKE_BINARY_DIR}")
217220
set(CLANG_MAIN_INCLUDE_DIR "${LLVM_EXTERNAL_CLANG_SOURCE_DIR}/include")
218221
set(CLANG_BUILD_INCLUDE_DIR "${CMAKE_BINARY_DIR}/tools/clang/include")
219222
set(${product}_NATIVE_LLVM_TOOLS_PATH "${CMAKE_BINARY_DIR}/bin")

branches/swift-5.1-old-llvm-branch/include/swift/AST/DiagnosticsSema.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,8 @@ ERROR(cannot_return_value_from_void_func,none,
586586

587587
ERROR(sema_no_import,Fatal,
588588
"no such module '%0'", (StringRef))
589-
ERROR(sema_no_import_target,Fatal,
590-
"could not find module '%0' for target '%1'; "
589+
ERROR(sema_no_import_arch,Fatal,
590+
"could not find module '%0' for architecture '%1'; "
591591
"found: %2", (StringRef, StringRef, StringRef))
592592
ERROR(sema_no_import_repl,none,
593593
"no such module '%0'", (StringRef))

branches/swift-5.1-old-llvm-branch/include/swift/AST/NameLookup.h

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -118,25 +118,20 @@ class UnqualifiedLookup {
118118
/// That is, \c makeArrayRef(Results).take_front(IndexOfFirstOuterResults)
119119
/// will be Results from the innermost scope that had results, and the
120120
/// remaining elements of Results will be from parent scopes of this one.
121-
///
122-
/// Allows unqualified name lookup to return results from outer scopes.
123-
/// This is necessary for disambiguating calls to functions like `min` and
124-
/// `max`.
125121
size_t IndexOfFirstOuterResult;
126122

127123
/// Return true if anything was found by the name lookup.
128124
bool isSuccess() const { return !Results.empty(); }
129125

130126
/// Get the result as a single type, or a null type if that fails.
131-
TypeDecl *getSingleTypeResult() const;
127+
TypeDecl *getSingleTypeResult();
132128
};
133129

134130
inline UnqualifiedLookup::Options operator|(UnqualifiedLookup::Flags flag1,
135131
UnqualifiedLookup::Flags flag2) {
136132
return UnqualifiedLookup::Options(flag1) | flag2;
137133
}
138134

139-
140135
/// Describes the reason why a certain declaration is visible.
141136
enum class DeclVisibilityKind {
142137
/// Declaration is a local variable or type.
@@ -357,29 +352,6 @@ void lookupInModule(ModuleDecl *module, ModuleDecl::AccessPathTy accessPath,
357352
const DeclContext *moduleScopeContext,
358353
ArrayRef<ModuleDecl::ImportedModule> extraImports = {});
359354

360-
template <typename Fn>
361-
void forAllVisibleModules(const DeclContext *DC, const Fn &fn) {
362-
DeclContext *moduleScope = DC->getModuleScopeContext();
363-
if (auto file = dyn_cast<FileUnit>(moduleScope))
364-
file->forAllVisibleModules(fn);
365-
else
366-
cast<ModuleDecl>(moduleScope)
367-
->forAllVisibleModules(ModuleDecl::AccessPathTy(), fn);
368-
}
369-
370-
/// Only name lookup has gathered a set of results, perform any necessary
371-
/// steps to prune the result set before returning it to the caller.
372-
bool finishLookup(const DeclContext *dc, NLOptions options,
373-
SmallVectorImpl<ValueDecl *> &decls);
374-
375-
/// Do nothing if debugClient is null.
376-
template <typename Result>
377-
void filterForDiscriminator(SmallVectorImpl<Result> &results,
378-
DebuggerClient *debugClient);
379-
380-
void recordLookupOfTopLevelName(DeclContext *topLevelContext, DeclName name,
381-
bool isCascading);
382-
383355
} // end namespace namelookup
384356

385357
/// Retrieve the set of nominal type declarations that are directly

branches/swift-5.1-old-llvm-branch/include/swift/Basic/Platform.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,6 @@ namespace swift {
7474
///
7575
/// This is a stop-gap until full Triple support (ala Clang) exists within swiftc.
7676
StringRef getMajorArchitectureName(const llvm::Triple &triple);
77-
78-
/// Computes the normalized target triple used as the most preferred name for
79-
/// module loading.
80-
///
81-
/// For platforms with fat binaries, this canonicalizes architecture,
82-
/// vendor, and OS names, strips OS versions, and makes inferred environments
83-
/// explicit. For other platforms, it returns the unmodified triple.
84-
///
85-
/// The input triple should already be "normalized" in the sense that
86-
/// llvm::Triple::normalize() would not affect it.
87-
llvm::Triple getTargetSpecificModuleTriple(const llvm::Triple &triple);
8877
} // end namespace swift
8978

9079
#endif // SWIFT_BASIC_PLATFORM_H

branches/swift-5.1-old-llvm-branch/include/swift/Demangling/Demangle.h

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -35,11 +35,6 @@ namespace Demangle {
3535

3636
enum class SymbolicReferenceKind : uint8_t;
3737

38-
/// A simple default implementation that assigns letters to archetypes in
39-
/// alphabetic order.
40-
std::string archetypeName(uint64_t index, uint64_t depth);
41-
42-
/// Display style options for the demangler.
4338
struct DemangleOptions {
4439
bool SynthesizeSugarOnTypes = false;
4540
bool DisplayDebuggerGeneratedModule = true;
@@ -57,7 +52,6 @@ struct DemangleOptions {
5752
bool ShortenArchetype = false;
5853
bool ShowPrivateDiscriminators = true;
5954
bool ShowFunctionArgumentTypes = true;
60-
std::function<std::string(uint64_t, uint64_t)> ArchetypeName = archetypeName;
6155

6256
DemangleOptions() {}
6357

@@ -352,19 +346,17 @@ class Context {
352346
/// prefix: _T, _T0, $S, _$S.
353347
///
354348
/// \returns The demangled string.
355-
std::string demangleSymbolAsString(
356-
llvm::StringRef MangledName,
357-
const DemangleOptions &Options = DemangleOptions());
349+
std::string demangleSymbolAsString(llvm::StringRef MangledName,
350+
const DemangleOptions &Options = DemangleOptions());
358351

359352
/// Demangle the given type and return the readable name.
360353
///
361354
/// \param MangledName The mangled type string, which does _not_ start with
362355
/// a mangling prefix.
363356
///
364357
/// \returns The demangled string.
365-
std::string
366-
demangleTypeAsString(llvm::StringRef MangledName,
367-
const DemangleOptions &Options = DemangleOptions());
358+
std::string demangleTypeAsString(llvm::StringRef MangledName,
359+
const DemangleOptions &Options = DemangleOptions());
368360

369361
/// Returns true if the mangledName refers to a thunk function.
370362
///
@@ -592,6 +584,7 @@ bool nodeConsumesGenericArgs(Node *node);
592584
bool isSpecialized(Node *node);
593585

594586
NodePointer getUnspecialized(Node *node, NodeFactory &Factory);
587+
std::string archetypeName(Node::IndexType index, Node::IndexType depth);
595588

596589
/// Returns true if the node \p kind refers to a context node, e.g. a nominal
597590
/// type or a function.

branches/swift-5.1-old-llvm-branch/include/swift/Remote/MetadataReader.h

Lines changed: 18 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -410,15 +410,11 @@ class MetadataReader {
410410
StoredPointer InstanceAddress =
411411
InstanceMetadataAddressAddress + 2 * sizeof(StoredPointer);
412412

413-
// When built with Objective-C interop, the runtime also stores a conformance
414-
// to Hashable and the base type introducing the Hashable conformance.
415-
if (isObjC)
416-
InstanceAddress += 2 * sizeof(StoredPointer);
417-
418413
// Round up to alignment, and we have the start address of the
419414
// instance payload.
420415
auto AlignmentMask = VWT->getAlignmentMask();
421-
InstanceAddress = (InstanceAddress + AlignmentMask) & ~AlignmentMask;
416+
auto Offset = (sizeof(HeapObject) + AlignmentMask) & ~AlignmentMask;
417+
InstanceAddress += Offset;
422418

423419
return RemoteExistential(
424420
RemoteAddress(*InstanceMetadataAddress),
@@ -2451,12 +2447,6 @@ class MetadataReader {
24512447
tryFindSymbol(_address, symbolName); \
24522448
tryReadSymbol(_address, dest); \
24532449
} while (0)
2454-
# define tryFindAndReadSymbolWithDefault(dest, symbolName, default) do { \
2455-
dest = default; \
2456-
auto _address = Reader->getSymbolAddress(symbolName); \
2457-
if (_address) \
2458-
tryReadSymbol(_address, dest); \
2459-
} while (0)
24602450

24612451
tryFindAndReadSymbol(TaggedPointerMask,
24622452
"objc_debug_taggedpointer_mask");
@@ -2469,34 +2459,25 @@ class MetadataReader {
24692459
if (!TaggedPointerClassesAddr)
24702460
finish(TaggedPointerEncodingKind::Error);
24712461
TaggedPointerClasses = TaggedPointerClassesAddr.getAddressData();
2472-
2473-
// Extended tagged pointers don't exist on older OSes. Handle those
2474-
// by setting the variables to zero.
2475-
tryFindAndReadSymbolWithDefault(TaggedPointerExtendedMask,
2476-
"objc_debug_taggedpointer_ext_mask",
2477-
0);
2478-
tryFindAndReadSymbolWithDefault(TaggedPointerExtendedSlotShift,
2479-
"objc_debug_taggedpointer_ext_slot_shift",
2480-
0);
2481-
tryFindAndReadSymbolWithDefault(TaggedPointerExtendedSlotMask,
2482-
"objc_debug_taggedpointer_ext_slot_mask",
2483-
0);
2484-
auto TaggedPointerExtendedClassesAddr =
2485-
Reader->getSymbolAddress("objc_debug_taggedpointer_ext_classes");
2486-
if (TaggedPointerExtendedClassesAddr)
2487-
TaggedPointerExtendedClasses =
2488-
TaggedPointerExtendedClassesAddr.getAddressData();
2489-
2490-
// The tagged pointer obfuscator is not present on older OSes, in
2491-
// which case we can treat it as zero.
2492-
tryFindAndReadSymbolWithDefault(TaggedPointerObfuscator,
2493-
"objc_debug_taggedpointer_obfuscator",
2494-
0);
2495-
2462+
tryFindAndReadSymbol(TaggedPointerExtendedMask,
2463+
"objc_debug_taggedpointer_ext_mask");
2464+
tryFindAndReadSymbol(TaggedPointerExtendedSlotShift,
2465+
"objc_debug_taggedpointer_ext_slot_shift");
2466+
tryFindAndReadSymbol(TaggedPointerExtendedSlotMask,
2467+
"objc_debug_taggedpointer_ext_slot_mask");
2468+
tryFindSymbol(TaggedPointerExtendedClassesAddr,
2469+
"objc_debug_taggedpointer_ext_classes");
2470+
if (!TaggedPointerExtendedClassesAddr)
2471+
finish(TaggedPointerEncodingKind::Error);
2472+
TaggedPointerExtendedClasses =
2473+
TaggedPointerExtendedClassesAddr.getAddressData();
2474+
2475+
tryFindAndReadSymbol(TaggedPointerObfuscator,
2476+
"objc_debug_taggedpointer_obfuscator");
2477+
24962478
# undef tryFindSymbol
24972479
# undef tryReadSymbol
24982480
# undef tryFindAndReadSymbol
2499-
# undef tryFindAndReadSymbolWithDefault
25002481

25012482
return finish(TaggedPointerEncodingKind::Extended);
25022483
}

branches/swift-5.1-old-llvm-branch/include/swift/SIL/OptimizationRemark.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ struct Argument {
5050
Argument(StringRef Key, unsigned long long N);
5151

5252
Argument(StringRef Key, SILFunction *F);
53-
Argument(StringRef Key, SILType Ty);
54-
Argument(StringRef Key, CanType Ty);
53+
Argument(StringRef Key, SILType *Ty);
5554
};
5655

5756
/// Shorthand to insert named-value pairs.

branches/swift-5.1-old-llvm-branch/include/swift/SIL/SILBuilder.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -918,10 +918,8 @@ class SILBuilder {
918918
} \
919919
Copy##Name##ValueInst *createCopy##Name##Value(SILLocation Loc, \
920920
SILValue operand) { \
921-
auto type = getFunction().getLoweredType( \
922-
operand->getType().getASTType().getReferenceStorageReferent()); \
923921
return insert(new (getModule()) \
924-
Copy##Name##ValueInst(getSILDebugLocation(Loc), operand, type)); \
922+
Copy##Name##ValueInst(getSILDebugLocation(Loc), operand, getModule())); \
925923
}
926924
#define SOMETIMES_LOADABLE_CHECKED_REF_STORAGE(Name, ...) \
927925
NEVER_LOADABLE_CHECKED_REF_STORAGE(Name, "...") \

branches/swift-5.1-old-llvm-branch/include/swift/SIL/SILFunction.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ class SILModule;
3838
class SILFunctionBuilder;
3939
class SILProfiler;
4040

41-
namespace Lowering {
42-
class TypeLowering;
43-
class AbstractionPattern;
44-
}
45-
4641
enum IsBare_t { IsNotBare, IsBare };
4742
enum IsTransparent_t { IsNotTransparent, IsTransparent };
4843
enum Inline_t { InlineDefault, NoInline, AlwaysInline };
@@ -469,19 +464,6 @@ class SILFunction
469464
: ResilienceExpansion::Maximal);
470465
}
471466

472-
const Lowering::TypeLowering &
473-
getTypeLowering(Lowering::AbstractionPattern orig, Type subst);
474-
475-
const Lowering::TypeLowering &getTypeLowering(Type t) const;
476-
477-
SILType getLoweredType(Lowering::AbstractionPattern orig, Type subst) const;
478-
479-
SILType getLoweredType(Type t) const;
480-
481-
SILType getLoweredLoadableType(Type t) const;
482-
483-
const Lowering::TypeLowering &getTypeLowering(SILType type) const;
484-
485467
/// Returns true if this function has a calling convention that has a self
486468
/// argument.
487469
bool hasSelfParam() const {

branches/swift-5.1-old-llvm-branch/include/swift/SIL/SILInstruction.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3929,26 +3929,30 @@ class StoreReferenceInstBase : public InstructionBase<K, NonValueInstruction> {
39293929
/// \param loc The location of the expression that caused the load.
39303930
/// \param lvalue The SILValue representing the address to
39313931
/// use for the load.
3932-
#define NEVER_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE(Name, ...) \
3932+
#define NEVER_LOADABLE_CHECKED_REF_STORAGE(Name, ...) \
39333933
class Load##Name##Inst \
39343934
: public LoadReferenceInstBase<SILInstructionKind::Load##Name##Inst> { \
39353935
friend SILBuilder; \
39363936
Load##Name##Inst(SILDebugLocation loc, SILValue lvalue, IsTake_t isTake) \
39373937
: LoadReferenceInstBase(loc, lvalue, isTake) {} \
39383938
};
3939+
#define SOMETIMES_LOADABLE_CHECKED_REF_STORAGE(Name, ...) \
3940+
NEVER_LOADABLE_CHECKED_REF_STORAGE(Name, "...")
39393941
#include "swift/AST/ReferenceStorage.def"
39403942

39413943
/// Represents a store to a dynamic reference storage memory location.
39423944
/// This is only required for address-only scenarios; for loadable
39433945
/// references, it's better to use a ref_to_##name and a store.
3944-
#define NEVER_OR_SOMETIMES_LOADABLE_CHECKED_REF_STORAGE(Name, ...) \
3946+
#define NEVER_LOADABLE_CHECKED_REF_STORAGE(Name, ...) \
39453947
class Store##Name##Inst \
39463948
: public StoreReferenceInstBase<SILInstructionKind::Store##Name##Inst> { \
39473949
friend SILBuilder; \
39483950
Store##Name##Inst(SILDebugLocation loc, SILValue src, SILValue dest, \
39493951
IsInitialization_t isInit) \
39503952
: StoreReferenceInstBase(loc, src, dest, isInit) {} \
39513953
};
3954+
#define SOMETIMES_LOADABLE_CHECKED_REF_STORAGE(Name, ...) \
3955+
NEVER_LOADABLE_CHECKED_REF_STORAGE(Name, "...")
39523956
#include "swift/AST/ReferenceStorage.def"
39533957

39543958
/// CopyAddrInst - Represents a copy from one memory location to another. This
@@ -6328,8 +6332,9 @@ class Copy##Name##ValueInst \
63286332
SingleValueInstruction> { \
63296333
friend class SILBuilder; \
63306334
Copy##Name##ValueInst(SILDebugLocation DebugLoc, SILValue operand, \
6331-
SILType type) \
6332-
: UnaryInstructionBase(DebugLoc, operand, type) {} \
6335+
SILModule &M) \
6336+
: UnaryInstructionBase(DebugLoc, operand, \
6337+
operand->getType().getReferentType(M)) {} \
63336338
};
63346339
#include "swift/AST/ReferenceStorage.def"
63356340

branches/swift-5.1-old-llvm-branch/include/swift/SIL/SILModule.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -598,10 +598,7 @@ class SILModule {
598598

599599
/// Can value operations (copies and destroys) on the given lowered type
600600
/// be performed in this module?
601-
// FIXME: Expansion
602-
bool isTypeABIAccessible(SILType type,
603-
ResilienceExpansion forExpansion
604-
= ResilienceExpansion::Minimal);
601+
bool isTypeABIAccessible(SILType type);
605602

606603
/// Can type metadata for the given formal type be fetched in
607604
/// the given module?

branches/swift-5.1-old-llvm-branch/include/swift/SIL/SILType.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,12 @@ class SILType {
477477
/// representation. Class existentials do not always qualify.
478478
bool isHeapObjectReferenceType() const;
479479

480+
/// Return the SILType corresponding to the underlying type of the given
481+
/// metatype type.
482+
///
483+
/// *NOTE* Only call on SILTypes for metatype types.
484+
SILType getMetatypeInstanceType(SILModule& M) const;
485+
480486
/// Returns true if this SILType is an aggregate that contains \p Ty
481487
bool aggregateContainsRecord(SILType Ty, SILModule &SILMod) const;
482488

@@ -495,6 +501,10 @@ class SILType {
495501

496502
/// Returns true if this is the AnyObject SILType;
497503
bool isAnyObject() const { return getASTType()->isAnyObject(); }
504+
505+
/// Returns the underlying referent SILType of an @sil_unowned or @sil_weak
506+
/// Type.
507+
SILType getReferentType(SILModule &M) const;
498508

499509
/// Returns a SILType with any archetypes mapped out of context.
500510
SILType mapTypeOutOfContext() const;

0 commit comments

Comments
 (0)