Skip to content

Commit 68351d2

Browse files
committed
Revert "Merge remote-tracking branch 'origin/master-next'"
This reverts commit 1c9b090, reversing changes made to 3eb82c1.
1 parent 1c9b090 commit 68351d2

Some content is hidden

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

53 files changed

+233
-261
lines changed

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;

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

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) {

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.

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

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>

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()

include/swift/SIL/SILLocation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class SILLocation {
6565
using type = Pattern;
6666
};
6767

68-
using ASTNodeTy = llvm::PointerUnion<Stmt *, Expr *, Decl *, Pattern *>;
68+
using ASTNodeTy = llvm::PointerUnion4<Stmt *, Expr *, Decl *, Pattern *>;
6969

7070
public:
7171
enum LocationKind : unsigned {

include/swift/SIL/SILNode.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#include "llvm/Support/Compiler.h"
2121
#include "llvm/ADT/DenseMapInfo.h"
22-
#include "llvm/Support/PointerLikeTypeTraits.h"
2322
#include "swift/Basic/InlineBitfield.h"
2423
#include "swift/Basic/LLVM.h"
2524
#include <type_traits>

lib/AST/ASTPrinter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
#include "clang/AST/Decl.h"
4848
#include "clang/AST/DeclObjC.h"
4949
#include "clang/Basic/Module.h"
50-
#include "clang/Basic/SourceManager.h"
5150
#include "llvm/ADT/StringSwitch.h"
5251
#include "llvm/Support/Compiler.h"
5352
#include "llvm/Support/ConvertUTF.h"

0 commit comments

Comments
 (0)