Skip to content

Commit 0a3fb6c

Browse files
committed
---
yaml --- r: 445642 b: refs/heads/master-rebranch c: ec9cd91 h: refs/heads/master
1 parent 109adfa commit 0a3fb6c

File tree

89 files changed

+512
-711
lines changed

Some content is hidden

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

89 files changed

+512
-711
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1701,7 +1701,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-12-19-a: 550bd4128211e1135c31ab186d2a9
17011701
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-12-20-a: f3e865a19683d7e9664718c41e4e956686efb1b3
17021702
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-12-21-a: 0852188b163c7ebd7054379e729cedc41c361f95
17031703
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-12-22-a: 4832e0c5e8723b7b4a2c626ac6a8a523576f1317
1704-
refs/heads/master-rebranch: 518bbb3d40b3c6c55ca6baff239ee3117427d3e1
1704+
refs/heads/master-rebranch: ec9cd91c1b11884f68d640da025a0625fa49878a
17051705
refs/heads/revert-29064-handle-csdiag-coerce-diagnostics: 69656f1629e2cde21bb7f44179c535c1f3ad5dfd
17061706
refs/heads/swift-5.1-DEVELOPMENT-SNAPSHOT-2018-11-16-a: 51fe19105062bb86b997c7698bb3f83ffc536d2c
17071707
refs/heads/tgmath-derivatives-wip: 00adac82d118281f701c26fe8702ecb4bbe33e82

branches/master-rebranch/include/swift/AST/CMakeLists.txt

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

branches/master-rebranch/include/swift/AST/ClangNode.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ class ClangNode {
4848
template <typename T>
4949
using Box = detail::ClangNodeBox<T>;
5050

51-
llvm::PointerUnion<Box<clang::Decl>, Box<clang::MacroInfo>,
52-
Box<clang::ModuleMacro>, Box<clang::Module>> Ptr;
51+
llvm::PointerUnion4<Box<clang::Decl>, Box<clang::MacroInfo>,
52+
Box<clang::ModuleMacro>, Box<clang::Module>> Ptr;
5353

5454
public:
5555
ClangNode() = default;

branches/master-rebranch/include/swift/AST/DiagnosticEngine.h

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@ namespace swift {
5858
DiagID ID;
5959
};
6060

61-
struct DiagnosticNode {
62-
DiagID id;
63-
std::string msg;
64-
};
65-
6661
namespace detail {
6762
/// Describes how to pass a diagnostic argument of the given type.
6863
///
@@ -634,26 +629,7 @@ namespace swift {
634629
DiagnosticState(DiagnosticState &&) = default;
635630
DiagnosticState &operator=(DiagnosticState &&) = default;
636631
};
637-
638-
class LocalizationProducer {
639-
public:
640-
/// If the message isn't available/localized in the current `yaml` file,
641-
/// return the fallback default message.
642-
virtual std::string getMessageOr(DiagID id,
643-
std::string defaultMessage) const {
644-
return defaultMessage;
645-
}
646-
647-
virtual ~LocalizationProducer() {}
648-
};
649-
650-
class YAMLLocalizationProducer final : public LocalizationProducer {
651-
public:
652-
std::vector<std::string> diagnostics;
653-
explicit YAMLLocalizationProducer(std::string locale, std::string path);
654-
std::string getMessageOr(DiagID id,
655-
std::string defaultMessage) const override;
656-
};
632+
657633
/// Class responsible for formatting diagnostics and presenting them
658634
/// to the user.
659635
class DiagnosticEngine {
@@ -687,10 +663,6 @@ namespace swift {
687663
/// but rather stored until all transactions complete.
688664
llvm::StringSet<llvm::BumpPtrAllocator &> TransactionStrings;
689665

690-
/// Diagnostic producer to handle the logic behind retriving a localized
691-
/// diagnostic message.
692-
std::unique_ptr<LocalizationProducer> localization;
693-
694666
/// The number of open diagnostic transactions. Diagnostics are only
695667
/// emitted once all transactions have closed.
696668
unsigned TransactionCount = 0;
@@ -762,11 +734,6 @@ namespace swift {
762734
return diagnosticDocumentationPath;
763735
}
764736

765-
void setLocalization(std::string locale, std::string path) {
766-
if (!locale.empty() && !path.empty())
767-
localization = std::make_unique<YAMLLocalizationProducer>(locale, path);
768-
}
769-
770737
void ignoreDiagnostic(DiagID id) {
771738
state.setDiagnosticBehavior(id, DiagnosticState::Behavior::Ignore);
772739
}
@@ -988,7 +955,8 @@ namespace swift {
988955
void emitTentativeDiagnostics();
989956

990957
public:
991-
const char *diagnosticStringFor(const DiagID id, bool printDiagnosticName);
958+
static const char *diagnosticStringFor(const DiagID id,
959+
bool printDiagnosticName);
992960

993961
/// If there is no clear .dia file for a diagnostic, put it in the one
994962
/// corresponding to the SourceLoc given here.

branches/master-rebranch/include/swift/AST/DiagnosticMessageFormat.h

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

branches/master-rebranch/include/swift/AST/Diagnostics/fr.yaml

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

branches/master-rebranch/include/swift/AST/DiagnosticsFrontend.def

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,14 @@ ERROR(previous_installname_map_corrupted,none,
251251
"previous install name map from %0 is malformed",
252252
(StringRef))
253253

254+
ERROR(explicit_swift_module_map_missing,none,
255+
"cannot open explicit Swift module map from %0",
256+
(StringRef))
257+
258+
ERROR(explicit_swift_module_map_corrupted,none,
259+
"explicit Swift module map from %0 is malformed",
260+
(StringRef))
261+
254262
REMARK(default_previous_install_name, none,
255263
"default previous install name for %0 is %1", (StringRef, StringRef))
256264

branches/master-rebranch/include/swift/AST/SearchPathOptions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ class SearchPathOptions {
8585
/// The paths to a set of explicitly built modules from interfaces.
8686
std::vector<std::string> ExplicitSwiftModules;
8787

88+
/// A map of explict Swift module information.
89+
std::string ExplicitSwiftModuleMap;
8890
private:
8991
static StringRef
9092
pathStringFromFrameworkSearchPath(const FrameworkSearchPath &next) {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include "swift/Basic/TypeID.h"
2525
#include "llvm/ADT/Hashing.h"
2626
#include "llvm/ADT/STLExtras.h"
27-
#include "llvm/Support/Error.h"
2827
#include <tuple>
2928
#include <type_traits>
3029

branches/master-rebranch/include/swift/AST/SourceFile.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -688,11 +688,9 @@ struct DenseMapInfo<swift::SourceFile::ImportedModuleDesc> {
688688
StringRefDMI::getTombstoneKey());
689689
}
690690
static inline unsigned getHashValue(const ImportedModuleDesc &import) {
691-
return detail::combineHashValue(
692-
ImportedModuleDMI::getHashValue(import.module),
693-
detail::combineHashValue(
694-
ImportOptionsDMI::getHashValue(import.importOptions),
695-
StringRefDMI::getHashValue(import.filename)));
691+
return combineHashValue(ImportedModuleDMI::getHashValue(import.module),
692+
combineHashValue(ImportOptionsDMI::getHashValue(import.importOptions),
693+
StringRefDMI::getHashValue(import.filename)));
696694
}
697695
static bool isEqual(const ImportedModuleDesc &a,
698696
const ImportedModuleDesc &b) {

branches/master-rebranch/include/swift/AST/diagnostics/en.yaml

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

branches/master-rebranch/include/swift/Basic/STLExtras.h

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,51 @@ struct function_traits<R (T::*)(Args...) const> {
6969
using argument_types = std::tuple<Args...>;
7070
};
7171

72+
} // end namespace swift
73+
74+
#if !defined(swiftCore_EXPORTS)
75+
namespace llvm {
76+
77+
/// @{
78+
79+
/// An STL-style algorithm similar to std::for_each that applies a second
80+
/// functor between every pair of elements.
81+
///
82+
/// This provides the control flow logic to, for example, print a
83+
/// comma-separated list:
84+
/// \code
85+
/// interleave(names.begin(), names.end(),
86+
/// [&](StringRef name) { OS << name; },
87+
/// [&] { OS << ", "; });
88+
/// \endcode
89+
template <typename ForwardIterator, typename UnaryFunctor,
90+
typename NullaryFunctor>
91+
inline void interleave(ForwardIterator begin, ForwardIterator end,
92+
UnaryFunctor each_fn,
93+
NullaryFunctor between_fn) {
94+
if (begin == end)
95+
return;
96+
each_fn(*begin);
97+
++begin;
98+
for (; begin != end; ++begin) {
99+
between_fn();
100+
each_fn(*begin);
101+
}
102+
}
103+
104+
template <typename Container, typename UnaryFunctor, typename NullaryFunctor>
105+
inline void interleave(const Container &c, UnaryFunctor each_fn,
106+
NullaryFunctor between_fn) {
107+
interleave(c.begin(), c.end(), each_fn, between_fn);
108+
}
109+
110+
/// @}
111+
112+
} // end namespace llvm
113+
#endif
114+
115+
namespace swift {
116+
72117
/// @{
73118

74119
/// The equivalent of std::for_each, but for two lists at once.

branches/master-rebranch/include/swift/ClangImporter/ClangModule.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "swift/AST/FileUnit.h"
2020
#include "swift/ClangImporter/ClangImporter.h"
2121
#include "clang/AST/ExternalASTSource.h"
22-
#include "clang/Basic/Module.h"
2322

2423
namespace clang {
2524
class ASTContext;
@@ -38,7 +37,7 @@ class ClangModuleUnit final : public LoadedFile {
3837
llvm::PointerIntPair<ModuleDecl *, 1, bool> overlayModule;
3938
mutable Optional<ArrayRef<ModuleDecl::ImportedModule>> importedModulesForLookup;
4039
/// The metadata of the underlying Clang module.
41-
clang::ASTSourceDescriptor ASTSourceDescriptor;
40+
clang::ExternalASTSource::ASTSourceDescriptor ASTSourceDescriptor;
4241

4342
public:
4443
/// True if the given Module contains an imported Clang module unit.
@@ -116,7 +115,8 @@ class ClangModuleUnit final : public LoadedFile {
116115

117116
/// Returns the ASTSourceDescriptor of the associated Clang module if one
118117
/// exists.
119-
Optional<clang::ASTSourceDescriptor> getASTSourceDescriptor() const;
118+
Optional<clang::ExternalASTSource::ASTSourceDescriptor>
119+
getASTSourceDescriptor() const;
120120

121121
virtual StringRef getModuleDefiningPath() const override;
122122

branches/master-rebranch/include/swift/Frontend/FrontendInputsAndOutputs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "swift/Basic/SupplementaryOutputPaths.h"
1818
#include "swift/Frontend/InputFile.h"
1919
#include "llvm/ADT/Hashing.h"
20-
#include "llvm/ADT/StringMap.h"
2120

2221
#include <string>
2322
#include <vector>

branches/master-rebranch/include/swift/Frontend/ModuleInterfaceLoader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ class ExplicitSwiftModuleLoader: public SerializedModuleLoaderBase {
150150
create(ASTContext &ctx,
151151
DependencyTracker *tracker, ModuleLoadingMode loadMode,
152152
ArrayRef<std::string> ExplicitModulePaths,
153+
StringRef ExplicitSwiftModuleMap,
153154
bool IgnoreSwiftSourceInfoFile);
154155

155156
/// Append visible module names to \p names. Note that names are possibly

branches/master-rebranch/include/swift/Option/FrontendOptions.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@ def disable_implicit_swift_modules: Flag<["-"], "disable-implicit-swift-modules"
220220
def swift_module_file
221221
: Separate<["-"], "swift-module-file">, MetaVarName<"<path>">,
222222
HelpText<"Specify Swift module explicitly built from textual interface">;
223+
224+
def explict_swift_module_map
225+
: Separate<["-"], "explicit-swift-module-map-file">, MetaVarName<"<path>">,
226+
HelpText<"Specify a JSON file containing information of explict Swift modules">;
223227
}
224228

225229

branches/master-rebranch/include/swift/Parse/ParsedRawSyntaxNode.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ class ParsedRawSyntaxNode {
9898
assert(DeferredToken.NumTrailingTrivia == numTrailingTrivia &&
9999
"numLeadingTrivia is too large value!");
100100
}
101-
ParsedRawSyntaxNode(const ParsedRawSyntaxNode &other) = delete;
102-
ParsedRawSyntaxNode &operator=(const ParsedRawSyntaxNode &other) = delete;
101+
ParsedRawSyntaxNode(ParsedRawSyntaxNode &other) = delete;
102+
ParsedRawSyntaxNode &operator=(ParsedRawSyntaxNode &other) = delete;
103103

104104
public:
105105
ParsedRawSyntaxNode()

branches/master-rebranch/include/swift/Reflection/ReflectionContext.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -838,18 +838,6 @@ class ReflectionContext
838838
return 0;
839839
}
840840

841-
/// Get the name of a metadata tag, if known.
842-
llvm::Optional<std::string> metadataAllocationTagName(int Tag) {
843-
switch (Tag) {
844-
#define TAG(name, value) \
845-
case value: \
846-
return std::string(#name);
847-
#include "../../../stdlib/public/runtime/MetadataAllocatorTags.def"
848-
default:
849-
return llvm::None;
850-
}
851-
}
852-
853841
/// Iterate the metadata allocations in the target process, calling Call with
854842
/// each allocation found. Returns None on success, and a string describing
855843
/// the error on failure.

branches/master-rebranch/include/swift/Runtime/Metadata.h

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,29 @@ namespace swift {
2929
// allocator. This is encoded in a header on each allocation when metadata
3030
// iteration is enabled, and allows tools to know where each allocation came
3131
// from.
32+
//
33+
// Some of these values are also declared in SwiftRemoteMirrorTypes.h. Those
34+
// values must be kept stable to preserve compatibility.
3235
enum MetadataAllocatorTags : uint16_t {
33-
#define TAG(name, value) name##Tag = value,
34-
#include "../../../stdlib/public/runtime/MetadataAllocatorTags.def"
36+
UnusedTag = 0,
37+
BoxesTag,
38+
ObjCClassWrappersTag,
39+
FunctionTypesTag,
40+
MetatypeTypesTag,
41+
ExistentialMetatypeValueWitnessTablesTag,
42+
ExistentialMetatypesTag,
43+
ExistentialTypesTag,
44+
OpaqueExistentialValueWitnessTablesTag,
45+
ClassExistentialValueWitnessTablesTag,
46+
ForeignWitnessTablesTag,
47+
ResilientMetadataAllocatorTag,
48+
MetadataTag,
49+
TupleCacheTag,
50+
GenericMetadataCacheTag,
51+
ForeignMetadataCacheTag,
52+
GenericWitnessTableCacheTag,
53+
GenericClassMetadataTag,
54+
GenericValueMetadataTag,
3555
};
3656

3757
template <typename Runtime> struct MetadataAllocationBacktraceHeader {

0 commit comments

Comments
 (0)