Skip to content

Commit 9241efc

Browse files
committed
Merge branch 'main' into pauth-gnuprop-mc
2 parents 6182b04 + 4a6bc9f commit 9241efc

File tree

3,185 files changed

+89450
-32004
lines changed

Some content is hidden

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

3,185 files changed

+89450
-32004
lines changed

.ci/generate-buildkite-pipeline-premerge

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function compute-projects-to-test() {
6868
done
6969
;;
7070
clang)
71-
for p in clang-tools-extra compiler-rt flang libc lldb openmp cross-project-tests; do
71+
for p in clang-tools-extra compiler-rt flang lldb cross-project-tests; do
7272
echo $p
7373
done
7474
;;
@@ -224,7 +224,7 @@ fi
224224
# needs while letting them run on the infrastructure provided by LLVM.
225225

226226
# Figure out which projects need to be built on each platform
227-
all_projects="bolt clang-tools-extra compiler-rt cross-project-tests flang libc libclc lld lldb llvm mlir openmp polly pstl"
227+
all_projects="bolt clang clang-tools-extra compiler-rt cross-project-tests flang libc libclc lld lldb llvm mlir openmp polly pstl"
228228
modified_projects="$(keep-modified-projects ${all_projects})"
229229

230230
linux_projects_to_test=$(exclude-linux $(compute-projects-to-test ${modified_projects}))

.ci/monolithic-linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
5454

5555
echo "--- ninja"
5656
# Targets are not escaped as they are passed as separate arguments.
57-
ninja -C "${BUILD_DIR}" ${targets}
57+
ninja -C "${BUILD_DIR}" -k 0 ${targets}

.ci/monolithic-windows.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
6262

6363
echo "--- ninja"
6464
# Targets are not escaped as they are passed as separate arguments.
65-
ninja -C "${BUILD_DIR}" ${targets}
65+
ninja -C "${BUILD_DIR}" -k 0 ${targets}

.github/CODEOWNERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
/clang/www/cxx_dr_status.html @Endilll
3333
/clang/www/make_cxx_dr_status @Endilll
3434

35+
clang/lib/AST/Interp/ @tbaederr
36+
clang/test/AST/Interp/ @tbaederr
37+
3538
/lldb/ @JDevlieghere
3639

3740
# MLIR Interfaces.
@@ -105,3 +108,6 @@
105108

106109
# BOLT
107110
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @dcci
111+
112+
# Bazel build system.
113+
/utils/bazel/ @rupprecht

.github/new-prs-labeler.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,8 @@ backend:DirectX:
629629
- '**/*DirectX*/**'
630630
- '**/*DXIL*/**'
631631
- '**/*dxil*/**'
632+
- '**/*DXContainer*'
633+
- '**/*DXContainer*/**'
632634

633635
backend:SPIR-V:
634636
- clang/lib/Driver/ToolChains/SPIRV.*
@@ -933,3 +935,6 @@ openmp:libomp:
933935

934936
openmp:libomptarget:
935937
- any: ['openmp/**', '!openmp/runtime/**']
938+
939+
bazel:
940+
- utils/bazel/**

.github/workflows/llvm-project-tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ jobs:
118118
else
119119
builddir="$(pwd)"/build
120120
fi
121+
if [ "${{ runner.os }}" == "macOS" ]; then
122+
# Workaround test failure on some lld tests on MacOS
123+
# https://github.com/llvm/llvm-project/issues/81967
124+
extra_cmake_args="-DLLVM_DISABLE_ASSEMBLY_FILES=ON"
125+
fi
121126
echo "llvm-builddir=$builddir" >> "$GITHUB_OUTPUT"
122127
cmake -G Ninja \
123128
-B "$builddir" \

.github/workflows/pr-code-format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- name: Install clang-format
5454
uses: aminya/setup-cpp@v1
5555
with:
56-
clangformat: 17.0.1
56+
clangformat: 18.1.1
5757

5858
- name: Setup Python env
5959
uses: actions/setup-python@v4

.github/workflows/release-binaries.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ jobs:
7171
# | X.Y.Z | -final
7272
run: |
7373
tag="${{ github.ref_name }}"
74-
trimmed=$(echo ${{ inputs.tag }} | xargs)
75-
[[ "$trimmed" != "" ]] && tag="$trimmed"
74+
trimmed=$(echo ${{ inputs.release-version }} | xargs)
75+
[[ "$trimmed" != "" ]] && tag="llvmorg-$trimmed"
7676
if [ "$tag" = "main" ]; then
7777
# If tag is main, then we've been triggered by a scheduled so pass so
7878
# use the head commit as the tag.

bolt/include/bolt/Core/DIEBuilder.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,13 @@ class DIEBuilder {
209209
void updateReferences();
210210

211211
/// Update the Offset and Size of DIE, populate DebugNames table.
212-
uint32_t finalizeDIEs(DWARFUnit &CU, DIE &Die, uint32_t &CurOffset);
212+
/// Along with current CU, and DIE being processed and the new DIE offset to
213+
/// be updated, it takes in Parents vector that can be empty if this DIE has
214+
/// no parents.
215+
uint32_t
216+
finalizeDIEs(DWARFUnit &CU, DIE &Die,
217+
std::vector<std::optional<BOLTDWARF5AccelTableData *>> &Parents,
218+
uint32_t &CurOffset);
213219

214220
void registerUnit(DWARFUnit &DU, bool NeedSort);
215221

bolt/include/bolt/Core/DebugNames.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ class BOLTDWARF5AccelTableData : public DWARF5AccelTableData {
3636
bool isTU() const { return DWARF5AccelTableData::isTU(); }
3737
std::optional<unsigned> getSecondUnitID() const { return SecondUnitID; }
3838

39+
void setPatchOffset(uint64_t PatchOffset) { OffsetVal = PatchOffset; }
40+
uint64_t getPatchOffset() const { return std::get<uint64_t>(OffsetVal); }
41+
3942
private:
4043
std::optional<unsigned> SecondUnitID;
4144
};
@@ -49,10 +52,12 @@ class DWARF5AcceleratorTable {
4952
Abbrev->~DebugNamesAbbrev();
5053
}
5154
/// Add DWARF5 Accelerator table entry.
52-
/// Input is DWARFUnit being processed, DIE that belongs to it, and potential
53-
/// SkeletonCU if the Unit comes from a DWO section.
54-
void addAccelTableEntry(DWARFUnit &Unit, const DIE &Die,
55-
const std::optional<uint64_t> &DWOID);
55+
/// Input is DWARFUnit being processed, DIE that belongs to it, potential
56+
/// DWOID if the Unit comes from a DWO section, and potential parent entry.
57+
std::optional<BOLTDWARF5AccelTableData *>
58+
addAccelTableEntry(DWARFUnit &Unit, const DIE &Die,
59+
const std::optional<uint64_t> &DWOID,
60+
std::optional<BOLTDWARF5AccelTableData *> &Parent);
5661
/// Set current unit being processed.
5762
void setCurrentUnit(DWARFUnit &Unit, const uint64_t UnitStartOffset);
5863
/// Emit Accelerator table.
@@ -121,6 +126,8 @@ class DWARF5AcceleratorTable {
121126
llvm::DenseMap<llvm::hash_code, uint64_t> StrCacheToOffsetMap;
122127
// Contains DWO ID to CUList Index.
123128
llvm::DenseMap<uint64_t, uint32_t> CUOffsetsToPatch;
129+
// Contains a map of Entry ID to Entry relative offset.
130+
llvm::DenseMap<uint64_t, uint32_t> EntryRelativeOffsets;
124131
/// Adds Unit to either CUList, LocalTUList or ForeignTUList.
125132
/// Input Unit being processed, and DWO ID if Unit is being processed comes
126133
/// from a DWO section.
@@ -143,7 +150,7 @@ class DWARF5AcceleratorTable {
143150
/// Write Entries.
144151
void writeEntries();
145152
/// Write an Entry.
146-
void writeEntry(const BOLTDWARF5AccelTableData &Entry);
153+
void writeEntry(BOLTDWARF5AccelTableData &Entry);
147154
/// Write augmentation_string for BOLT.
148155
void writeAugmentationString();
149156
/// Emit out Header for DWARF5 Accelerator table.

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 27 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -487,10 +487,9 @@ class MCPlusBuilder {
487487
llvm_unreachable("not implemented");
488488
}
489489

490-
virtual bool createDirectCall(MCInst &Inst, const MCSymbol *Target,
490+
virtual void createDirectCall(MCInst &Inst, const MCSymbol *Target,
491491
MCContext *Ctx, bool IsTailCall) {
492492
llvm_unreachable("not implemented");
493-
return false;
494493
}
495494

496495
virtual MCPhysReg getX86R11() const { llvm_unreachable("not implemented"); }
@@ -1534,15 +1533,13 @@ class MCPlusBuilder {
15341533
}
15351534

15361535
/// Create a no-op instruction.
1537-
virtual bool createNoop(MCInst &Inst) const {
1536+
virtual void createNoop(MCInst &Inst) const {
15381537
llvm_unreachable("not implemented");
1539-
return false;
15401538
}
15411539

15421540
/// Create a return instruction.
1543-
virtual bool createReturn(MCInst &Inst) const {
1541+
virtual void createReturn(MCInst &Inst) const {
15441542
llvm_unreachable("not implemented");
1545-
return false;
15461543
}
15471544

15481545
/// Store \p Target absolute address to \p RegName
@@ -1556,32 +1553,30 @@ class MCPlusBuilder {
15561553

15571554
/// Creates a new unconditional branch instruction in Inst and set its operand
15581555
/// to TBB.
1559-
///
1560-
/// Returns true on success.
1561-
virtual bool createUncondBranch(MCInst &Inst, const MCSymbol *TBB,
1556+
virtual void createUncondBranch(MCInst &Inst, const MCSymbol *TBB,
15621557
MCContext *Ctx) const {
15631558
llvm_unreachable("not implemented");
1564-
return false;
1559+
}
1560+
1561+
/// Create a version of unconditional jump that has the largest span for a
1562+
/// single instruction with direct target.
1563+
virtual void createLongUncondBranch(MCInst &Inst, const MCSymbol *Target,
1564+
MCContext *Ctx) const {
1565+
llvm_unreachable("not implemented");
15651566
}
15661567

15671568
/// Creates a new call instruction in Inst and sets its operand to
15681569
/// Target.
1569-
///
1570-
/// Returns true on success.
1571-
virtual bool createCall(MCInst &Inst, const MCSymbol *Target,
1570+
virtual void createCall(MCInst &Inst, const MCSymbol *Target,
15721571
MCContext *Ctx) {
15731572
llvm_unreachable("not implemented");
1574-
return false;
15751573
}
15761574

15771575
/// Creates a new tail call instruction in Inst and sets its operand to
15781576
/// Target.
1579-
///
1580-
/// Returns true on success.
1581-
virtual bool createTailCall(MCInst &Inst, const MCSymbol *Target,
1577+
virtual void createTailCall(MCInst &Inst, const MCSymbol *Target,
15821578
MCContext *Ctx) {
15831579
llvm_unreachable("not implemented");
1584-
return false;
15851580
}
15861581

15871582
virtual void createLongTailCall(InstructionListType &Seq,
@@ -1590,43 +1585,36 @@ class MCPlusBuilder {
15901585
}
15911586

15921587
/// Creates a trap instruction in Inst.
1593-
///
1594-
/// Returns true on success.
1595-
virtual bool createTrap(MCInst &Inst) const {
1588+
virtual void createTrap(MCInst &Inst) const {
15961589
llvm_unreachable("not implemented");
1597-
return false;
15981590
}
15991591

16001592
/// Creates an instruction to bump the stack pointer just like a call.
1601-
virtual bool createStackPointerIncrement(MCInst &Inst, int Size = 8,
1593+
virtual void createStackPointerIncrement(MCInst &Inst, int Size = 8,
16021594
bool NoFlagsClobber = false) const {
16031595
llvm_unreachable("not implemented");
1604-
return false;
16051596
}
16061597

16071598
/// Creates an instruction to move the stack pointer just like a ret.
1608-
virtual bool createStackPointerDecrement(MCInst &Inst, int Size = 8,
1599+
virtual void createStackPointerDecrement(MCInst &Inst, int Size = 8,
16091600
bool NoFlagsClobber = false) const {
16101601
llvm_unreachable("not implemented");
1611-
return false;
16121602
}
16131603

16141604
/// Create a store instruction using \p StackReg as the base register
16151605
/// and \p Offset as the displacement.
1616-
virtual bool createSaveToStack(MCInst &Inst, const MCPhysReg &StackReg,
1606+
virtual void createSaveToStack(MCInst &Inst, const MCPhysReg &StackReg,
16171607
int Offset, const MCPhysReg &SrcReg,
16181608
int Size) const {
16191609
llvm_unreachable("not implemented");
1620-
return false;
16211610
}
16221611

1623-
virtual bool createLoad(MCInst &Inst, const MCPhysReg &BaseReg, int64_t Scale,
1612+
virtual void createLoad(MCInst &Inst, const MCPhysReg &BaseReg, int64_t Scale,
16241613
const MCPhysReg &IndexReg, int64_t Offset,
16251614
const MCExpr *OffsetExpr,
16261615
const MCPhysReg &AddrSegmentReg,
16271616
const MCPhysReg &DstReg, int Size) const {
16281617
llvm_unreachable("not implemented");
1629-
return false;
16301618
}
16311619

16321620
virtual InstructionListType createLoadImmediate(const MCPhysReg Dest,
@@ -1636,32 +1624,27 @@ class MCPlusBuilder {
16361624

16371625
/// Create a fragment of code (sequence of instructions) that load a 32-bit
16381626
/// address from memory, zero-extends it to 64 and jump to it (indirect jump).
1639-
virtual bool
1627+
virtual void
16401628
createIJmp32Frag(SmallVectorImpl<MCInst> &Insts, const MCOperand &BaseReg,
16411629
const MCOperand &Scale, const MCOperand &IndexReg,
16421630
const MCOperand &Offset, const MCOperand &TmpReg) const {
16431631
llvm_unreachable("not implemented");
1644-
return false;
16451632
}
16461633

16471634
/// Create a load instruction using \p StackReg as the base register
16481635
/// and \p Offset as the displacement.
1649-
virtual bool createRestoreFromStack(MCInst &Inst, const MCPhysReg &StackReg,
1636+
virtual void createRestoreFromStack(MCInst &Inst, const MCPhysReg &StackReg,
16501637
int Offset, const MCPhysReg &DstReg,
16511638
int Size) const {
16521639
llvm_unreachable("not implemented");
1653-
return false;
16541640
}
16551641

16561642
/// Creates a call frame pseudo instruction. A single operand identifies which
16571643
/// MCCFIInstruction this MCInst is referring to.
1658-
///
1659-
/// Returns true on success.
1660-
virtual bool createCFI(MCInst &Inst, int64_t Offset) const {
1644+
virtual void createCFI(MCInst &Inst, int64_t Offset) const {
16611645
Inst.clear();
16621646
Inst.setOpcode(TargetOpcode::CFI_INSTRUCTION);
16631647
Inst.addOperand(MCOperand::createImm(Offset));
1664-
return true;
16651648
}
16661649

16671650
/// Create an inline version of memcpy(dest, src, 1).
@@ -1699,6 +1682,12 @@ class MCPlusBuilder {
16991682
return Inst.getOpcode() == TargetOpcode::CFI_INSTRUCTION;
17001683
}
17011684

1685+
/// Create a conditional branch with a target-specific conditional code \p CC.
1686+
virtual void createCondBranch(MCInst &Inst, const MCSymbol *Target,
1687+
unsigned CC, MCContext *Ctx) const {
1688+
llvm_unreachable("not implemented");
1689+
}
1690+
17021691
/// Reverses the branch condition in Inst and update its taken target to TBB.
17031692
///
17041693
/// Returns true on success.

bolt/lib/Core/DIEBuilder.cpp

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,20 +377,32 @@ getUnitForOffset(DIEBuilder &Builder, DWARFContext &DWCtx,
377377
return nullptr;
378378
}
379379

380-
uint32_t DIEBuilder::finalizeDIEs(DWARFUnit &CU, DIE &Die,
381-
uint32_t &CurOffset) {
380+
uint32_t DIEBuilder::finalizeDIEs(
381+
DWARFUnit &CU, DIE &Die,
382+
std::vector<std::optional<BOLTDWARF5AccelTableData *>> &Parents,
383+
uint32_t &CurOffset) {
382384
getState().DWARFDieAddressesParsed.erase(Die.getOffset());
383385
uint32_t CurSize = 0;
384386
Die.setOffset(CurOffset);
385-
DebugNamesTable.addAccelTableEntry(
386-
CU, Die, SkeletonCU ? SkeletonCU->getDWOId() : std::nullopt);
387+
std::optional<BOLTDWARF5AccelTableData *> NameEntry =
388+
DebugNamesTable.addAccelTableEntry(
389+
CU, Die, SkeletonCU ? SkeletonCU->getDWOId() : std::nullopt,
390+
Parents.back());
391+
// It is possible that an indexed debugging information entry has a parent
392+
// that is not indexed (for example, if its parent does not have a name
393+
// attribute). In such a case, a parent attribute may point to a nameless
394+
// index entry (that is, one that cannot be reached from any entry in the name
395+
// table), or it may point to the nearest ancestor that does have an index
396+
// entry.
397+
if (NameEntry)
398+
Parents.push_back(std::move(NameEntry));
387399
for (DIEValue &Val : Die.values())
388400
CurSize += Val.sizeOf(CU.getFormParams());
389401
CurSize += getULEB128Size(Die.getAbbrevNumber());
390402
CurOffset += CurSize;
391403

392404
for (DIE &Child : Die.children()) {
393-
uint32_t ChildSize = finalizeDIEs(CU, Child, CurOffset);
405+
uint32_t ChildSize = finalizeDIEs(CU, Child, Parents, CurOffset);
394406
CurSize += ChildSize;
395407
}
396408
// for children end mark.
@@ -400,6 +412,8 @@ uint32_t DIEBuilder::finalizeDIEs(DWARFUnit &CU, DIE &Die,
400412
}
401413

402414
Die.setSize(CurSize);
415+
if (NameEntry)
416+
Parents.pop_back();
403417

404418
return CurSize;
405419
}
@@ -410,7 +424,9 @@ void DIEBuilder::finish() {
410424
uint32_t HeaderSize = CU.getHeaderSize();
411425
uint32_t CurOffset = HeaderSize;
412426
DebugNamesTable.setCurrentUnit(CU, UnitStartOffset);
413-
finalizeDIEs(CU, *UnitDIE, CurOffset);
427+
std::vector<std::optional<BOLTDWARF5AccelTableData *>> Parents;
428+
Parents.push_back(std::nullopt);
429+
finalizeDIEs(CU, *UnitDIE, Parents, CurOffset);
414430

415431
DWARFUnitInfo &CurUnitInfo = getUnitInfoByDwarfUnit(CU);
416432
CurUnitInfo.UnitOffset = UnitStartOffset;

0 commit comments

Comments
 (0)