Skip to content

Commit 2592581

Browse files
committed
---
yaml --- r: 647906 b: refs/heads/next c: 764c642 h: refs/heads/main
1 parent 32617e2 commit 2592581

File tree

76 files changed

+298
-365
lines changed

Some content is hidden

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

76 files changed

+298
-365
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1978,7 +1978,7 @@ refs/heads/coself-changelog: 3bd62cdc8f0132c4a9246645a85554318f5103c3
19781978
refs/heads/forward-mode-control-flow: 92f14e48316bf17ffc3fd549dae6626b7c8e53dd
19791979
refs/heads/lift-distance-precondition: df891a0b38f5f11cc5cc0ec0df283407c8274a4e
19801980
refs/heads/marcrasi-delete-hardcoded-tv-conformances: ca5de96a06712ee2f3fc1848986bc203ad58ae3d
1981-
refs/heads/next: 6ca7366cd82fcd31671d5de96769e8893d73b9e2
1981+
refs/heads/next: 764c642cc295406b575040d01f2300a2db219b0c
19821982
refs/heads/release/5.3-20201012: 3c8a284dd0543aab933e82cd05da661cb686c9e7
19831983
refs/heads/revert-33106-moveomecf: 74db018e58162cd6f9f7fd84339397c99a399a5a
19841984
refs/heads/revert-33205-ometofunctionpass: 6f30093f96bc03eaf61bc1bbf02f08ca9053dec1

branches/next/include/swift/AST/AutoDiff.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ using swift::SILFunctionType;
705705
using swift::DifferentiabilityKind;
706706
using swift::SILDifferentiabilityWitnessKey;
707707

708-
template <typename T> struct DenseMapInfo;
708+
template <typename T, typename Enable> struct DenseMapInfo;
709709

710710
template <> struct DenseMapInfo<AutoDiffConfig> {
711711
static AutoDiffConfig getEmptyKey() {

branches/next/include/swift/Basic/APIntMap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ struct WidthPreservingAPIntDenseMapInfo {
3838
}
3939

4040
static unsigned getHashValue(const APInt &Key) {
41-
return static_cast<unsigned>(hash_value(Key));
41+
return llvm::DenseMapInfo<APInt>::getHashValue(Key);
4242
}
4343

4444
static bool isEqual(const APInt &LHS, const APInt &RHS) {
45-
return LHS.getBitWidth() == RHS.getBitWidth() && LHS == RHS;
45+
return llvm::DenseMapInfo<APInt>::isEqual(LHS, RHS);
4646
}
4747
};
4848

branches/next/include/swift/Basic/ExponentialGrowthAppendingBinaryByteStream.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,29 @@ class ExponentialGrowthAppendingBinaryByteStream
4242

4343
llvm::support::endianness getEndian() const override { return Endian; }
4444

45-
llvm::Error readBytes(uint32_t Offset, uint32_t Size,
45+
llvm::Error readBytes(uint64_t Offset, uint64_t Size,
4646
ArrayRef<uint8_t> &Buffer) override;
4747

48-
llvm::Error readLongestContiguousChunk(uint32_t Offset,
48+
llvm::Error readLongestContiguousChunk(uint64_t Offset,
4949
ArrayRef<uint8_t> &Buffer) override;
5050

5151
MutableArrayRef<uint8_t> data() { return Data; }
5252

53-
uint32_t getLength() override { return Data.size(); }
53+
uint64_t getLength() override { return Data.size(); }
5454

55-
llvm::Error writeBytes(uint32_t Offset, ArrayRef<uint8_t> Buffer) override;
55+
llvm::Error writeBytes(uint64_t Offset, ArrayRef<uint8_t> Buffer) override;
5656

5757
/// This is an optimized version of \c writeBytes specifically for integers.
5858
/// Integers are written in little-endian byte order.
5959
template<typename T>
60-
llvm::Error writeInteger(uint32_t Offset, T Value) {
60+
llvm::Error writeInteger(uint64_t Offset, T Value) {
6161
static_assert(std::is_integral<T>::value, "Integer required.");
6262
if (auto Error = checkOffsetForWrite(Offset, sizeof(T))) {
6363
return Error;
6464
}
6565

6666
// Resize the internal buffer if needed.
67-
uint32_t RequiredSize = Offset + sizeof(T);
67+
uint64_t RequiredSize = Offset + sizeof(T);
6868
if (RequiredSize > Data.size()) {
6969
Data.resize(RequiredSize);
7070
}

branches/next/include/swift/Basic/Located.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ bool operator ==(const Located<T> &lhs, const Located<T> &rhs) {
5555

5656
namespace llvm {
5757

58-
template <typename T> struct DenseMapInfo;
58+
template <typename T, typename Enable> struct DenseMapInfo;
5959

6060
template<typename T>
6161
struct DenseMapInfo<swift::Located<T>> {

branches/next/include/swift/Basic/SourceLoc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ class CharSourceRange {
246246
} // end namespace swift
247247

248248
namespace llvm {
249-
template <typename T> struct DenseMapInfo;
249+
template <typename T, typename Enable> struct DenseMapInfo;
250250

251251
template <> struct DenseMapInfo<swift::SourceLoc> {
252252
static swift::SourceLoc getEmptyKey() {

branches/next/include/swift/Demangling/TypeLookupError.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include "swift/Basic/TaggedUnion.h"
2222
#include "swift/Runtime/Portability.h"
23-
#include <string.h>
23+
#include <string>
2424

2525
namespace swift {
2626

branches/next/lib/AST/Availability.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ ASTContext::getSwift5PlusAvailability(llvm::VersionTuple swiftVersion) {
506506
default: break;
507507
}
508508
}
509-
llvm::report_fatal_error("Missing call to getSwiftXYAvailability for Swift " +
510-
swiftVersion.getAsString());
509+
llvm::report_fatal_error(
510+
Twine("Missing call to getSwiftXYAvailability for Swift ") +
511+
swiftVersion.getAsString());
511512
}

branches/next/lib/AST/Builtins.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2098,6 +2098,7 @@ Type IntrinsicTypeDecoder::decodeImmediate() {
20982098
case IITDescriptor::VecOfBitcastsToInt:
20992099
case IITDescriptor::Subdivide2Argument:
21002100
case IITDescriptor::Subdivide4Argument:
2101+
case IITDescriptor::PPCQuad:
21012102
// These types cannot be expressed in swift yet.
21022103
return Type();
21032104

@@ -2208,18 +2209,17 @@ getSwiftFunctionTypeForIntrinsic(llvm::Intrinsic::ID ID,
22082209
return false;
22092210
ArgElts.push_back(ArgTy);
22102211
}
2211-
2212+
22122213
// Translate LLVM function attributes to Swift function attributes.
22132214
IntrinsicInfo II;
22142215
II.ID = ID;
22152216
auto attrs = II.getOrCreateAttributes(Context);
2216-
if (attrs.hasAttribute(llvm::AttributeList::FunctionIndex,
2217-
llvm::Attribute::NoReturn)) {
2217+
if (attrs.hasFnAttr(llvm::Attribute::NoReturn)) {
22182218
ResultTy = Context.getNeverType();
22192219
if (!ResultTy)
22202220
return false;
22212221
}
2222-
2222+
22232223
return true;
22242224
}
22252225

branches/next/lib/Basic/ExponentialGrowthAppendingBinaryByteStream.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ using namespace llvm;
1616
using namespace swift;
1717

1818
Error ExponentialGrowthAppendingBinaryByteStream::readBytes(
19-
uint32_t Offset, uint32_t Size, ArrayRef<uint8_t> &Buffer) {
19+
uint64_t Offset, uint64_t Size, ArrayRef<uint8_t> &Buffer) {
2020
if (auto Error = checkOffsetForRead(Offset, Size)) {
2121
return Error;
2222
}
@@ -26,7 +26,7 @@ Error ExponentialGrowthAppendingBinaryByteStream::readBytes(
2626
}
2727

2828
Error ExponentialGrowthAppendingBinaryByteStream::readLongestContiguousChunk(
29-
uint32_t Offset, ArrayRef<uint8_t> &Buffer) {
29+
uint64_t Offset, ArrayRef<uint8_t> &Buffer) {
3030
if (auto Error = checkOffsetForRead(Offset, 0)) {
3131
return Error;
3232
}
@@ -40,7 +40,7 @@ void ExponentialGrowthAppendingBinaryByteStream::reserve(size_t Size) {
4040
}
4141

4242
Error ExponentialGrowthAppendingBinaryByteStream::writeBytes(
43-
uint32_t Offset, ArrayRef<uint8_t> Buffer) {
43+
uint64_t Offset, ArrayRef<uint8_t> Buffer) {
4444
if (Buffer.empty())
4545
return Error::success();
4646

@@ -49,7 +49,7 @@ Error ExponentialGrowthAppendingBinaryByteStream::writeBytes(
4949
}
5050

5151
// Resize the internal buffer if needed.
52-
uint32_t RequiredSize = Offset + Buffer.size();
52+
uint64_t RequiredSize = Offset + Buffer.size();
5353
if (RequiredSize > Data.size()) {
5454
Data.resize(RequiredSize);
5555
}

branches/next/lib/ClangImporter/CFTypeInfo.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
//
1515
//===----------------------------------------------------------------------===//
1616
#ifndef SWIFT_IMPORTER_CFTYPEINFO_H
17-
#define SWIFT_IMPORTER_CFTYPEINFO_H
17+
#define SWIFT_IMPORTER_CFTYPEINFO_H
1818

1919
#include "llvm/ADT/PointerUnion.h"
20+
#include "llvm/ADT/StringRef.h"
2021

2122
namespace clang {
2223
class RecordDecl;

branches/next/lib/ClangImporter/ClangAdapter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ OmissionTypeName importer::getClangTypeNameForOmission(clang::ASTContext &ctx,
396396
case clang::BuiltinType::Float16:
397397
case clang::BuiltinType::Float128:
398398
case clang::BuiltinType::NullPtr:
399+
case clang::BuiltinType::Ibm128:
399400
return OmissionTypeName();
400401

401402
// Objective-C types that aren't mapped directly; rather, pointers to

branches/next/lib/ClangImporter/ClangImporter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,10 @@ ClangImporter::create(ASTContext &ctx,
11301130

11311131
// Create a compiler instance.
11321132
{
1133+
// The Clang modules produced by ClangImporter are always embedded in an
1134+
// ObjectFilePCHContainer and contain -gmodules debug info.
1135+
importer->Impl.Invocation->getCodeGenOpts().DebugTypeExtRefs = true;
1136+
11331137
auto PCHContainerOperations =
11341138
std::make_shared<clang::PCHContainerOperations>();
11351139
PCHContainerOperations->registerWriter(

branches/next/lib/ClangImporter/ImportType.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ namespace {
289289
case clang::BuiltinType::Float128:
290290
case clang::BuiltinType::NullPtr:
291291
case clang::BuiltinType::Char8:
292+
case clang::BuiltinType::Ibm128:
292293
return Type();
293294

294295
// Objective-C types that aren't mapped directly; rather, pointers to

branches/next/lib/ClangImporter/ImporterImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1738,7 +1738,7 @@ class SwiftNameLookupExtension : public clang::ModuleFileExtension {
17381738
buffersForDiagnostics(buffersForDiagnostics), availability(avail) {}
17391739

17401740
clang::ModuleFileExtensionMetadata getExtensionMetadata() const override;
1741-
llvm::hash_code hashExtension(llvm::hash_code code) const override;
1741+
void hashExtension(ExtensionHashBuilder &HBuilder) const override;
17421742

17431743
std::unique_ptr<clang::ModuleFileExtensionWriter>
17441744
createExtensionWriter(clang::ASTWriter &writer) override;

branches/next/lib/ClangImporter/SwiftLookupTable.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,12 +1849,12 @@ SwiftNameLookupExtension::getExtensionMetadata() const {
18491849
return metadata;
18501850
}
18511851

1852-
llvm::hash_code
1853-
SwiftNameLookupExtension::hashExtension(llvm::hash_code code) const {
1854-
return llvm::hash_combine(code, StringRef("swift.lookup"),
1855-
SWIFT_LOOKUP_TABLE_VERSION_MAJOR,
1856-
SWIFT_LOOKUP_TABLE_VERSION_MINOR,
1857-
version::getSwiftFullVersion());
1852+
void
1853+
SwiftNameLookupExtension::hashExtension(ExtensionHashBuilder &HBuilder) const {
1854+
HBuilder.add(StringRef("swift.lookup"));
1855+
HBuilder.add(SWIFT_LOOKUP_TABLE_VERSION_MAJOR);
1856+
HBuilder.add(SWIFT_LOOKUP_TABLE_VERSION_MINOR);
1857+
HBuilder.add(version::getSwiftFullVersion());
18581858
}
18591859

18601860
void importer::addEntryToLookupTable(SwiftLookupTable &table,

branches/next/lib/Demangling/Demangler.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,8 @@ static bool isRequirement(Node::Kind kind) {
9191
// Public utility functions //
9292
//////////////////////////////////
9393

94-
LLVM_ATTRIBUTE_NORETURN void swift::Demangle::failAssert(const char *file,
95-
unsigned line,
96-
NodePointer node,
97-
const char *expr) {
94+
void swift::Demangle::failAssert(const char *file, unsigned line,
95+
NodePointer node, const char *expr) {
9896
fprintf(stderr, "%s:%u: assertion failed for Node %p: %s", file, line, node,
9997
expr);
10098
abort();

branches/next/lib/Demangling/DemanglerAssert.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ namespace swift {
5151
namespace Demangle {
5252
SWIFT_BEGIN_INLINE_NAMESPACE
5353

54-
LLVM_ATTRIBUTE_NORETURN void failAssert(const char *file, unsigned line,
55-
NodePointer node, const char *expr);
54+
[[noreturn]] void failAssert(const char *file, unsigned line, NodePointer node,
55+
const char *expr);
5656

5757
SWIFT_END_INLINE_NAMESPACE
5858
} // end namespace Demangle

branches/next/lib/DependencyScan/ScanDependencies.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -808,8 +808,8 @@ generateFullDependencyGraph(CompilerInstance &instance,
808808
module.first,
809809
{module.second, currentImportPathSet});
810810
if (!moduleDepsQuery) {
811-
std::string err = "Module Dependency Cache missing module" + module.first;
812-
llvm::report_fatal_error(err);
811+
llvm::report_fatal_error(Twine("Module Dependency Cache missing module") +
812+
module.first);
813813
}
814814

815815
auto moduleDeps = *moduleDepsQuery;

branches/next/lib/Driver/Driver.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,8 @@ parseArgsUntil(const llvm::opt::OptTable& Opts,
11571157
}
11581158

11591159
unsigned Prev = Index;
1160-
Arg *A = Opts.ParseOneArg(*Args, Index, FlagsToInclude, FlagsToExclude);
1160+
Arg *A = Opts.ParseOneArg(*Args, Index, FlagsToInclude, FlagsToExclude)
1161+
.release();
11611162
assert(Index > Prev && "Parser failed to consume argument.");
11621163

11631164
// Check for missing argument error.

branches/next/lib/Driver/UnixToolChains.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,11 @@ toolchains::GenericUnix::constructInvocation(const DynamicLinkJobAction &job,
310310
}
311311

312312
if (!linkFilePath.empty()) {
313-
auto linkFile = linkFilePath.str();
314-
if (llvm::sys::fs::is_regular_file(linkFile)) {
315-
Arguments.push_back(context.Args.MakeArgString(Twine("@") + linkFile));
313+
if (llvm::sys::fs::is_regular_file(linkFilePath)) {
314+
Arguments.push_back(
315+
context.Args.MakeArgString(Twine("@") + linkFilePath));
316316
} else {
317-
llvm::report_fatal_error(linkFile + " not found");
317+
llvm::report_fatal_error(Twine(linkFilePath) + " not found");
318318
}
319319
}
320320

branches/next/lib/DriverTool/swift_symbolgraph_extract_main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "swift/Option/Options.h"
2424
#include "swift/SymbolGraphGen/SymbolGraphGen.h"
2525
#include "llvm/ADT/ArrayRef.h"
26+
#include "llvm/ADT/SmallVector.h"
2627
#include "llvm/Support/raw_ostream.h"
2728

2829
using namespace swift;

branches/next/lib/FrontendTool/FrontendTool.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,15 +1871,15 @@ int swift::performFrontend(ArrayRef<const char *> Args,
18711871
//
18721872
// Unfortunately it's not really safe to do anything else, since very
18731873
// low-level operations in LLVM can trigger fatal errors.
1874-
auto diagnoseFatalError = [&PDC](const std::string &reason, bool shouldCrash){
1875-
static const std::string *recursiveFatalError = nullptr;
1874+
auto diagnoseFatalError = [&PDC](const char *reason, bool shouldCrash) {
1875+
static const char *recursiveFatalError = nullptr;
18761876
if (recursiveFatalError) {
18771877
// Report the /original/ error through LLVM's default handler, not
18781878
// whatever we encountered.
18791879
llvm::remove_fatal_error_handler();
1880-
llvm::report_fatal_error(*recursiveFatalError, shouldCrash);
1880+
llvm::report_fatal_error(recursiveFatalError, shouldCrash);
18811881
}
1882-
recursiveFatalError = &reason;
1882+
recursiveFatalError = reason;
18831883

18841884
SourceManager dummyMgr;
18851885

@@ -1895,12 +1895,13 @@ int swift::performFrontend(ArrayRef<const char *> Args,
18951895
if (shouldCrash)
18961896
abort();
18971897
};
1898-
llvm::ScopedFatalErrorHandler handler([](void *rawCallback,
1899-
const std::string &reason,
1900-
bool shouldCrash) {
1901-
auto *callback = static_cast<decltype(&diagnoseFatalError)>(rawCallback);
1902-
(*callback)(reason, shouldCrash);
1903-
}, &diagnoseFatalError);
1898+
llvm::ScopedFatalErrorHandler handler(
1899+
[](void *rawCallback, const char *reason, bool shouldCrash) {
1900+
auto *callback =
1901+
static_cast<decltype(&diagnoseFatalError)>(rawCallback);
1902+
(*callback)(reason, shouldCrash);
1903+
},
1904+
&diagnoseFatalError);
19041905

19051906
std::unique_ptr<CompilerInstance> Instance =
19061907
std::make_unique<CompilerInstance>();

0 commit comments

Comments
 (0)