Skip to content

Commit b75af8f

Browse files
committed
Merge branch 'fix/132038' of https://github.com/a-tarasyuk/llvm-project into fix/132038
2 parents 0005379 + 541df49 commit b75af8f

File tree

284 files changed

+5262
-2900
lines changed

Some content is hidden

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

284 files changed

+5262
-2900
lines changed

.github/new-prs-labeler.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ ClangIR:
77
- clang/tools/cir-*/**/*
88
- clang/test/CIR/**/*
99

10+
clang:bytecode:
11+
- clang/docs/ConstantInterpreter.rst
12+
- clang/lib/AST/ByteCode/**/*
13+
- clang/test/AST/ByteCode/**/*
14+
- clang/unittests/AST/ByteCode/**/*
15+
1016
clang:dataflow:
1117
- clang/include/clang/Analysis/FlowSensitive/**/*
1218
- clang/lib/Analysis/FlowSensitive/**/*

bolt/lib/Core/BinaryEmitter.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,10 @@ bool BinaryEmitter::emitFunction(BinaryFunction &Function,
373373
Streamer.emitLabel(StartSymbol);
374374
}
375375

376+
const bool NeedsFDE =
377+
Function.hasCFI() && !(Function.isPatch() && Function.isAnonymous());
376378
// Emit CFI start
377-
if (Function.hasCFI()) {
379+
if (NeedsFDE) {
378380
Streamer.emitCFIStartProc(/*IsSimple=*/false);
379381
if (Function.getPersonalityFunction() != nullptr)
380382
Streamer.emitCFIPersonality(Function.getPersonalityFunction(),
@@ -421,7 +423,7 @@ bool BinaryEmitter::emitFunction(BinaryFunction &Function,
421423
Streamer.emitBytes(BC.MIB->getTrapFillValue());
422424

423425
// Emit CFI end
424-
if (Function.hasCFI())
426+
if (NeedsFDE)
425427
Streamer.emitCFIEndProc();
426428

427429
MCSymbol *EndSymbol = Function.getFunctionEndLabel(FF.getFragmentNum());

bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -555,9 +555,9 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
555555
.addReg(RegCnt);
556556
}
557557

558-
InstructionListType createCmpJE(MCPhysReg RegNo, MCPhysReg RegTmp,
559-
const MCSymbol *Target,
560-
MCContext *Ctx) const {
558+
InstructionListType createRegCmpJE(MCPhysReg RegNo, MCPhysReg RegTmp,
559+
const MCSymbol *Target,
560+
MCContext *Ctx) const {
561561
InstructionListType Insts;
562562
Insts.emplace_back(
563563
MCInstBuilder(RISCV::SUB).addReg(RegTmp).addReg(RegNo).addReg(RegNo));
@@ -718,7 +718,7 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
718718
Insts.emplace_back();
719719
loadReg(Insts.back(), RISCV::X10, RISCV::X10, 0);
720720
InstructionListType cmpJmp =
721-
createCmpJE(RISCV::X10, RISCV::X11, IndCallHandler, Ctx);
721+
createRegCmpJE(RISCV::X10, RISCV::X11, IndCallHandler, Ctx);
722722
Insts.insert(Insts.end(), cmpJmp.begin(), cmpJmp.end());
723723
Insts.emplace_back();
724724
createStackPointerIncrement(Insts.back(), 16);
@@ -777,14 +777,13 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
777777
return createGetter(Ctx, "__bolt_instr_num_funcs");
778778
}
779779

780-
void convertIndirectCallToLoad(MCInst &Inst, MCPhysReg Reg,
781-
MCPhysReg ZeroReg) const {
780+
void convertIndirectCallToLoad(MCInst &Inst, MCPhysReg Reg) override {
782781
bool IsTailCall = isTailCall(Inst);
783782
if (IsTailCall)
784783
removeAnnotation(Inst, MCPlus::MCAnnotation::kTailCall);
785784
Inst.setOpcode(RISCV::ADD);
786785
Inst.insert(Inst.begin(), MCOperand::createReg(Reg));
787-
Inst.insert(Inst.begin() + 1, MCOperand::createReg(ZeroReg));
786+
Inst.insert(Inst.begin() + 1, MCOperand::createReg(RISCV::X0));
788787
return;
789788
}
790789

@@ -845,7 +844,7 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
845844
InstructionListType Insts;
846845
spillRegs(Insts, {RISCV::X10, RISCV::X11});
847846
Insts.emplace_back(CallInst);
848-
convertIndirectCallToLoad(Insts.back(), RISCV::X10, RISCV::X0);
847+
convertIndirectCallToLoad(Insts.back(), RISCV::X10);
849848
InstructionListType LoadImm = createLoadImmediate(RISCV::X11, CallSiteID);
850849
Insts.insert(Insts.end(), LoadImm.begin(), LoadImm.end());
851850
spillRegs(Insts, {RISCV::X10, RISCV::X11});

bolt/test/AArch64/lite-mode.s

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
# RUN: llvm-objdump -d --disassemble-symbols=cold_function %t.bolt \
1212
# RUN: | FileCheck %s
1313

14+
15+
## Verify that the number of FDEs matches the number of functions in the output
16+
## binary. There are three original functions and two optimized.
17+
# RUN: llvm-readelf -u %t.bolt | grep -wc FDE \
18+
# RUN: | FileCheck --check-prefix=CHECK-FDE %s
19+
# CHECK-FDE: 5
20+
1421
## In lite mode, optimized code will be separated from the original .text by
1522
## over 128MB, making it impossible for call/bl instructions in cold functions
1623
## to reach optimized functions directly.

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ set(LLVM_TOOLCHAIN_TOOLS
459459
llvm-libtool-darwin
460460
llvm-lipo
461461
llvm-ml
462+
llvm-mt
462463
llvm-nm
463464
llvm-objcopy
464465
llvm-objdump
@@ -480,10 +481,6 @@ set(LLVM_TOOLCHAIN_TOOLS
480481
scan-build-py
481482
CACHE STRING "")
482483

483-
if (LLVM_ENABLE_LIBXML2)
484-
list(APPEND LLVM_TOOLCHAIN_TOOLS llvm-mt)
485-
endif()
486-
487484
set(LLVM_Toolchain_DISTRIBUTION_COMPONENTS
488485
bolt
489486
clang

clang/docs/ReleaseNotes.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ C++ Language Changes
9696
asm((std::string_view("nop")) ::: (std::string_view("memory")));
9797
}
9898

99+
- Clang now implements the changes to overload resolution proposed by section 1 and 2 of
100+
`P3606 <https://wg21.link/P3606R0>`_. If a non-template candidate exists in an overload set that is
101+
a perfect match (all conversion sequences are identity conversions) template candidates are not instantiated.
102+
Diagnostics that would have resulted from the instantiation of these template candidates are no longer
103+
produced. This aligns Clang closer to the behavior of GCC, and fixes (#GH62096), (#GH74581), and (#GH74581).
104+
99105
C++2c Feature Support
100106
^^^^^^^^^^^^^^^^^^^^^
101107

@@ -385,6 +391,10 @@ Improvements to Clang's diagnostics
385391

386392
Fixes #GH131127
387393

394+
- ``-Wuninitialized`` now diagnoses when a class does not declare any
395+
constructors to initialize their non-modifiable members. The diagnostic is
396+
not new; being controlled via a warning group is what's new. Fixes #GH41104
397+
388398
- The ``-Wloop-analysis`` warning now handles variable modifications inside lambda expressions (#GH132038).
389399

390400
Improvements to Clang's time-trace

clang/include/clang/AST/RecordLayout.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ class ASTRecordLayout {
7575
// performance or backwards compatibility preserving (e.g. AIX-ABI).
7676
CharUnits PreferredAlignment;
7777

78-
// UnadjustedAlignment - Maximum of the alignments of the record members in
79-
// characters.
78+
// UnadjustedAlignment - Alignment of record in characters before alignment
79+
// adjustments. Maximum of the alignments of the record members and base
80+
// classes in characters.
8081
CharUnits UnadjustedAlignment;
8182

8283
/// RequiredAlignment - The required alignment of the object. In the MS-ABI
@@ -186,7 +187,7 @@ class ASTRecordLayout {
186187
CharUnits getPreferredAlignment() const { return PreferredAlignment; }
187188

188189
/// getUnadjustedAlignment - Get the record alignment in characters, before
189-
/// alignment adjustement.
190+
/// alignment adjustment.
190191
CharUnits getUnadjustedAlignment() const { return UnadjustedAlignment; }
191192

192193
/// getSize - Get the record size in characters.

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2266,7 +2266,8 @@ def err_constructor_byvalue_arg : Error<
22662266
"copy constructor must pass its first argument by reference">;
22672267
def warn_no_constructor_for_refconst : Warning<
22682268
"%select{struct|interface|union|class|enum}0 %1 does not declare any "
2269-
"constructor to initialize its non-modifiable members">;
2269+
"constructor to initialize its non-modifiable members">,
2270+
InGroup<Uninitialized>;
22702271
def note_refconst_member_not_initialized : Note<
22712272
"%select{const|reference}0 member %1 will never be initialized">;
22722273
def ext_ms_explicit_constructor_call : ExtWarn<

clang/include/clang/Driver/Options.td

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7889,9 +7889,13 @@ def code_completion_with_fixits : Flag<["-"], "code-completion-with-fixits">,
78897889
def skip_function_bodies : Flag<["-"], "skip-function-bodies">,
78907890
HelpText<"Skip function bodies when possible">,
78917891
MarshallingInfoFlag<FrontendOpts<"SkipFunctionBodies">>;
7892-
def disable_free : Flag<["-"], "disable-free">,
7893-
HelpText<"Disable freeing of memory on exit">,
7894-
MarshallingInfoFlag<FrontendOpts<"DisableFree">>;
7892+
defm disable_free : BoolOption<"",
7893+
"disable-free",
7894+
FrontendOpts<"DisableFree">,
7895+
DefaultFalse,
7896+
PosFlag<SetTrue, [], [ClangOption], "Disable">,
7897+
NegFlag<SetFalse, [], [ClangOption], "Don't disable">,
7898+
BothFlags<[], [ClangOption], " freeing of memory on exit">>;
78957899
defm clear_ast_before_backend : BoolOption<"",
78967900
"clear-ast-before-backend",
78977901
CodeGenOpts<"ClearASTBeforeBackend">,

0 commit comments

Comments
 (0)