Skip to content

Commit 9bd3ed3

Browse files
authored
Merge pull request swiftlang#33731 from apple/master-rebranch
Merge master-rebranch into Swift master branch to support updating llvm-project update
2 parents ed5edb8 + e107182 commit 9bd3ed3

File tree

70 files changed

+403
-311
lines changed

Some content is hidden

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

70 files changed

+403
-311
lines changed

docs/Modules.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -441,10 +441,6 @@ Glossary
441441

442442
__ https://en.wikipedia.org/wiki/Name_mangling#C.2B.2B
443443

444-
module
445-
An entity containing the API for a library, to be `imported <import>` into
446-
a source file.
447-
448444
qualified name
449445
A multi-piece name like ``Foundation.NSWindow``, which names an entity
450446
within a particular context. This document is concerned with the case where
@@ -463,9 +459,3 @@ Glossary
463459
SIL
464460
"Swift Intermediate Language", a stable IR for the distribution of
465461
inlineable code.
466-
467-
468-
target
469-
A dynamic library, framework, plug-in, or application to be built.
470-
A natural LTO boundary, and roughly the same as what Xcode requires
471-
separate targets to build.

include/swift/AST/Builtins.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "llvm/Support/ErrorHandling.h"
2727

2828
namespace llvm {
29-
enum class AtomicOrdering;
29+
enum class AtomicOrdering : unsigned;
3030
}
3131

3232
namespace swift {

include/swift/AST/ClangNode.h

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

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

5555
public:
5656
ClangNode() = default;

include/swift/AST/ExtInfo.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
namespace clang {
3232
class Type;
33+
class ASTContext;
3334
} // namespace clang
3435

3536
namespace swift {
@@ -77,7 +78,7 @@ class ClangTypeInfo {
7778
/// Use the ClangModuleLoader to print the Clang type as a string.
7879
void printType(ClangModuleLoader *cml, llvm::raw_ostream &os) const;
7980

80-
void dump(llvm::raw_ostream &os) const;
81+
void dump(llvm::raw_ostream &os, const clang::ASTContext &ctx) const;
8182
};
8283

8384
// MARK: - FunctionTypeRepresentation

include/swift/AST/PrettyStackTrace.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
namespace clang {
2828
class Type;
29+
class ASTContext;
2930
}
3031

3132
namespace swift {
@@ -141,11 +142,13 @@ class PrettyStackTraceType : public llvm::PrettyStackTraceEntry {
141142
/// PrettyStackTraceClangType - Observe that we are processing a
142143
/// specific Clang type.
143144
class PrettyStackTraceClangType : public llvm::PrettyStackTraceEntry {
145+
const clang::ASTContext &Context;
144146
const clang::Type *TheType;
145147
const char *Action;
146148
public:
147-
PrettyStackTraceClangType(const char *action, const clang::Type *type)
148-
: TheType(type), Action(action) {}
149+
PrettyStackTraceClangType(clang::ASTContext &ctx,
150+
const char *action, const clang::Type *type)
151+
: Context(ctx), TheType(type), Action(action) {}
149152
virtual void print(llvm::raw_ostream &OS) const override;
150153
};
151154

include/swift/AST/SimpleRequest.h

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

include/swift/AST/SourceFile.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,9 +692,11 @@ struct DenseMapInfo<swift::SourceFile::ImportedModuleDesc> {
692692
StringRefDMI::getTombstoneKey());
693693
}
694694
static inline unsigned getHashValue(const ImportedModuleDesc &import) {
695-
return combineHashValue(ImportedModuleDMI::getHashValue(import.module),
696-
combineHashValue(ImportOptionsDMI::getHashValue(import.importOptions),
697-
StringRefDMI::getHashValue(import.filename)));
695+
return detail::combineHashValue(
696+
ImportedModuleDMI::getHashValue(import.module),
697+
detail::combineHashValue(
698+
ImportOptionsDMI::getHashValue(import.importOptions),
699+
StringRefDMI::getHashValue(import.filename)));
698700
}
699701
static bool isEqual(const ImportedModuleDesc &a,
700702
const ImportedModuleDesc &b) {

include/swift/Basic/STLExtras.h

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -69,51 +69,6 @@ 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-
11772
/// @{
11873

11974
/// 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,6 +19,7 @@
1919
#include "swift/AST/FileUnit.h"
2020
#include "swift/ClangImporter/ClangImporter.h"
2121
#include "clang/AST/ExternalASTSource.h"
22+
#include "clang/Basic/Module.h"
2223

2324
namespace clang {
2425
class ASTContext;
@@ -37,7 +38,7 @@ class ClangModuleUnit final : public LoadedFile {
3738
llvm::PointerIntPair<ModuleDecl *, 1, bool> overlayModule;
3839
mutable Optional<ArrayRef<ModuleDecl::ImportedModule>> importedModulesForLookup;
3940
/// The metadata of the underlying Clang module.
40-
clang::ExternalASTSource::ASTSourceDescriptor ASTSourceDescriptor;
41+
clang::ASTSourceDescriptor ASTSourceDescriptor;
4142

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

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

121121
virtual StringRef getModuleDefiningPath() const override;
122122

include/swift/Frontend/FrontendInputsAndOutputs.h

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

2122
#include <string>
2223
#include <vector>

0 commit comments

Comments
 (0)