Skip to content

Commit 4bc5a57

Browse files
committed
---
yaml --- r: 445649 b: refs/heads/master-rebranch c: aa4ff7c h: refs/heads/master i: 445647: f7d76ae
1 parent c03977e commit 4bc5a57

Some content is hidden

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

57 files changed

+285
-280
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: 5bdc5ccd61cd43217e4f4e3515e32eb45e728df0
1704+
refs/heads/master-rebranch: aa4ff7cfff16576eae11f9131ba74d0a1a3f1180
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/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::PointerUnion4<Box<clang::Decl>, Box<clang::MacroInfo>,
52-
Box<clang::ModuleMacro>, Box<clang::Module>> Ptr;
51+
llvm::PointerUnion<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/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

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

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

branches/master-rebranch/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.

branches/master-rebranch/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

branches/master-rebranch/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>

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(ParsedRawSyntaxNode &other) = delete;
102-
ParsedRawSyntaxNode &operator=(ParsedRawSyntaxNode &other) = delete;
101+
ParsedRawSyntaxNode(const ParsedRawSyntaxNode &other) = delete;
102+
ParsedRawSyntaxNode &operator=(const ParsedRawSyntaxNode &other) = delete;
103103

104104
public:
105105
ParsedRawSyntaxNode()

branches/master-rebranch/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::PointerUnion4<Stmt *, Expr *, Decl *, Pattern *>;
68+
using ASTNodeTy = llvm::PointerUnion<Stmt *, Expr *, Decl *, Pattern *>;
6969

7070
public:
7171
enum LocationKind : unsigned {

branches/master-rebranch/include/swift/SIL/SILNode.h

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

2020
#include "llvm/Support/Compiler.h"
2121
#include "llvm/ADT/DenseMapInfo.h"
22+
#include "llvm/Support/PointerLikeTypeTraits.h"
2223
#include "swift/Basic/InlineBitfield.h"
2324
#include "swift/Basic/LLVM.h"
2425
#include <type_traits>

branches/master-rebranch/lib/AST/ASTPrinter.cpp

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

branches/master-rebranch/lib/AST/Builtins.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,12 +1733,12 @@ Type IntrinsicTypeDecoder::decodeImmediate() {
17331733
IITDescriptor D = Table.front();
17341734
Table = Table.slice(1);
17351735
switch (D.Kind) {
1736+
case IITDescriptor::BFloat:
17361737
case IITDescriptor::MMX:
17371738
case IITDescriptor::Metadata:
17381739
case IITDescriptor::ExtendArgument:
17391740
case IITDescriptor::TruncArgument:
17401741
case IITDescriptor::HalfVecArgument:
1741-
case IITDescriptor::ScalableVecArgument:
17421742
case IITDescriptor::VarArg:
17431743
case IITDescriptor::Token:
17441744
case IITDescriptor::VecElementArgument:
@@ -1767,7 +1767,7 @@ Type IntrinsicTypeDecoder::decodeImmediate() {
17671767
case IITDescriptor::Vector: {
17681768
Type eltType = decodeImmediate();
17691769
if (!eltType) return Type();
1770-
return makeVector(eltType, D.Vector_Width);
1770+
return makeVector(eltType, D.Vector_Width.Min);
17711771
}
17721772

17731773
// A pointer to an immediate type.

branches/master-rebranch/lib/AST/Expr.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -831,16 +831,15 @@ APInt BuiltinIntegerWidth::parse(StringRef text, unsigned radix, bool negate,
831831
static APFloat getFloatLiteralValue(bool IsNegative, StringRef Text,
832832
const llvm::fltSemantics &Semantics) {
833833
APFloat Val(Semantics);
834-
llvm::Expected<APFloat::opStatus> MaybeRes =
835-
Val.convertFromString(Text, llvm::APFloat::rmNearestTiesToEven);
836-
assert(MaybeRes && *MaybeRes != APFloat::opInvalidOp &&
837-
"Sema didn't reject invalid number");
838-
(void)MaybeRes;
834+
auto Res =
835+
Val.convertFromString(Text, llvm::APFloat::rmNearestTiesToEven);
836+
assert(Res && "Sema didn't reject invalid number");
837+
consumeError(Res.takeError());
839838
if (IsNegative) {
840839
auto NegVal = APFloat::getZero(Semantics, /*negative*/ true);
841-
auto Res = NegVal.subtract(Val, llvm::APFloat::rmNearestTiesToEven);
842-
assert(Res != APFloat::opInvalidOp && "Sema didn't reject invalid number");
843-
(void)Res;
840+
Res = NegVal.subtract(Val, llvm::APFloat::rmNearestTiesToEven);
841+
assert(Res && "Sema didn't reject invalid number");
842+
consumeError(Res.takeError());
844843
return NegVal;
845844
}
846845
return Val;

branches/master-rebranch/lib/ClangImporter/ClangAdapter.cpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const clang::Decl *
8181
importer::getFirstNonLocalDecl(const clang::Decl *D) {
8282
D = D->getCanonicalDecl();
8383
auto iter = llvm::find_if(D->redecls(), [](const clang::Decl *next) -> bool {
84-
return !next->isLexicallyWithinFunctionOrMethod();
84+
return !next->isInLocalScope();
8585
});
8686
if (iter == D->redecls_end())
8787
return nullptr;
@@ -344,6 +344,7 @@ OmissionTypeName importer::getClangTypeNameForOmission(clang::ASTContext &ctx,
344344
case clang::BuiltinType::ARCUnbridgedCast:
345345
case clang::BuiltinType::BoundMember:
346346
case clang::BuiltinType::BuiltinFn:
347+
case clang::BuiltinType::IncompleteMatrixIdx:
347348
case clang::BuiltinType::Overload:
348349
case clang::BuiltinType::PseudoObject:
349350
case clang::BuiltinType::UnknownAny:
@@ -376,6 +377,7 @@ OmissionTypeName importer::getClangTypeNameForOmission(clang::ASTContext &ctx,
376377
case clang::BuiltinType::SatULongFract:
377378
case clang::BuiltinType::Half:
378379
case clang::BuiltinType::LongDouble:
380+
case clang::BuiltinType::BFloat16:
379381
case clang::BuiltinType::Float16:
380382
case clang::BuiltinType::Float128:
381383
case clang::BuiltinType::NullPtr:
@@ -446,21 +448,14 @@ OmissionTypeName importer::getClangTypeNameForOmission(clang::ASTContext &ctx,
446448

447449
// OpenMP types that don't have Swift equivalents.
448450
case clang::BuiltinType::OMPArraySection:
451+
case clang::BuiltinType::OMPArrayShaping:
452+
case clang::BuiltinType::OMPIterator:
449453
return OmissionTypeName();
450454

451455
// SVE builtin types that don't have Swift equivalents.
452-
case clang::BuiltinType::SveInt8:
453-
case clang::BuiltinType::SveInt16:
454-
case clang::BuiltinType::SveInt32:
455-
case clang::BuiltinType::SveInt64:
456-
case clang::BuiltinType::SveUint8:
457-
case clang::BuiltinType::SveUint16:
458-
case clang::BuiltinType::SveUint32:
459-
case clang::BuiltinType::SveUint64:
460-
case clang::BuiltinType::SveFloat16:
461-
case clang::BuiltinType::SveFloat32:
462-
case clang::BuiltinType::SveFloat64:
463-
case clang::BuiltinType::SveBool:
456+
#define SVE_TYPE(Name, Id, ...) \
457+
case clang::BuiltinType::Id:
458+
#include "clang/Basic/AArch64SVEACLETypes.def"
464459
return OmissionTypeName();
465460
}
466461
}

branches/master-rebranch/lib/ClangImporter/ClangImporter.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2889,12 +2889,14 @@ void ClangModuleUnit::lookupValue(DeclName name, NLKind lookupKind,
28892889
bool ClangImporter::Implementation::isVisibleClangEntry(
28902890
const clang::NamedDecl *clangDecl) {
28912891
// For a declaration, check whether the declaration is hidden.
2892-
if (!clangDecl->isHidden()) return true;
2892+
auto &clangSema = Instance->getSema();
2893+
if (clangSema.isVisible(clangDecl))
2894+
return true;
28932895

28942896
// Is any redeclaration visible?
2895-
for (auto redecl : clangDecl->redecls()) {
2896-
if (!cast<clang::NamedDecl>(redecl)->isHidden()) return true;
2897-
}
2897+
for (auto redecl : clangDecl->redecls())
2898+
if (clangSema.isVisible(cast<clang::NamedDecl>(redecl)))
2899+
return true;
28982900

28992901
return false;
29002902
}
@@ -3309,7 +3311,7 @@ StringRef ClangModuleUnit::getModuleDefiningPath() const {
33093311
return clangSourceMgr.getFilename(clangModule->DefinitionLoc);
33103312
}
33113313

3312-
Optional<clang::ExternalASTSource::ASTSourceDescriptor>
3314+
Optional<clang::ASTSourceDescriptor>
33133315
ClangModuleUnit::getASTSourceDescriptor() const {
33143316
if (clangModule) {
33153317
assert(ASTSourceDescriptor.getModuleOrNull() == clangModule);

branches/master-rebranch/lib/ClangImporter/ImportDecl.cpp

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#include "CFTypeInfo.h"
1818
#include "ImporterImpl.h"
19-
#include "swift/Strings.h"
2019
#include "swift/AST/ASTContext.h"
2120
#include "swift/AST/ASTMangler.h"
2221
#include "swift/AST/Attr.h"
@@ -36,15 +35,19 @@
3635
#include "swift/AST/PrettyStackTrace.h"
3736
#include "swift/AST/ProtocolConformance.h"
3837
#include "swift/AST/Stmt.h"
39-
#include "swift/AST/Types.h"
4038
#include "swift/AST/TypeCheckRequests.h"
39+
#include "swift/AST/Types.h"
4140
#include "swift/Basic/Defer.h"
4241
#include "swift/Basic/PrettyStackTrace.h"
42+
#include "swift/Basic/Statistic.h"
4343
#include "swift/ClangImporter/ClangModule.h"
44-
#include "swift/Parse/Lexer.h"
4544
#include "swift/Config.h"
45+
#include "swift/Parse/Lexer.h"
46+
#include "swift/Strings.h"
47+
4648
#include "clang/AST/ASTContext.h"
4749
#include "clang/AST/Attr.h"
50+
#include "clang/AST/DeclObjCCommon.h"
4851
#include "clang/AST/DeclCXX.h"
4952
#include "clang/Basic/CharInfo.h"
5053
#include "swift/Basic/Statistic.h"
@@ -379,6 +382,7 @@ getSwiftStdlibType(const clang::TypedefNameDecl *D,
379382
case clang::TargetInfo::VoidPtrBuiltinVaList:
380383
case clang::TargetInfo::PowerABIBuiltinVaList:
381384
case clang::TargetInfo::AAPCSABIBuiltinVaList:
385+
case clang::TargetInfo::HexagonBuiltinVaList:
382386
assert(ClangCtx.getTypeSize(ClangCtx.VoidPtrTy) == ClangTypeSize &&
383387
"expected va_list type to be sizeof(void *)");
384388
break;
@@ -1219,15 +1223,16 @@ makeBitFieldAccessors(ClangImporter::Implementation &Impl,
12191223
fieldType,
12201224
clang::VK_RValue,
12211225
clang::SourceLocation());
1222-
1223-
auto cSetterExpr = new (Ctx) clang::BinaryOperator(cSetterMemberExpr,
1224-
cSetterValueExpr,
1225-
clang::BO_Assign,
1226-
fieldType,
1227-
clang::VK_RValue,
1228-
clang::OK_Ordinary,
1229-
clang::SourceLocation(),
1230-
clang::FPOptions());
1226+
1227+
auto cSetterExpr = clang::BinaryOperator::Create(Ctx,
1228+
cSetterMemberExpr,
1229+
cSetterValueExpr,
1230+
clang::BO_Assign,
1231+
fieldType,
1232+
clang::VK_RValue,
1233+
clang::OK_Ordinary,
1234+
clang::SourceLocation(),
1235+
clang::FPOptions());
12311236

12321237
cSetterDecl->setBody(cSetterExpr);
12331238
}
@@ -2076,27 +2081,27 @@ classImplementsProtocol(const clang::ObjCInterfaceDecl *constInterface,
20762081

20772082
static void
20782083
applyPropertyOwnership(VarDecl *prop,
2079-
clang::ObjCPropertyDecl::PropertyAttributeKind attrs) {
2084+
clang::ObjCPropertyAttribute::Kind attrs) {
20802085
Type ty = prop->getInterfaceType();
20812086
if (auto innerTy = ty->getOptionalObjectType())
20822087
ty = innerTy;
20832088
if (!ty->is<GenericTypeParamType>() && !ty->isAnyClassReferenceType())
20842089
return;
20852090

20862091
ASTContext &ctx = prop->getASTContext();
2087-
if (attrs & clang::ObjCPropertyDecl::OBJC_PR_copy) {
2092+
if (attrs & clang::ObjCPropertyAttribute::kind_copy) {
20882093
prop->getAttrs().add(new (ctx) NSCopyingAttr(false));
20892094
return;
20902095
}
2091-
if (attrs & clang::ObjCPropertyDecl::OBJC_PR_weak) {
2096+
if (attrs & clang::ObjCPropertyAttribute::kind_weak) {
20922097
prop->getAttrs().add(new (ctx)
20932098
ReferenceOwnershipAttr(ReferenceOwnership::Weak));
20942099
prop->setInterfaceType(WeakStorageType::get(
20952100
prop->getInterfaceType(), ctx));
20962101
return;
20972102
}
2098-
if ((attrs & clang::ObjCPropertyDecl::OBJC_PR_assign) ||
2099-
(attrs & clang::ObjCPropertyDecl::OBJC_PR_unsafe_unretained)) {
2103+
if ((attrs & clang::ObjCPropertyAttribute::kind_assign) ||
2104+
(attrs & clang::ObjCPropertyAttribute::kind_unsafe_unretained)) {
21002105
prop->getAttrs().add(
21012106
new (ctx) ReferenceOwnershipAttr(ReferenceOwnership::Unmanaged));
21022107
prop->setInterfaceType(UnmanagedStorageType::get(

0 commit comments

Comments
 (0)