Skip to content

Commit d22e3a8

Browse files
---
yaml --- r: 445650 b: refs/heads/master-rebranch c: 3e0e8ce h: refs/heads/master
1 parent 4bc5a57 commit d22e3a8

File tree

125 files changed

+522
-1213
lines changed

Some content is hidden

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

125 files changed

+522
-1213
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: aa4ff7cfff16576eae11f9131ba74d0a1a3f1180
1704+
refs/heads/master-rebranch: 3e0e8cec7a5129f3cb7495bbb371085608f52a2f
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/ASTContext.h

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,11 @@ class ASTContext final {
254254
/// The request-evaluator that is used to process various requests.
255255
Evaluator evaluator;
256256

257+
/// The set of top-level modules we have loaded.
258+
/// This map is used for iteration, therefore it's a MapVector and not a
259+
/// DenseMap.
260+
llvm::MapVector<Identifier, ModuleDecl*> LoadedModules;
261+
257262
/// The builtin module.
258263
ModuleDecl * const TheBuiltinModule;
259264

@@ -782,24 +787,8 @@ class ASTContext final {
782787
/// The loader is owned by the AST context.
783788
ClangModuleLoader *getDWARFModuleLoader() const;
784789

785-
public:
786790
namelookup::ImportCache &getImportCache() const;
787791

788-
/// Returns an iterator over the modules that are known by this context
789-
/// to be loaded.
790-
///
791-
/// Iteration order is guaranteed to match the order in which
792-
/// \c addLoadedModule was called to register the loaded module
793-
/// with this context.
794-
iterator_range<llvm::MapVector<Identifier, ModuleDecl *>::const_iterator>
795-
getLoadedModules() const;
796-
797-
/// Returns the number of loaded modules known by this context to be loaded.
798-
unsigned getNumLoadedModules() const {
799-
auto eltRange = getLoadedModules();
800-
return std::distance(eltRange.begin(), eltRange.end());
801-
}
802-
803792
/// Asks every module loader to verify the ASTs it has loaded.
804793
///
805794
/// Does nothing in non-asserts (NDEBUG) builds.
@@ -839,11 +828,6 @@ class ASTContext final {
839828
return const_cast<ASTContext *>(this)->getStdlibModule(false);
840829
}
841830

842-
/// Insert an externally-sourced module into the set of known loaded modules
843-
/// in this context.
844-
void addLoadedModule(ModuleDecl *M);
845-
846-
public:
847831
/// Retrieve the current generation number, which reflects the
848832
/// number of times a module import has caused mass invalidation of
849833
/// lookup tables.

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: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,6 @@ 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-
262254
REMARK(default_previous_install_name, none,
263255
"default previous install name for %0 is %1", (StringRef, StringRef))
264256

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "swift/Basic/Range.h"
2020
#include "swift/Basic/ReferenceDependencyKeys.h"
2121
#include "llvm/ADT/Hashing.h"
22-
#include "llvm/ADT/SetVector.h"
2322
#include "llvm/Support/MD5.h"
2423
#include "llvm/Support/MemoryBuffer.h"
2524
#include "llvm/Support/YAMLParser.h"
@@ -685,7 +684,7 @@ class SourceFileDepGraphNode : public DepGraphNode {
685684
size_t sequenceNumber = ~0;
686685

687686
/// Holds the sequence numbers of definitions I depend upon.
688-
llvm::SetVector<size_t> defsIDependUpon;
687+
std::unordered_set<size_t> defsIDependUpon;
689688

690689
/// True iff a Decl exists for this node.
691690
/// If a provides and a depends in the existing system both have the same key,

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ 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;
9088
private:
9189
static StringRef
9290
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ class ExplicitSwiftModuleLoader: public SerializedModuleLoaderBase {
150150
create(ASTContext &ctx,
151151
DependencyTracker *tracker, ModuleLoadingMode loadMode,
152152
ArrayRef<std::string> ExplicitModulePaths,
153-
StringRef ExplicitSwiftModuleMap,
154153
bool IgnoreSwiftSourceInfoFile);
155154

156155
/// Append visible module names to \p names. Note that names are possibly
@@ -245,6 +244,7 @@ struct InterfaceSubContextDelegateImpl: InterfaceSubContextDelegate {
245244
llvm::StringSaver ArgSaver;
246245
std::vector<StringRef> GenericArgs;
247246
CompilerInvocation subInvocation;
247+
std::vector<SupplementaryOutputPaths> ModuleOutputPaths;
248248

249249
template<typename ...ArgTypes>
250250
InFlightDiagnostic diagnose(StringRef interfacePath,

0 commit comments

Comments
 (0)