Skip to content

Commit bf535ae

Browse files
committed
merge main into amd-staging
2 parents 52e13a9 + ca2b4db commit bf535ae

File tree

296 files changed

+9562
-5441
lines changed

Some content is hidden

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

296 files changed

+9562
-5441
lines changed

bolt/include/bolt/Passes/ReorderUtils.h

Lines changed: 0 additions & 152 deletions
This file was deleted.

clang-tools-extra/clang-doc/BitcodeReader.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,16 +1076,15 @@ llvm::Error ClangDocBitcodeReader::readBlockInfoBlock() {
10761076
}
10771077

10781078
template <typename T>
1079-
llvm::Expected<std::unique_ptr<Info>>
1080-
ClangDocBitcodeReader::createInfo(unsigned ID) {
1079+
llvm::Expected<OwnedPtr<Info>> ClangDocBitcodeReader::createInfo(unsigned ID) {
10811080
llvm::TimeTraceScope("Reducing infos", "createInfo");
1082-
std::unique_ptr<Info> I = std::make_unique<T>();
1081+
OwnedPtr<Info> I = std::make_unique<T>();
10831082
if (auto Err = readBlock(ID, static_cast<T *>(I.get())))
10841083
return std::move(Err);
1085-
return std::unique_ptr<Info>{std::move(I)};
1084+
return OwnedPtr<Info>{std::move(I)};
10861085
}
10871086

1088-
llvm::Expected<std::unique_ptr<Info>>
1087+
llvm::Expected<OwnedPtr<Info>>
10891088
ClangDocBitcodeReader::readBlockToInfo(unsigned ID) {
10901089
llvm::TimeTraceScope("Reducing infos", "readBlockToInfo");
10911090
switch (ID) {
@@ -1112,9 +1111,9 @@ ClangDocBitcodeReader::readBlockToInfo(unsigned ID) {
11121111
}
11131112

11141113
// Entry point
1115-
llvm::Expected<std::vector<std::unique_ptr<Info>>>
1114+
llvm::Expected<std::vector<OwnedPtr<Info>>>
11161115
ClangDocBitcodeReader::readBitcode() {
1117-
std::vector<std::unique_ptr<Info>> Infos;
1116+
std::vector<OwnedPtr<Info>> Infos;
11181117
if (auto Err = validateStream())
11191118
return std::move(Err);
11201119

clang-tools-extra/clang-doc/BitcodeReader.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class ClangDocBitcodeReader {
3131
: Stream(Stream), Diags(Diags) {}
3232

3333
// Main entry point, calls readBlock to read each block in the given stream.
34-
llvm::Expected<std::vector<std::unique_ptr<Info>>> readBitcode();
34+
llvm::Expected<std::vector<OwnedPtr<Info>>> readBitcode();
3535

3636
private:
3737
enum class Cursor { BadBlock = 1, Record, BlockEnd, BlockBegin };
@@ -53,15 +53,14 @@ class ClangDocBitcodeReader {
5353
template <typename T> llvm::Error readRecord(unsigned ID, T I);
5454

5555
// Allocate the relevant type of info and add read data to the object.
56-
template <typename T>
57-
llvm::Expected<std::unique_ptr<Info>> createInfo(unsigned ID);
56+
template <typename T> llvm::Expected<OwnedPtr<Info>> createInfo(unsigned ID);
5857

5958
// Helper function to step through blocks to find and dispatch the next record
6059
// or block to be read.
6160
llvm::Expected<Cursor> skipUntilRecordOrBlock(unsigned &BlockOrRecordID);
6261

6362
// Helper function to set up the appropriate type of Info.
64-
llvm::Expected<std::unique_ptr<Info>> readBlockToInfo(unsigned ID);
63+
llvm::Expected<OwnedPtr<Info>> readBlockToInfo(unsigned ID);
6564

6665
template <typename InfoType, typename T, typename CallbackFunction>
6766
llvm::Error handleSubBlock(unsigned ID, T Parent, CallbackFunction Function);

clang-tools-extra/clang-doc/ClangDoc.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ namespace doc {
2525
class MapperActionFactory : public tooling::FrontendActionFactory {
2626
public:
2727
MapperActionFactory(ClangDocContext CDCtx) : CDCtx(CDCtx) {}
28-
std::unique_ptr<FrontendAction> create() override;
28+
OwnedPtr<FrontendAction> create() override;
2929

3030
private:
3131
ClangDocContext CDCtx;
3232
};
3333

34-
std::unique_ptr<FrontendAction> MapperActionFactory::create() {
34+
OwnedPtr<FrontendAction> MapperActionFactory::create() {
3535
class ClangDocAction : public clang::ASTFrontendAction {
3636
public:
3737
ClangDocAction(ClangDocContext CDCtx) : CDCtx(CDCtx) {}
3838

39-
std::unique_ptr<clang::ASTConsumer>
39+
OwnedPtr<clang::ASTConsumer>
4040
CreateASTConsumer(clang::CompilerInstance &Compiler,
4141
llvm::StringRef InFile) override {
4242
return std::make_unique<MapASTVisitor>(&Compiler.getASTContext(), CDCtx);
@@ -48,7 +48,7 @@ std::unique_ptr<FrontendAction> MapperActionFactory::create() {
4848
return std::make_unique<ClangDocAction>(CDCtx);
4949
}
5050

51-
std::unique_ptr<tooling::FrontendActionFactory>
51+
OwnedPtr<tooling::FrontendActionFactory>
5252
newMapperActionFactory(ClangDocContext CDCtx) {
5353
return std::make_unique<MapperActionFactory>(CDCtx);
5454
}

clang-tools-extra/clang-doc/ClangDoc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
namespace clang {
2323
namespace doc {
2424

25-
std::unique_ptr<tooling::FrontendActionFactory>
25+
OwnedPtr<tooling::FrontendActionFactory>
2626
newMapperActionFactory(ClangDocContext CDCtx);
2727

2828
} // namespace doc

clang-tools-extra/clang-doc/Generators.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Error createFileOpenError(StringRef FileName, std::error_code EC) {
5353
}
5454

5555
Error MustacheGenerator::setupTemplate(
56-
std::unique_ptr<MustacheTemplateFile> &Template, StringRef TemplatePath,
56+
OwnedPtr<MustacheTemplateFile> &Template, StringRef TemplatePath,
5757
std::vector<std::pair<StringRef, StringRef>> Partials) {
5858
auto T = MustacheTemplateFile::createMustacheFile(TemplatePath);
5959
if (Error Err = T.takeError())
@@ -66,7 +66,7 @@ Error MustacheGenerator::setupTemplate(
6666
}
6767

6868
Error MustacheGenerator::generateDocumentation(
69-
StringRef RootDir, StringMap<std::unique_ptr<doc::Info>> Infos,
69+
StringRef RootDir, StringMap<doc::OwnedPtr<doc::Info>> Infos,
7070
const clang::doc::ClangDocContext &CDCtx, std::string DirName) {
7171
{
7272
llvm::TimeTraceScope TS("Setup Templates");

clang-tools-extra/clang-doc/Generators.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Generator {
3030
// Write out the decl info for the objects in the given map in the specified
3131
// format.
3232
virtual llvm::Error generateDocumentation(
33-
StringRef RootDir, llvm::StringMap<std::unique_ptr<doc::Info>> Infos,
33+
StringRef RootDir, llvm::StringMap<doc::OwnedPtr<doc::Info>> Infos,
3434
const ClangDocContext &CDCtx, std::string DirName = "") = 0;
3535

3636
// This function writes a file with the index previously constructed.
@@ -60,12 +60,12 @@ class MustacheTemplateFile {
6060
llvm::StringSaver Saver;
6161
llvm::mustache::MustacheContext Ctx;
6262
llvm::mustache::Template T;
63-
std::unique_ptr<llvm::MemoryBuffer> Buffer;
63+
OwnedPtr<llvm::MemoryBuffer> Buffer;
6464

6565
public:
66-
static Expected<std::unique_ptr<MustacheTemplateFile>>
66+
static Expected<OwnedPtr<MustacheTemplateFile>>
6767
createMustacheFile(StringRef FileName) {
68-
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> BufferOrError =
68+
llvm::ErrorOr<OwnedPtr<llvm::MemoryBuffer>> BufferOrError =
6969
llvm::MemoryBuffer::getFile(FileName);
7070
if (auto EC = BufferOrError.getError())
7171
return createFileOpenError(FileName, EC);
@@ -74,12 +74,12 @@ class MustacheTemplateFile {
7474
}
7575

7676
llvm::Error registerPartialFile(StringRef Name, StringRef FileName) {
77-
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> BufferOrError =
77+
llvm::ErrorOr<OwnedPtr<llvm::MemoryBuffer>> BufferOrError =
7878
llvm::MemoryBuffer::getFile(FileName);
7979
if (auto EC = BufferOrError.getError())
8080
return createFileOpenError(FileName, EC);
8181

82-
std::unique_ptr<llvm::MemoryBuffer> Buffer = std::move(BufferOrError.get());
82+
OwnedPtr<llvm::MemoryBuffer> Buffer = std::move(BufferOrError.get());
8383
StringRef FileContent = Buffer->getBuffer();
8484
T.registerPartial(Name.str(), FileContent.str());
8585
return llvm::Error::success();
@@ -91,7 +91,7 @@ class MustacheTemplateFile {
9191
T.overrideEscapeCharacters(Characters);
9292
}
9393

94-
MustacheTemplateFile(std::unique_ptr<llvm::MemoryBuffer> &&B)
94+
MustacheTemplateFile(OwnedPtr<llvm::MemoryBuffer> &&B)
9595
: Saver(Allocator), Ctx(Allocator, Saver), T(B->getBuffer(), Ctx),
9696
Buffer(std::move(B)) {}
9797
};
@@ -120,7 +120,7 @@ struct MustacheGenerator : public Generator {
120120

121121
/// Registers partials to templates.
122122
llvm::Error
123-
setupTemplate(std::unique_ptr<MustacheTemplateFile> &Template,
123+
setupTemplate(OwnedPtr<MustacheTemplateFile> &Template,
124124
StringRef TemplatePath,
125125
std::vector<std::pair<StringRef, StringRef>> Partials);
126126

@@ -132,7 +132,7 @@ struct MustacheGenerator : public Generator {
132132
/// JSON, and calls generateDocForJSON for each file.
133133
/// 4. A file of the desired format is created.
134134
llvm::Error generateDocumentation(
135-
StringRef RootDir, llvm::StringMap<std::unique_ptr<doc::Info>> Infos,
135+
StringRef RootDir, llvm::StringMap<doc::OwnedPtr<doc::Info>> Infos,
136136
const clang::doc::ClangDocContext &CDCtx, std::string DirName) override;
137137
};
138138

clang-tools-extra/clang-doc/HTMLGenerator.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ using namespace llvm::mustache;
2525
namespace clang {
2626
namespace doc {
2727

28-
static std::unique_ptr<MustacheTemplateFile> NamespaceTemplate = nullptr;
28+
static OwnedPtr<MustacheTemplateFile> NamespaceTemplate = nullptr;
2929

30-
static std::unique_ptr<MustacheTemplateFile> RecordTemplate = nullptr;
30+
static OwnedPtr<MustacheTemplateFile> RecordTemplate = nullptr;
3131

32-
static std::unique_ptr<MustacheTemplateFile> IndexTemplate = nullptr;
32+
static OwnedPtr<MustacheTemplateFile> IndexTemplate = nullptr;
3333

3434
class HTMLGenerator : public MustacheGenerator {
3535
public:
@@ -45,7 +45,7 @@ class HTMLGenerator : public MustacheGenerator {
4545
Error setupTemplateResources(const ClangDocContext &CDCtx, json::Value &V,
4646
SmallString<128> RelativeRootPath);
4747
llvm::Error generateDocumentation(
48-
StringRef RootDir, llvm::StringMap<std::unique_ptr<doc::Info>> Infos,
48+
StringRef RootDir, llvm::StringMap<doc::OwnedPtr<doc::Info>> Infos,
4949
const ClangDocContext &CDCtx, std::string DirName) override;
5050
};
5151

@@ -183,7 +183,7 @@ Error HTMLGenerator::createResources(ClangDocContext &CDCtx) {
183183
}
184184

185185
Error HTMLGenerator::generateDocumentation(
186-
StringRef RootDir, llvm::StringMap<std::unique_ptr<doc::Info>> Infos,
186+
StringRef RootDir, llvm::StringMap<doc::OwnedPtr<doc::Info>> Infos,
187187
const ClangDocContext &CDCtx, std::string DirName) {
188188
return MustacheGenerator::generateDocumentation(RootDir, std::move(Infos),
189189
CDCtx, "html");

clang-tools-extra/clang-doc/JSONGenerator.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class JSONGenerator : public Generator {
6666
bool Markdown;
6767

6868
Error generateDocumentation(StringRef RootDir,
69-
llvm::StringMap<std::unique_ptr<doc::Info>> Infos,
69+
llvm::StringMap<OwnedPtr<doc::Info>> Infos,
7070
const ClangDocContext &CDCtx,
7171
std::string DirName) override;
7272
Error createResources(ClangDocContext &CDCtx) override;
@@ -898,8 +898,7 @@ Error JSONGenerator::serializeIndex(StringRef RootDir) {
898898
return Error::success();
899899
}
900900

901-
static void serializeContexts(Info *I,
902-
StringMap<std::unique_ptr<Info>> &Infos) {
901+
static void serializeContexts(Info *I, StringMap<OwnedPtr<Info>> &Infos) {
903902
if (I->USR == GlobalNamespaceID)
904903
return;
905904
auto ParentUSR = I->ParentUSR;
@@ -922,7 +921,7 @@ static void serializeContexts(Info *I,
922921
}
923922

924923
Error JSONGenerator::generateDocumentation(
925-
StringRef RootDir, llvm::StringMap<std::unique_ptr<doc::Info>> Infos,
924+
StringRef RootDir, llvm::StringMap<doc::OwnedPtr<doc::Info>> Infos,
926925
const ClangDocContext &CDCtx, std::string DirName) {
927926
this->CDCtx = &CDCtx;
928927
StringSet<> CreatedDirs;

0 commit comments

Comments
 (0)