Skip to content

Commit 0cefa3a

Browse files
authored
Merge branch 'main' into hgh/libcxx/clean-up_saturation_arithmetic_tests
2 parents 6837f7d + 5cc2ae0 commit 0cefa3a

File tree

41 files changed

+958
-400
lines changed

Some content is hidden

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

41 files changed

+958
-400
lines changed

libcxx/test/std/utilities/meta/meta.rel/is_virtual_base_of.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20, c++23
1010

1111
// These compilers don't support __builtin_is_virtual_base_of yet.
12-
// UNSUPPORTED: clang-18, clang-19, gcc-14, apple-clang-16
12+
// UNSUPPORTED: clang-18, clang-19, gcc-14, apple-clang-16, apple-clang-17
1313

1414
// <type_traits>
1515

llvm/include/llvm/CodeGen/AntiDepBreaker.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class AntiDepBreaker {
5656

5757
/// Update DBG_VALUE or DBG_PHI if dependency breaker is updating
5858
/// other machine instruction to use NewReg.
59-
void UpdateDbgValue(MachineInstr &MI, unsigned OldReg, unsigned NewReg) {
59+
void UpdateDbgValue(MachineInstr &MI, MCRegister OldReg, MCRegister NewReg) {
6060
if (MI.isDebugValue()) {
6161
if (MI.getDebugOperand(0).isReg() &&
6262
MI.getDebugOperand(0).getReg() == OldReg)
@@ -73,7 +73,7 @@ class AntiDepBreaker {
7373
/// Update all DBG_VALUE instructions that may be affected by the dependency
7474
/// breaker's update of ParentMI to use NewReg.
7575
void UpdateDbgValues(const DbgValueVector &DbgValues, MachineInstr *ParentMI,
76-
unsigned OldReg, unsigned NewReg) {
76+
MCRegister OldReg, MCRegister NewReg) {
7777
// The following code is dependent on the order in which the DbgValues are
7878
// constructed in ScheduleDAGInstrs::buildSchedGraph.
7979
MachineInstr *PrevDbgMI = nullptr;

llvm/include/llvm/CodeGen/DebugHandlerBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class MachineModuleInfo;
3030
/// Represents the location at which a variable is stored.
3131
struct DbgVariableLocation {
3232
/// Base register.
33-
unsigned Register;
33+
MCRegister Register;
3434

3535
/// Chain of offsetted loads necessary to load the value if it lives in
3636
/// memory. Every load except for the last is pointer-sized.

llvm/include/llvm/MC/MCExpr.h

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,6 @@ class MCSymbolRefExpr : public MCExpr {
249249

250250
VK_COFF_IMGREL32, // symbol@imgrel (image-relative)
251251

252-
VK_Hexagon_LO16,
253-
VK_Hexagon_HI16,
254-
VK_Hexagon_GPREL,
255-
VK_Hexagon_GD_GOT,
256-
VK_Hexagon_LD_GOT,
257-
VK_Hexagon_GD_PLT,
258-
VK_Hexagon_LD_PLT,
259-
VK_Hexagon_IE,
260-
VK_Hexagon_IE_GOT,
261-
262252
VK_WASM_TYPEINDEX, // Reference to a symbol's type (signature)
263253
VK_WASM_TLSREL, // Memory address relative to __tls_base
264254
VK_WASM_MBREL, // Memory address relative to __memory_base
@@ -310,6 +300,10 @@ class MCSymbolRefExpr : public MCExpr {
310300

311301
static const MCSymbolRefExpr *create(const MCSymbol *Symbol, VariantKind Kind,
312302
MCContext &Ctx, SMLoc Loc = SMLoc());
303+
static const MCSymbolRefExpr *create(const MCSymbol *Symbol, uint16_t Kind,
304+
MCContext &Ctx, SMLoc Loc = SMLoc()) {
305+
return MCSymbolRefExpr::create(Symbol, VariantKind(Kind), Ctx, Loc);
306+
}
313307

314308
/// @}
315309
/// \name Accessors
@@ -577,7 +571,9 @@ class MCTargetExpr : public MCExpr {
577571
virtual void visitUsedExpr(MCStreamer& Streamer) const = 0;
578572
virtual MCFragment *findAssociatedFragment() const = 0;
579573

580-
virtual void fixELFSymbolsInTLSFixups(MCAssembler &) const = 0;
574+
// Deprecated way to set the type of referenced ELF symbols to STT_TLS when
575+
// the derived MCELFObjectTargetWriter::getRelocType does not update symbols.
576+
virtual void fixELFSymbolsInTLSFixups(MCAssembler &) const {}
581577

582578
static bool classof(const MCExpr *E) {
583579
return E->getKind() == MCExpr::Target;

llvm/include/llvm/Transforms/Utils/Cloning.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -244,25 +244,6 @@ DISubprogram *CollectDebugInfoForCloning(const Function &F,
244244
CloneFunctionChangeType Changes,
245245
DebugInfoFinder &DIFinder);
246246

247-
/// Based on \p Changes and \p DIFinder return debug info that needs to be
248-
/// identity mapped during Metadata cloning.
249-
///
250-
/// NOTE: Such \a MetadataSetTy can be used by \a CloneFunction* to directly
251-
/// specify metadata that should be identity mapped (and hence not cloned). The
252-
/// metadata will be identity mapped in \a ValueToValueMapTy on first use. There
253-
/// are several reasons for doing it this way rather than eagerly identity
254-
/// mapping metadata nodes in a \a ValueMap:
255-
/// 1. Mapping metadata is not cheap, particularly because of tracking.
256-
/// 2. When cloning a Function we identity map lots of global module-level
257-
/// metadata to avoid cloning it, while only a fraction of it is actually
258-
/// used by the function. Mapping on first use is a lot faster for modules
259-
/// with meaningful amount of debug info.
260-
/// 3. Eagerly identity mapping metadata makes it harder to cache module-level
261-
/// data (e.g. a set of metadata nodes in a \a DICompileUnit).
262-
MetadataSetTy FindDebugInfoToIdentityMap(CloneFunctionChangeType Changes,
263-
DebugInfoFinder &DIFinder,
264-
DISubprogram *SPClonedWithinModule);
265-
266247
/// This class captures the data input to the InlineFunction call, and records
267248
/// the auxiliary results produced by it.
268249
class InlineFunctionInfo {

llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ void CodeViewDebug::calculateRanges(
13611361
}
13621362

13631363
// We can only handle a register or an offseted load of a register.
1364-
if (Location->Register == 0 || Location->LoadChain.size() > 1)
1364+
if (!Location->Register || Location->LoadChain.size() > 1)
13651365
continue;
13661366

13671367
// Codeview can only express byte-aligned offsets, ensure that we have a

llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ DbgVariableLocation::extractFromMachineInstruction(
3939
return std::nullopt;
4040
if (!Instruction.getDebugOperand(0).isReg())
4141
return std::nullopt;
42-
Location.Register = Instruction.getDebugOperand(0).getReg();
42+
Location.Register = Instruction.getDebugOperand(0).getReg().asMCReg();
4343
Location.FragmentInfo.reset();
4444
// We only handle expressions generated by DIExpression::appendOffset,
4545
// which doesn't require a full stack machine.

llvm/lib/MC/MCWinCOFFStreamer.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ class MCCOFFSectionNumberTargetExpr final : public MCTargetExpr {
8282
MCFragment *findAssociatedFragment() const override {
8383
return SectionSymbol.getFragment();
8484
}
85-
86-
void fixELFSymbolsInTLSFixups(MCAssembler &) const override {
87-
llvm_unreachable("Not supported for ELF");
88-
}
8985
};
9086

9187
/// MCExpr that represents the offset to a symbol from the beginning of its
@@ -123,10 +119,6 @@ class MCCOFFSectionOffsetTargetExpr final : public MCTargetExpr {
123119
MCFragment *findAssociatedFragment() const override {
124120
return Symbol.getFragment();
125121
}
126-
127-
void fixELFSymbolsInTLSFixups(MCAssembler &) const override {
128-
llvm_unreachable("Not supported for ELF");
129-
}
130122
};
131123

132124
MCWinCOFFStreamer::MCWinCOFFStreamer(MCContext &Context,

llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,19 @@ unsigned AArch64ELFObjectWriter::getRelocType(MCContext &Ctx,
126126
Target.getSymB()->getKind() == MCSymbolRefExpr::VK_None) &&
127127
"Should only be expression-level modifiers here");
128128

129+
switch (SymLoc) {
130+
case AArch64MCExpr::VK_DTPREL:
131+
case AArch64MCExpr::VK_GOTTPREL:
132+
case AArch64MCExpr::VK_TPREL:
133+
case AArch64MCExpr::VK_TLSDESC:
134+
case AArch64MCExpr::VK_TLSDESC_AUTH:
135+
if (auto *S = Target.getSymA())
136+
cast<MCSymbolELF>(S->getSymbol()).setType(ELF::STT_TLS);
137+
break;
138+
default:
139+
break;
140+
}
141+
129142
if (IsPCRel) {
130143
switch (Kind) {
131144
case FK_Data_1:

llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.cpp

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -120,50 +120,6 @@ bool AArch64MCExpr::evaluateAsRelocatableImpl(MCValue &Res,
120120
return true;
121121
}
122122

123-
static void fixELFSymbolsInTLSFixupsImpl(const MCExpr *Expr, MCAssembler &Asm) {
124-
switch (Expr->getKind()) {
125-
case MCExpr::Target:
126-
llvm_unreachable("Can't handle nested target expression");
127-
break;
128-
case MCExpr::Constant:
129-
break;
130-
131-
case MCExpr::Binary: {
132-
const MCBinaryExpr *BE = cast<MCBinaryExpr>(Expr);
133-
fixELFSymbolsInTLSFixupsImpl(BE->getLHS(), Asm);
134-
fixELFSymbolsInTLSFixupsImpl(BE->getRHS(), Asm);
135-
break;
136-
}
137-
138-
case MCExpr::SymbolRef: {
139-
// We're known to be under a TLS fixup, so any symbol should be
140-
// modified. There should be only one.
141-
const MCSymbolRefExpr &SymRef = *cast<MCSymbolRefExpr>(Expr);
142-
cast<MCSymbolELF>(SymRef.getSymbol()).setType(ELF::STT_TLS);
143-
break;
144-
}
145-
146-
case MCExpr::Unary:
147-
fixELFSymbolsInTLSFixupsImpl(cast<MCUnaryExpr>(Expr)->getSubExpr(), Asm);
148-
break;
149-
}
150-
}
151-
152-
void AArch64MCExpr::fixELFSymbolsInTLSFixups(MCAssembler &Asm) const {
153-
switch (getSymbolLoc(Kind)) {
154-
default:
155-
return;
156-
case VK_DTPREL:
157-
case VK_GOTTPREL:
158-
case VK_TPREL:
159-
case VK_TLSDESC:
160-
case VK_TLSDESC_AUTH:
161-
break;
162-
}
163-
164-
fixELFSymbolsInTLSFixupsImpl(getSubExpr(), Asm);
165-
}
166-
167123
const AArch64AuthMCExpr *AArch64AuthMCExpr::create(const MCExpr *Expr,
168124
uint16_t Discriminator,
169125
AArch64PACKey::ID Key,

0 commit comments

Comments
 (0)