Skip to content

Commit 984f262

Browse files
authored
Merge branch 'main' into eng/abhay/machine-verify-early-clobber
2 parents 85adbef + f8a2ed7 commit 984f262

File tree

730 files changed

+22388
-10464
lines changed

Some content is hidden

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

730 files changed

+22388
-10464
lines changed

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

clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "IncorrectRoundingsCheck.h"
3939
#include "InfiniteLoopCheck.h"
4040
#include "IntegerDivisionCheck.h"
41+
#include "InvalidEnumDefaultInitializationCheck.h"
4142
#include "LambdaFunctionNameCheck.h"
4243
#include "MacroParenthesesCheck.h"
4344
#include "MacroRepeatedSideEffectsCheck.h"
@@ -165,6 +166,8 @@ class BugproneModule : public ClangTidyModule {
165166
CheckFactories.registerCheck<InfiniteLoopCheck>("bugprone-infinite-loop");
166167
CheckFactories.registerCheck<IntegerDivisionCheck>(
167168
"bugprone-integer-division");
169+
CheckFactories.registerCheck<InvalidEnumDefaultInitializationCheck>(
170+
"bugprone-invalid-enum-default-initialization");
168171
CheckFactories.registerCheck<LambdaFunctionNameCheck>(
169172
"bugprone-lambda-function-name");
170173
CheckFactories.registerCheck<MacroParenthesesCheck>(

0 commit comments

Comments
 (0)