Skip to content

Commit 0033134

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:3eaaf7c4d062976901c79b523e9f3cc606943119 into amd-gfx:5f9104d4971e
Local branch amd-gfx 5f9104d Merged main:0813c76d400840ac2aaf041dc589941740874944 into amd-gfx:feeb1ff673b1 Remote branch main 3eaaf7c [lldb][AArch64] Fix crash loading core files on 32 bit systems
2 parents 5f9104d + 3eaaf7c commit 0033134

File tree

227 files changed

+4807
-2816
lines changed

Some content is hidden

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

227 files changed

+4807
-2816
lines changed

bolt/test/AArch64/constant_island_pie_update.s

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
# RUN: %clang %cflags -fPIC -pie %t.o -o %t.rela.exe -nostdlib \
99
# RUN: -Wl,-q -Wl,-z,notext
1010
# RUN: llvm-bolt %t.rela.exe -o %t.rela.bolt --use-old-text=0 --lite=0
11-
# RUN: llvm-objdump -j .text -d --show-all-symbols %t.rela.bolt | FileCheck %s
11+
# RUN: llvm-objdump -j .text -d -z --show-all-symbols %t.rela.bolt | FileCheck %s
1212
# RUN: llvm-readelf -rsW %t.rela.bolt | FileCheck --check-prefix=ELFCHECK %s
1313
// .relr.dyn
1414
# RUN: %clang %cflags -fPIC -pie %t.o -o %t.relr.exe -nostdlib \
1515
# RUN: -Wl,-q -Wl,-z,notext -Wl,--pack-dyn-relocs=relr
1616
# RUN: llvm-objcopy --remove-section .rela.mytext %t.relr.exe
1717
# RUN: llvm-bolt %t.relr.exe -o %t.relr.bolt --use-old-text=0 --lite=0
18-
# RUN: llvm-objdump -j .text -d --show-all-symbols %t.relr.bolt | FileCheck %s
19-
# RUN: llvm-objdump -j .text -d %t.relr.bolt | \
18+
# RUN: llvm-objdump -j .text -d -z --show-all-symbols %t.relr.bolt | FileCheck %s
19+
# RUN: llvm-objdump -j .text -d -z %t.relr.bolt | \
2020
# RUN: FileCheck %s --check-prefix=ADDENDCHECK
2121
# RUN: llvm-readelf -rsW %t.relr.bolt | FileCheck --check-prefix=RELRELFCHECK %s
2222
# RUN: llvm-readelf -SW %t.relr.bolt | FileCheck --check-prefix=RELRSZCHECK %s

bolt/test/AArch64/update-weak-reference-symbol.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %clang %cflags -Wl,-z,notext -shared -Wl,-q %s -o %t.so
44
// RUN: llvm-bolt %t.so -o %t.so.bolt
55
// RUN: llvm-nm -n %t.so.bolt > %t.out.txt
6-
// RUN: llvm-objdump -dj .rodata %t.so.bolt >> %t.out.txt
6+
// RUN: llvm-objdump -z -dj .rodata %t.so.bolt >> %t.out.txt
77
// RUN: FileCheck %s --input-file=%t.out.txt
88

99
# CHECK: w func_1

clang-tools-extra/clangd/Diagnostics.cpp

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -577,17 +577,7 @@ std::vector<Diag> StoreDiags::take(const clang::tidy::ClangTidyContext *Tidy) {
577577
for (auto &Diag : Output) {
578578
if (const char *ClangDiag = getDiagnosticCode(Diag.ID)) {
579579
// Warnings controlled by -Wfoo are better recognized by that name.
580-
const StringRef Warning = [&] {
581-
if (OrigSrcMgr) {
582-
return OrigSrcMgr->getDiagnostics()
583-
.getDiagnosticIDs()
584-
->getWarningOptionForDiag(Diag.ID);
585-
}
586-
if (!DiagnosticIDs::IsCustomDiag(Diag.ID))
587-
return DiagnosticIDs{}.getWarningOptionForDiag(Diag.ID);
588-
return StringRef{};
589-
}();
590-
580+
StringRef Warning = DiagnosticIDs::getWarningOptionForDiag(Diag.ID);
591581
if (!Warning.empty()) {
592582
Diag.Name = ("-W" + Warning).str();
593583
} else {
@@ -904,23 +894,20 @@ void StoreDiags::flushLastDiag() {
904894
Output.push_back(std::move(*LastDiag));
905895
}
906896

907-
bool isDiagnosticSuppressed(const clang::Diagnostic &Diag,
908-
const llvm::StringSet<> &Suppress,
909-
const LangOptions &LangOpts) {
897+
bool isBuiltinDiagnosticSuppressed(unsigned ID,
898+
const llvm::StringSet<> &Suppress,
899+
const LangOptions &LangOpts) {
910900
// Don't complain about header-only stuff in mainfiles if it's a header.
911901
// FIXME: would be cleaner to suppress in clang, once we decide whether the
912902
// behavior should be to silently-ignore or respect the pragma.
913-
if (Diag.getID() == diag::pp_pragma_sysheader_in_main_file &&
914-
LangOpts.IsHeaderFile)
903+
if (ID == diag::pp_pragma_sysheader_in_main_file && LangOpts.IsHeaderFile)
915904
return true;
916905

917-
if (const char *CodePtr = getDiagnosticCode(Diag.getID())) {
906+
if (const char *CodePtr = getDiagnosticCode(ID)) {
918907
if (Suppress.contains(normalizeSuppressedCode(CodePtr)))
919908
return true;
920909
}
921-
StringRef Warning =
922-
Diag.getDiags()->getDiagnosticIDs()->getWarningOptionForDiag(
923-
Diag.getID());
910+
StringRef Warning = DiagnosticIDs::getWarningOptionForDiag(ID);
924911
if (!Warning.empty() && Suppress.contains(Warning))
925912
return true;
926913
return false;

clang-tools-extra/clangd/Diagnostics.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,11 @@ class StoreDiags : public DiagnosticConsumer {
181181
};
182182

183183
/// Determine whether a (non-clang-tidy) diagnostic is suppressed by config.
184-
bool isDiagnosticSuppressed(const clang::Diagnostic &Diag,
185-
const llvm::StringSet<> &Suppressed,
186-
const LangOptions &);
184+
bool isBuiltinDiagnosticSuppressed(unsigned ID,
185+
const llvm::StringSet<> &Suppressed,
186+
const LangOptions &);
187187
/// Take a user-specified diagnostic code, and convert it to a normalized form
188-
/// stored in the config and consumed by isDiagnosticsSuppressed.
188+
/// stored in the config and consumed by isBuiltinDiagnosticsSuppressed.
189189
///
190190
/// (This strips err_ and -W prefix so we can match with or without them.)
191191
llvm::StringRef normalizeSuppressedCode(llvm::StringRef);

clang-tools-extra/clangd/ParsedAST.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ void applyWarningOptions(llvm::ArrayRef<std::string> ExtraArgs,
342342
if (Enable) {
343343
if (Diags.getDiagnosticLevel(ID, SourceLocation()) <
344344
DiagnosticsEngine::Warning) {
345-
auto Group = Diags.getDiagnosticIDs()->getGroupForDiag(ID);
345+
auto Group = DiagnosticIDs::getGroupForDiag(ID);
346346
if (!Group || !EnabledGroups(*Group))
347347
continue;
348348
Diags.setSeverity(ID, diag::Severity::Warning, SourceLocation());
@@ -585,8 +585,8 @@ ParsedAST::build(llvm::StringRef Filename, const ParseInputs &Inputs,
585585
ASTDiags.setLevelAdjuster([&](DiagnosticsEngine::Level DiagLevel,
586586
const clang::Diagnostic &Info) {
587587
if (Cfg.Diagnostics.SuppressAll ||
588-
isDiagnosticSuppressed(Info, Cfg.Diagnostics.Suppress,
589-
Clang->getLangOpts()))
588+
isBuiltinDiagnosticSuppressed(Info.getID(), Cfg.Diagnostics.Suppress,
589+
Clang->getLangOpts()))
590590
return DiagnosticsEngine::Ignored;
591591

592592
auto It = OverriddenSeverity.find(Info.getID());

clang-tools-extra/clangd/Preamble.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,8 +621,8 @@ buildPreamble(PathRef FileName, CompilerInvocation CI,
621621
PreambleDiagnostics.setLevelAdjuster([&](DiagnosticsEngine::Level DiagLevel,
622622
const clang::Diagnostic &Info) {
623623
if (Cfg.Diagnostics.SuppressAll ||
624-
isDiagnosticSuppressed(Info, Cfg.Diagnostics.Suppress,
625-
CI.getLangOpts()))
624+
isBuiltinDiagnosticSuppressed(Info.getID(), Cfg.Diagnostics.Suppress,
625+
CI.getLangOpts()))
626626
return DiagnosticsEngine::Ignored;
627627
switch (Info.getID()) {
628628
case diag::warn_no_newline_eof:

clang-tools-extra/clangd/unittests/ConfigCompileTests.cpp

Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -298,41 +298,20 @@ TEST_F(ConfigCompileTests, DiagnosticSuppression) {
298298
"unreachable-code", "unused-variable",
299299
"typecheck_bool_condition",
300300
"unexpected_friend", "warn_alloca"));
301-
clang::DiagnosticsEngine DiagEngine(new DiagnosticIDs, nullptr,
302-
new clang::IgnoringDiagConsumer);
303-
304-
using Diag = clang::Diagnostic;
305-
{
306-
auto D = DiagEngine.Report(diag::warn_unreachable);
307-
EXPECT_TRUE(isDiagnosticSuppressed(
308-
Diag{&DiagEngine, D}, Conf.Diagnostics.Suppress, LangOptions()));
309-
}
301+
EXPECT_TRUE(isBuiltinDiagnosticSuppressed(
302+
diag::warn_unreachable, Conf.Diagnostics.Suppress, LangOptions()));
310303
// Subcategory not respected/suppressed.
311-
{
312-
auto D = DiagEngine.Report(diag::warn_unreachable_break);
313-
EXPECT_FALSE(isDiagnosticSuppressed(
314-
Diag{&DiagEngine, D}, Conf.Diagnostics.Suppress, LangOptions()));
315-
}
316-
{
317-
auto D = DiagEngine.Report(diag::warn_unused_variable);
318-
EXPECT_TRUE(isDiagnosticSuppressed(
319-
Diag{&DiagEngine, D}, Conf.Diagnostics.Suppress, LangOptions()));
320-
}
321-
{
322-
auto D = DiagEngine.Report(diag::err_typecheck_bool_condition);
323-
EXPECT_TRUE(isDiagnosticSuppressed(
324-
Diag{&DiagEngine, D}, Conf.Diagnostics.Suppress, LangOptions()));
325-
}
326-
{
327-
auto D = DiagEngine.Report(diag::err_unexpected_friend);
328-
EXPECT_TRUE(isDiagnosticSuppressed(
329-
Diag{&DiagEngine, D}, Conf.Diagnostics.Suppress, LangOptions()));
330-
}
331-
{
332-
auto D = DiagEngine.Report(diag::warn_alloca);
333-
EXPECT_TRUE(isDiagnosticSuppressed(
334-
Diag{&DiagEngine, D}, Conf.Diagnostics.Suppress, LangOptions()));
335-
}
304+
EXPECT_FALSE(isBuiltinDiagnosticSuppressed(
305+
diag::warn_unreachable_break, Conf.Diagnostics.Suppress, LangOptions()));
306+
EXPECT_TRUE(isBuiltinDiagnosticSuppressed(
307+
diag::warn_unused_variable, Conf.Diagnostics.Suppress, LangOptions()));
308+
EXPECT_TRUE(isBuiltinDiagnosticSuppressed(diag::err_typecheck_bool_condition,
309+
Conf.Diagnostics.Suppress,
310+
LangOptions()));
311+
EXPECT_TRUE(isBuiltinDiagnosticSuppressed(
312+
diag::err_unexpected_friend, Conf.Diagnostics.Suppress, LangOptions()));
313+
EXPECT_TRUE(isBuiltinDiagnosticSuppressed(
314+
diag::warn_alloca, Conf.Diagnostics.Suppress, LangOptions()));
336315

337316
Frag.Diagnostics.Suppress.emplace_back("*");
338317
EXPECT_TRUE(compileAndApply());

clang/docs/UsersManual.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2369,14 +2369,16 @@ are listed below.
23692369
$ cd $P/bar && clang -c -funique-internal-linkage-names name_conflict.c
23702370
$ cd $P && clang foo/name_conflict.o && bar/name_conflict.o
23712371
2372-
.. option:: -fbasic-block-sections=[labels, all, list=<arg>, none]
2372+
.. option:: -f[no]-basic-block-address-map:
2373+
Emits a ``SHT_LLVM_BB_ADDR_MAP`` section which includes address offsets for each
2374+
basic block in the program, relative to the parent function address.
2375+
2376+
2377+
.. option:: -fbasic-block-sections=[all, list=<arg>, none]
23732378

23742379
Controls how Clang emits text sections for basic blocks. With values ``all``
23752380
and ``list=<arg>``, each basic block or a subset of basic blocks can be placed
2376-
in its own unique section. With the "labels" value, normal text sections are
2377-
emitted, but a ``.bb_addr_map`` section is emitted which includes address
2378-
offsets for each basic block in the program, relative to the parent function
2379-
address.
2381+
in its own unique section.
23802382

23812383
With the ``list=<arg>`` option, a file containing the subset of basic blocks
23822384
that need to placed in unique sections can be specified. The format of the

0 commit comments

Comments
 (0)