Skip to content

Commit 12ecb70

Browse files
authored
Merge branch 'main' into min_runtime_substitution
2 parents 662c99b + 9de4e06 commit 12ecb70

File tree

1,409 files changed

+61997
-28382
lines changed

Some content is hidden

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

1,409 files changed

+61997
-28382
lines changed

bolt/lib/Core/Relocation.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,15 +1018,15 @@ void Relocation::print(raw_ostream &OS) const {
10181018
OS << "RType:" << Twine::utohexstr(Type);
10191019
break;
10201020

1021-
case Triple::aarch64:
1021+
case Triple::aarch64: {
10221022
static const char *const AArch64RelocNames[] = {
10231023
#define ELF_RELOC(name, value) #name,
10241024
#include "llvm/BinaryFormat/ELFRelocs/AArch64.def"
10251025
#undef ELF_RELOC
10261026
};
10271027
assert(Type < ArrayRef(AArch64RelocNames).size());
10281028
OS << AArch64RelocNames[Type];
1029-
break;
1029+
} break;
10301030

10311031
case Triple::riscv64:
10321032
// RISC-V relocations are not sequentially numbered so we cannot use an
@@ -1043,15 +1043,15 @@ void Relocation::print(raw_ostream &OS) const {
10431043
}
10441044
break;
10451045

1046-
case Triple::x86_64:
1046+
case Triple::x86_64: {
10471047
static const char *const X86RelocNames[] = {
10481048
#define ELF_RELOC(name, value) #name,
10491049
#include "llvm/BinaryFormat/ELFRelocs/x86_64.def"
10501050
#undef ELF_RELOC
10511051
};
10521052
assert(Type < ArrayRef(X86RelocNames).size());
10531053
OS << X86RelocNames[Type];
1054-
break;
1054+
} break;
10551055
}
10561056
OS << ", 0x" << Twine::utohexstr(Offset);
10571057
if (Symbol) {

bolt/test/binary-analysis/AArch64/cmdline-args.test

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
# Verify that an error message is provided if an input file is missing or incorrect
55

66
RUN: not llvm-bolt-binary-analysis 2>&1 | FileCheck -check-prefix=NOFILEARG %s
7-
NOFILEARG: llvm-bolt-binary-analysis: Not enough positional command line arguments specified!
8-
NOFILEARG-NEXT: Must specify at least 1 positional argument: See: {{.*}}llvm-bolt-binary-analysis --help
7+
NOFILEARG: llvm-bolt-binary-analysis{{(\.exe)?}}: Not enough positional command line arguments specified!
8+
NOFILEARG-NEXT: Must specify at least 1 positional argument: See: {{.*}}llvm-bolt-binary-analysis{{(\.exe)?}} --help
99

1010
RUN: not llvm-bolt-binary-analysis non-existing-file 2>&1 | FileCheck -check-prefix=NONEXISTINGFILEARG %s
11-
NONEXISTINGFILEARG: llvm-bolt-binary-analysis: 'non-existing-file': No such file or directory.
11+
# Don't check the OS-dependent message "No such file or directory".
12+
NONEXISTINGFILEARG: llvm-bolt-binary-analysis{{(\.exe)?}}: 'non-existing-file': {{.*}}
1213

1314
RUN: not llvm-bolt-binary-analysis %p/Inputs/dummy.txt 2>&1 | FileCheck -check-prefix=NOELFFILEARG %s
14-
NOELFFILEARG: llvm-bolt-binary-analysis: '{{.*}}/Inputs/dummy.txt': The file was not recognized as a valid object file.
15+
NOELFFILEARG: llvm-bolt-binary-analysis{{(\.exe)?}}: '{{.*}}/Inputs/dummy.txt': The file was not recognized as a valid object file.
1516

1617
RUN: %clang %cflags -Wl,--emit-relocs %p/../../Inputs/asm_foo.s %p/../../Inputs/asm_main.c -o %t.exe
1718
RUN: llvm-bolt-binary-analysis %t.exe 2>&1 | FileCheck -check-prefix=VALIDELFFILEARG --allow-empty %s
@@ -26,7 +27,7 @@ RUN: llvm-bolt-binary-analysis --help 2>&1 | FileCheck -check-prefix=HELP %s
2627

2728
HELP: OVERVIEW: BinaryAnalysis
2829
HELP-EMPTY:
29-
HELP-NEXT: USAGE: llvm-bolt-binary-analysis [options] <executable>
30+
HELP-NEXT: USAGE: llvm-bolt-binary-analysis{{(\.exe)?}} [options] <executable>
3031
HELP-EMPTY:
3132
HELP-NEXT: OPTIONS:
3233
HELP-EMPTY:

bolt/test/lsda-section-name.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// This test check that LSDA section named by .gcc_except_table.main is
22
// disassembled by BOLT.
33

4-
// RUN: %clang++ %cxxflags -O3 -no-pie -c %s -o %t.o
5-
// RUN: %clang++ %cxxflags -O3 -no-pie -fuse-ld=lld %t.o -o %t
4+
// RUN: %clangxx %cxxflags -O3 -no-pie -c %s -o %t.o
5+
// RUN: %clangxx %cxxflags -O3 -no-pie -fuse-ld=lld %t.o -o %t
66
// RUN: llvm-objcopy --rename-section .gcc_except_table=.gcc_except_table.main %t
77
// RUN: llvm-readelf -SW %t | FileCheck %s
88
// RUN: llvm-bolt %t -o %t.bolt

clang-tools-extra/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ int main(int argc, char **argv) {
9797
cl::ParseCommandLineOptions(argc, argv);
9898

9999
DiagnosticOptions DiagOpts;
100-
DiagnosticsEngine Diagnostics(
101-
IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()), DiagOpts);
100+
DiagnosticsEngine Diagnostics(DiagnosticIDs::create(), DiagOpts);
102101

103102
// Determine a formatting style from options.
104103
auto FormatStyleOrError = format::getStyle(FormatStyleOpt, FormatStyleConfig,

clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,8 @@ int main(int argc, const char **argv) {
128128
LangOptions DefaultLangOptions;
129129
DiagnosticOptions DiagOpts;
130130
clang::TextDiagnosticPrinter DiagnosticPrinter(errs(), DiagOpts);
131-
DiagnosticsEngine Diagnostics(
132-
IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()), DiagOpts,
133-
&DiagnosticPrinter, false);
131+
DiagnosticsEngine Diagnostics(DiagnosticIDs::create(), DiagOpts,
132+
&DiagnosticPrinter, false);
134133
auto &FileMgr = Tool.getFiles();
135134
SourceManager Sources(Diagnostics, FileMgr);
136135
Rewriter Rewrite(Sources, DefaultLangOptions);

clang-tools-extra/clang-include-fixer/tool/ClangIncludeFixer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ int includeFixerMain(int argc, const char **argv) {
454454

455455
// Set up a new source manager for applying the resulting replacements.
456456
DiagnosticOptions DiagOpts;
457-
DiagnosticsEngine Diagnostics(new DiagnosticIDs, DiagOpts);
457+
DiagnosticsEngine Diagnostics(DiagnosticIDs::create(), DiagOpts);
458458
TextDiagnosticPrinter DiagnosticPrinter(outs(), DiagOpts);
459459
SourceManager SM(Diagnostics, tool.getFiles());
460460
Diagnostics.setClient(&DiagnosticPrinter, false);

clang-tools-extra/clang-move/tool/ClangMove.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,8 @@ int main(int argc, const char **argv) {
178178

179179
DiagnosticOptions DiagOpts;
180180
clang::TextDiagnosticPrinter DiagnosticPrinter(errs(), DiagOpts);
181-
DiagnosticsEngine Diagnostics(
182-
IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()), DiagOpts,
183-
&DiagnosticPrinter, false);
181+
DiagnosticsEngine Diagnostics(DiagnosticIDs::create(), DiagOpts,
182+
&DiagnosticPrinter, false);
184183
auto &FileMgr = Tool.getFiles();
185184
SourceManager SM(Diagnostics, FileMgr);
186185
Rewriter Rewrite(SM, LangOptions());

clang-tools-extra/clang-reorder-fields/tool/ClangReorderFields.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,8 @@ int main(int argc, const char **argv) {
7474
LangOptions DefaultLangOptions;
7575
DiagnosticOptions DiagOpts;
7676
TextDiagnosticPrinter DiagnosticPrinter(errs(), DiagOpts);
77-
DiagnosticsEngine Diagnostics(
78-
IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()), DiagOpts,
79-
&DiagnosticPrinter, false);
77+
DiagnosticsEngine Diagnostics(DiagnosticIDs::create(), DiagOpts,
78+
&DiagnosticPrinter, false);
8079

8180
auto &FileMgr = Tool.getFiles();
8281
SourceManager Sources(Diagnostics, FileMgr);

clang-tools-extra/clang-tidy/ClangTidy.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ class ErrorReporter {
9696
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS)
9797
: Files(FileSystemOptions(), std::move(BaseFS)),
9898
DiagPrinter(new TextDiagnosticPrinter(llvm::outs(), DiagOpts)),
99-
Diags(IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs), DiagOpts,
100-
DiagPrinter),
99+
Diags(DiagnosticIDs::create(), DiagOpts, DiagPrinter),
101100
SourceMgr(Diags, Files), Context(Context), ApplyFixes(ApplyFixes) {
102101
DiagOpts.ShowColors = Context.getOptions().UseColor.value_or(
103102
llvm::sys::Process::StandardOutHasColors());
@@ -570,7 +569,7 @@ runClangTidy(clang::tidy::ClangTidyContext &Context,
570569

571570
ClangTidyDiagnosticConsumer DiagConsumer(Context, nullptr, true, ApplyAnyFix);
572571
auto DiagOpts = std::make_unique<DiagnosticOptions>();
573-
DiagnosticsEngine DE(new DiagnosticIDs(), *DiagOpts, &DiagConsumer,
572+
DiagnosticsEngine DE(DiagnosticIDs::create(), *DiagOpts, &DiagConsumer,
574573
/*ShouldOwnClient=*/false);
575574
Context.setDiagnosticsEngine(std::move(DiagOpts), &DE);
576575
Tool.setDiagnosticConsumer(&DiagConsumer);

clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ ExpandModularHeadersPPCallbacks::ExpandModularHeadersPPCallbacks(
7171
InMemoryFs(new llvm::vfs::InMemoryFileSystem),
7272
Sources(Compiler.getSourceManager()),
7373
// Forward the new diagnostics to the original DiagnosticConsumer.
74-
Diags(new DiagnosticIDs, DiagOpts,
74+
Diags(DiagnosticIDs::create(), DiagOpts,
7575
new ForwardingDiagnosticConsumer(Compiler.getDiagnosticClient())),
7676
LangOpts(Compiler.getLangOpts()), HSOpts(Compiler.getHeaderSearchOpts()) {
7777
// Add a FileSystem containing the extra files needed in place of modular

0 commit comments

Comments
 (0)