[llvm] [MC] Rename getPrivateGlobalPrefix to getInternalSymbolPrefix. NFC (PR #185164)

via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 7 00:25:07 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-amdgpu

@llvm/pr-subscribers-backend-sparc

Author: Fangrui Song (MaskRay)

<details>
<summary>Changes</summary>

Rename the API in both MCAsmInfo and DataLayout as a step toward
adopting the "internal symbol prefix" terminology
(https://sourceware.org/pipermail/binutils/2026-March/148448.html).

The term "internal symbol" better describes the purpose of these
symbols: they are for internal use by compilers and assemblers, not
meant to be visible externally.


---

Patch is 31.94 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/185164.diff


30 Files Affected:

- (modified) bolt/lib/Core/BinaryContext.cpp (+1-1) 
- (modified) bolt/lib/Passes/ReorderData.cpp (+1-1) 
- (modified) bolt/lib/Rewrite/RewriteInstance.cpp (+2-2) 
- (modified) llvm/include/llvm/IR/DataLayout.h (+1-1) 
- (modified) llvm/include/llvm/MC/MCAsmInfo.h (+5-5) 
- (modified) llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (+2-2) 
- (modified) llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp (+1-1) 
- (modified) llvm/lib/CodeGen/MachineFunction.cpp (+2-2) 
- (modified) llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp (+1-1) 
- (modified) llvm/lib/IR/Mangler.cpp (+1-1) 
- (modified) llvm/lib/MC/ELFObjectWriter.cpp (+1-1) 
- (modified) llvm/lib/MC/MCContext.cpp (+6-6) 
- (modified) llvm/lib/MC/MCStreamer.cpp (+1-1) 
- (modified) llvm/lib/Target/AMDGPU/AMDGPUMCResourceInfo.cpp (+1-1) 
- (modified) llvm/lib/Target/ARM/ARMAsmPrinter.cpp (+13-13) 
- (modified) llvm/lib/Target/ARM/ARMISelLowering.cpp (+4-5) 
- (modified) llvm/lib/Target/CSKY/CSKYAsmPrinter.cpp (+3-3) 
- (modified) llvm/lib/Target/Lanai/LanaiAsmPrinter.cpp (+2-2) 
- (modified) llvm/lib/Target/Lanai/LanaiMCInstLower.cpp (+6-6) 
- (modified) llvm/lib/Target/M68k/M68kAsmPrinter.cpp (+1-1) 
- (modified) llvm/lib/Target/M68k/M68kMCInstLower.cpp (+1-1) 
- (modified) llvm/lib/Target/MSP430/MSP430MCInstLower.cpp (+6-6) 
- (modified) llvm/lib/Target/Mips/MipsAsmPrinter.cpp (+1-1) 
- (modified) llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp (+1-1) 
- (modified) llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp (+4-4) 
- (modified) llvm/lib/Target/Sparc/SparcAsmPrinter.cpp (+1-1) 
- (modified) llvm/lib/Target/TargetLoweringObjectFile.cpp (+1-1) 
- (modified) llvm/lib/Target/X86/X86MCInstLower.cpp (+1-1) 
- (modified) llvm/lib/Target/XCore/XCoreAsmPrinter.cpp (+1-1) 
- (modified) llvm/lib/Target/Xtensa/XtensaAsmPrinter.cpp (+1-1) 


``````````diff
diff --git a/bolt/lib/Core/BinaryContext.cpp b/bolt/lib/Core/BinaryContext.cpp
index f492a91b788ec..5b3baf1669624 100644
--- a/bolt/lib/Core/BinaryContext.cpp
+++ b/bolt/lib/Core/BinaryContext.cpp
@@ -1870,7 +1870,7 @@ void BinaryContext::preprocessDebugInfo() {
   uint64_t NumMissingDWOs = 0;
 
   // Populate MCContext with DWARF files from all units.
-  StringRef GlobalPrefix = AsmInfo->getPrivateGlobalPrefix();
+  StringRef GlobalPrefix = AsmInfo->getInternalSymbolPrefix();
   for (const std::unique_ptr<DWARFUnit> &CU : DwCtx->compile_units()) {
     const uint64_t CUID = CU->getOffset();
     DwarfLineTable &BinaryLineTable = getDwarfLineTable(CUID);
diff --git a/bolt/lib/Passes/ReorderData.cpp b/bolt/lib/Passes/ReorderData.cpp
index 2b04361c9463f..fce0c8f12b393 100644
--- a/bolt/lib/Passes/ReorderData.cpp
+++ b/bolt/lib/Passes/ReorderData.cpp
@@ -408,7 +408,7 @@ bool ReorderData::markUnmoveableSymbols(BinaryContext &BC,
   // suffix might start in one private symbol and end with the common
   // suffix in another.
   auto isPrivate = [&](const BinaryData *BD) {
-    auto Prefix = std::string("PG") + BC.AsmInfo->getPrivateGlobalPrefix();
+    auto Prefix = std::string("PG") + BC.AsmInfo->getInternalSymbolPrefix();
     return BD->getName().starts_with(Prefix.str());
   };
   auto Range = BC.getBinaryDataForSection(Section);
diff --git a/bolt/lib/Rewrite/RewriteInstance.cpp b/bolt/lib/Rewrite/RewriteInstance.cpp
index 16c9012b1fee6..e45cd7a502b73 100644
--- a/bolt/lib/Rewrite/RewriteInstance.cpp
+++ b/bolt/lib/Rewrite/RewriteInstance.cpp
@@ -1041,7 +1041,7 @@ void RewriteInstance::discoverFileObjects() {
     /// a local if it has a "private global" prefix, e.g. ".L". Thus we have to
     /// change the prefix to enforce global scope of the symbol.
     std::string Name =
-        SymName.starts_with(BC->AsmInfo->getPrivateGlobalPrefix())
+        SymName.starts_with(BC->AsmInfo->getInternalSymbolPrefix())
             ? "PG" + std::string(SymName)
             : std::string(SymName);
 
@@ -3231,7 +3231,7 @@ void RewriteInstance::handleRelocation(const SectionRef &RelocatedSection,
           Name = SymbolName;
         } else {
           if (StringRef(SymbolName)
-                  .starts_with(BC->AsmInfo->getPrivateGlobalPrefix()))
+                  .starts_with(BC->AsmInfo->getInternalSymbolPrefix()))
             Name = NR.uniquify("PG" + SymbolName);
           else
             Name = NR.uniquify(SymbolName);
diff --git a/llvm/include/llvm/IR/DataLayout.h b/llvm/include/llvm/IR/DataLayout.h
index 4d695e1e5c566..a4f4980520f6b 100644
--- a/llvm/include/llvm/IR/DataLayout.h
+++ b/llvm/include/llvm/IR/DataLayout.h
@@ -299,7 +299,7 @@ class DataLayout {
     llvm_unreachable("invalid mangling mode");
   }
 
-  StringRef getPrivateGlobalPrefix() const {
+  StringRef getInternalSymbolPrefix() const {
     switch (ManglingMode) {
     case MM_None:
       return "";
diff --git a/llvm/include/llvm/MC/MCAsmInfo.h b/llvm/include/llvm/MC/MCAsmInfo.h
index 92ae4f242ae2f..090d0989411c4 100644
--- a/llvm/include/llvm/MC/MCAsmInfo.h
+++ b/llvm/include/llvm/MC/MCAsmInfo.h
@@ -154,9 +154,9 @@ class LLVM_ABI MCAsmInfo {
   // Do we need to create a local symbol for .size?
   bool NeedsLocalForSize = false;
 
-  /// This prefix is used for globals like constant pool entries that are
-  /// completely private to the .s file and should not have names in the .o
-  /// file.  Defaults to "L"
+  /// For internal use by compiler and assembler, not meant to be visible
+  /// externally. They are usually not emitted to the symbol table in the
+  /// object file.
   StringRef PrivateGlobalPrefix = "L";
 
   /// This prefix is used for labels for basic blocks. Defaults to "L"
@@ -544,7 +544,7 @@ class LLVM_ABI MCAsmInfo {
   bool usesSetToEquateSymbol() const { return UsesSetToEquateSymbol; }
   bool useAssignmentForEHBegin() const { return UseAssignmentForEHBegin; }
   bool needsLocalForSize() const { return NeedsLocalForSize; }
-  StringRef getPrivateGlobalPrefix() const { return PrivateGlobalPrefix; }
+  StringRef getInternalSymbolPrefix() const { return PrivateGlobalPrefix; }
   StringRef getPrivateLabelPrefix() const { return PrivateLabelPrefix; }
 
   bool hasLinkerPrivateGlobalPrefix() const {
@@ -554,7 +554,7 @@ class LLVM_ABI MCAsmInfo {
   StringRef getLinkerPrivateGlobalPrefix() const {
     if (hasLinkerPrivateGlobalPrefix())
       return LinkerPrivateGlobalPrefix;
-    return getPrivateGlobalPrefix();
+    return getInternalSymbolPrefix();
   }
 
   const char *getInlineAsmStart() const { return InlineAsmStart; }
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 2f83be4a071eb..8787401888168 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -4528,7 +4528,7 @@ MCSymbol *AsmPrinter::GetCPISymbol(unsigned CPID) const {
   }
 
   const DataLayout &DL = getDataLayout();
-  return OutContext.getOrCreateSymbol(Twine(DL.getPrivateGlobalPrefix()) +
+  return OutContext.getOrCreateSymbol(Twine(DL.getInternalSymbolPrefix()) +
                                       "CPI" + Twine(getFunctionNumber()) + "_" +
                                       Twine(CPID));
 }
@@ -4542,7 +4542,7 @@ MCSymbol *AsmPrinter::GetJTISymbol(unsigned JTID, bool isLinkerPrivate) const {
 /// FIXME: privatize to AsmPrinter.
 MCSymbol *AsmPrinter::GetJTSetSymbol(unsigned UID, unsigned MBBID) const {
   const DataLayout &DL = getDataLayout();
-  return OutContext.getOrCreateSymbol(Twine(DL.getPrivateGlobalPrefix()) +
+  return OutContext.getOrCreateSymbol(Twine(DL.getInternalSymbolPrefix()) +
                                       Twine(getFunctionNumber()) + "_" +
                                       Twine(UID) + "_set_" + Twine(MBBID));
 }
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
index ae9fff80133d0..b649c41f56208 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
@@ -435,7 +435,7 @@ void AsmPrinter::PrintSpecial(const MachineInstr *MI, raw_ostream &OS,
                               StringRef Code) const {
   if (Code == "private") {
     const DataLayout &DL = MF->getDataLayout();
-    OS << DL.getPrivateGlobalPrefix();
+    OS << DL.getInternalSymbolPrefix();
   } else if (Code == "comment") {
     OS << MAI->getCommentString();
   } else if (Code == "uid") {
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index 71ddafbbd7876..7ab7b65e8350f 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -820,7 +820,7 @@ MCSymbol *MachineFunction::getJTISymbol(unsigned JTI, MCContext &Ctx,
   assert(JTI < JumpTableInfo->getJumpTables().size() && "Invalid JTI!");
 
   StringRef Prefix = isLinkerPrivate ? DL.getLinkerPrivateGlobalPrefix()
-                                     : DL.getPrivateGlobalPrefix();
+                                     : DL.getInternalSymbolPrefix();
   SmallString<60> Name;
   raw_svector_ostream(Name)
     << Prefix << "JTI" << getFunctionNumber() << '_' << JTI;
@@ -830,7 +830,7 @@ MCSymbol *MachineFunction::getJTISymbol(unsigned JTI, MCContext &Ctx,
 /// Return a function-local symbol to represent the PIC base.
 MCSymbol *MachineFunction::getPICBaseSymbol() const {
   const DataLayout &DL = getDataLayout();
-  return Ctx.getOrCreateSymbol(Twine(DL.getPrivateGlobalPrefix()) +
+  return Ctx.getOrCreateSymbol(Twine(DL.getInternalSymbolPrefix()) +
                                Twine(getFunctionNumber()) + "$pb");
 }
 
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index d3a8f0519f8dd..40ddbca84b111 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -1594,7 +1594,7 @@ const MCExpr *TargetLoweringObjectFileMachO::getIndirectSymViaGOTPCRel(
   // non_lazy_ptr stubs.
   SmallString<128> Name;
   StringRef Suffix = "$non_lazy_ptr";
-  Name += MMI->getModule()->getDataLayout().getPrivateGlobalPrefix();
+  Name += MMI->getModule()->getDataLayout().getInternalSymbolPrefix();
   Name += Sym->getName();
   Name += Suffix;
   MCSymbol *Stub = Ctx.getOrCreateSymbol(Name);
diff --git a/llvm/lib/IR/Mangler.cpp b/llvm/lib/IR/Mangler.cpp
index 43e8485434d9d..ae94af71111cd 100644
--- a/llvm/lib/IR/Mangler.cpp
+++ b/llvm/lib/IR/Mangler.cpp
@@ -50,7 +50,7 @@ static void getNameWithPrefixImpl(raw_ostream &OS, const Twine &GVName,
     Prefix = '\0';
 
   if (PrefixTy == Private)
-    OS << DL.getPrivateGlobalPrefix();
+    OS << DL.getInternalSymbolPrefix();
   else if (PrefixTy == LinkerPrivate)
     OS << DL.getLinkerPrivateGlobalPrefix();
 
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index b23fa92ac194d..9aa9083549573 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -1367,7 +1367,7 @@ void ELFObjectWriter::recordRelocation(const MCFragment &F,
     UseSectionSym = RSS == RelocSectionSymType::All ||
                     (RSS == RelocSectionSymType::Internal &&
                      SymA->getName().starts_with(
-                         Ctx.getAsmInfo()->getPrivateGlobalPrefix()));
+                         Ctx.getAsmInfo()->getInternalSymbolPrefix()));
   }
   if (UseSectionSym && useSectionSymbol(Target, SymA, Addend, Type)) {
     Addend += Asm->getSymbolOffset(*SymA);
diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp
index 36dcdd68cb80b..37331c8b88511 100644
--- a/llvm/lib/MC/MCContext.cpp
+++ b/llvm/lib/MC/MCContext.cpp
@@ -208,7 +208,7 @@ MCSymbol *MCContext::getOrCreateSymbol(const Twine &Name) {
 
   MCSymbolTableEntry &Entry = getSymbolTableEntry(NameRef);
   if (!Entry.second.Symbol) {
-    bool IsRenamable = NameRef.starts_with(MAI->getPrivateGlobalPrefix());
+    bool IsRenamable = NameRef.starts_with(MAI->getInternalSymbolPrefix());
     bool IsTemporary = IsRenamable && !SaveTempLabels;
     if (!Entry.second.Used) {
       Entry.second.Used = true;
@@ -253,17 +253,17 @@ MCSymbol *MCContext::parseSymbol(const Twine &Name) {
 
 MCSymbol *MCContext::getOrCreateFrameAllocSymbol(const Twine &FuncName,
                                                  unsigned Idx) {
-  return getOrCreateSymbol(MAI->getPrivateGlobalPrefix() + FuncName +
+  return getOrCreateSymbol(MAI->getInternalSymbolPrefix() + FuncName +
                            "$frame_escape_" + Twine(Idx));
 }
 
 MCSymbol *MCContext::getOrCreateParentFrameOffsetSymbol(const Twine &FuncName) {
-  return getOrCreateSymbol(MAI->getPrivateGlobalPrefix() + FuncName +
+  return getOrCreateSymbol(MAI->getInternalSymbolPrefix() + FuncName +
                            "$parent_frame_offset");
 }
 
 MCSymbol *MCContext::getOrCreateLSDASymbol(const Twine &FuncName) {
-  return getOrCreateSymbol(MAI->getPrivateGlobalPrefix() + "__ehtable$" +
+  return getOrCreateSymbol(MAI->getInternalSymbolPrefix() + "__ehtable$" +
                            FuncName);
 }
 
@@ -360,12 +360,12 @@ MCSymbol *MCContext::createRenamableSymbol(const Twine &Name,
 MCSymbol *MCContext::createTempSymbol(const Twine &Name, bool AlwaysAddSuffix) {
   if (!UseNamesOnTempLabels)
     return createSymbolImpl(nullptr, /*IsTemporary=*/true);
-  return createRenamableSymbol(MAI->getPrivateGlobalPrefix() + Name,
+  return createRenamableSymbol(MAI->getInternalSymbolPrefix() + Name,
                                AlwaysAddSuffix, /*IsTemporary=*/true);
 }
 
 MCSymbol *MCContext::createNamedTempSymbol(const Twine &Name) {
-  return createRenamableSymbol(MAI->getPrivateGlobalPrefix() + Name, true,
+  return createRenamableSymbol(MAI->getInternalSymbolPrefix() + Name, true,
                                /*IsTemporary=*/!SaveTempLabels);
 }
 
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp
index a913528d53a70..35203b904fbe6 100644
--- a/llvm/lib/MC/MCStreamer.cpp
+++ b/llvm/lib/MC/MCStreamer.cpp
@@ -249,7 +249,7 @@ void MCStreamer::emitDwarfLocLabelDirective(SMLoc Loc, StringRef Name) {
 MCSymbol *MCStreamer::getDwarfLineTableSymbol(unsigned CUID) {
   MCDwarfLineTable &Table = getContext().getMCDwarfLineTable(CUID);
   if (!Table.getLabel()) {
-    StringRef Prefix = Context.getAsmInfo()->getPrivateGlobalPrefix();
+    StringRef Prefix = Context.getAsmInfo()->getInternalSymbolPrefix();
     Table.setLabel(
         Context.getOrCreateSymbol(Prefix + "line_table_start" + Twine(CUID)));
   }
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUMCResourceInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUMCResourceInfo.cpp
index 6b3cdf57f3ad6..8186c329c4daf 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUMCResourceInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUMCResourceInfo.cpp
@@ -28,7 +28,7 @@ MCSymbol *MCResourceInfo::getSymbol(StringRef FuncName, ResourceInfoKind RIK,
                                     MCContext &OutContext, bool IsLocal) {
   auto GOCS = [FuncName, &OutContext, IsLocal](StringRef Suffix) {
     StringRef Prefix =
-        IsLocal ? OutContext.getAsmInfo()->getPrivateGlobalPrefix() : "";
+        IsLocal ? OutContext.getAsmInfo()->getInternalSymbolPrefix() : "";
     return OutContext.getOrCreateSymbol(Twine(Prefix) + FuncName +
                                         Twine(Suffix));
   };
diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
index f414672b825ac..fb2bbb5680156 100644
--- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -299,7 +299,7 @@ MCSymbol *ARMAsmPrinter::GetCPISymbol(unsigned CPID) const {
   // The AsmPrinter::GetCPISymbol superclass method tries to use CPID as
   // indexes in MachineConstantPool, which isn't in sync with indexes used here.
   const DataLayout &DL = getDataLayout();
-  return OutContext.getOrCreateSymbol(Twine(DL.getPrivateGlobalPrefix()) +
+  return OutContext.getOrCreateSymbol(Twine(DL.getInternalSymbolPrefix()) +
                                       "CPI" + Twine(getFunctionNumber()) + "_" +
                                       Twine(CPID));
 }
@@ -310,7 +310,7 @@ MCSymbol *ARMAsmPrinter::
 GetARMJTIPICJumpTableLabel(unsigned uid) const {
   const DataLayout &DL = getDataLayout();
   SmallString<60> Name;
-  raw_svector_ostream(Name) << DL.getPrivateGlobalPrefix() << "JTI"
+  raw_svector_ostream(Name) << DL.getInternalSymbolPrefix() << "JTI"
                             << getFunctionNumber() << '_' << uid;
   return OutContext.getOrCreateSymbol(Name);
 }
@@ -1031,7 +1031,7 @@ void ARMAsmPrinter::emitMachineConstantPoolValue(
 
   if (ACPV->getPCAdjustment()) {
     MCSymbol *PCLabel =
-        getPICLabel(DL.getPrivateGlobalPrefix(), getFunctionNumber(),
+        getPICLabel(DL.getInternalSymbolPrefix(), getFunctionNumber(),
                     ACPV->getLabelId(), OutContext);
     const MCExpr *PCRelExpr = MCSymbolRefExpr::create(PCLabel, OutContext);
     PCRelExpr =
@@ -2110,7 +2110,7 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
     const MCExpr *GVSymExpr = MCSymbolRefExpr::create(GVSym, OutContext);
 
     MCSymbol *LabelSym =
-        getPICLabel(DL.getPrivateGlobalPrefix(), getFunctionNumber(),
+        getPICLabel(DL.getInternalSymbolPrefix(), getFunctionNumber(),
                     MI->getOperand(2).getImm(), OutContext);
     const MCExpr *LabelSymExpr= MCSymbolRefExpr::create(LabelSym, OutContext);
     unsigned PCAdj = (Opc == ARM::MOVi16_ga_pcrel) ? 8 : 4;
@@ -2146,7 +2146,7 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
     const MCExpr *GVSymExpr = MCSymbolRefExpr::create(GVSym, OutContext);
 
     MCSymbol *LabelSym =
-        getPICLabel(DL.getPrivateGlobalPrefix(), getFunctionNumber(),
+        getPICLabel(DL.getInternalSymbolPrefix(), getFunctionNumber(),
                     MI->getOperand(3).getImm(), OutContext);
     const MCExpr *LabelSymExpr= MCSymbolRefExpr::create(LabelSym, OutContext);
     unsigned PCAdj = (Opc == ARM::MOVTi16_ga_pcrel) ? 8 : 4;
@@ -2175,7 +2175,7 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
     // This is a Branch Future instruction.
 
     const MCExpr *BranchLabel = MCSymbolRefExpr::create(
-        getBFLabel(DL.getPrivateGlobalPrefix(), getFunctionNumber(),
+        getBFLabel(DL.getInternalSymbolPrefix(), getFunctionNumber(),
                    MI->getOperand(0).getIndex(), OutContext),
         OutContext);
 
@@ -2205,7 +2205,7 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
 
     if (Opc == ARM::t2BFic) {
       const MCExpr *ElseLabel = MCSymbolRefExpr::create(
-          getBFLabel(DL.getPrivateGlobalPrefix(), getFunctionNumber(),
+          getBFLabel(DL.getInternalSymbolPrefix(), getFunctionNumber(),
                      MI->getOperand(2).getIndex(), OutContext),
           OutContext);
       MCInst.addExpr(ElseLabel);
@@ -2222,9 +2222,9 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
     // This is a pseudo op for a label used by a branch future instruction
 
     // Emit the label.
-    OutStreamer->emitLabel(getBFLabel(DL.getPrivateGlobalPrefix(),
-                                       getFunctionNumber(),
-                                       MI->getOperand(0).getIndex(), OutContext));
+    OutStreamer->emitLabel(
+        getBFLabel(DL.getInternalSymbolPrefix(), getFunctionNumber(),
+                   MI->getOperand(0).getIndex(), OutContext));
     return;
   }
   case ARM::tPICADD: {
@@ -2234,7 +2234,7 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
     // This adds the address of LPC0 to r0.
 
     // Emit the label.
-    OutStreamer->emitLabel(getPICLabel(DL.getPrivateGlobalPrefix(),
+    OutStreamer->emitLabel(getPICLabel(DL.getInternalSymbolPrefix(),
                                        getFunctionNumber(),
                                        MI->getOperand(2).getImm(), OutContext));
 
@@ -2255,7 +2255,7 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
     // This adds the address of LPC0 to r0.
 
     // Emit the label.
-    OutStreamer->emitLabel(getPICLabel(DL.getPrivateGlobalPrefix(),
+    OutStreamer->emitLabel(getPICLabel(DL.getInternalSymbolPrefix(),
                                        getFunctionNumber(),
                                        MI->getOperand(2).getImm(), OutContext));
 
@@ -2286,7 +2286,7 @@ void ARMAsmPrinter::emitInstruction(const MachineInstr *MI) {
     // a PC-relative address at the ldr instruction.
 
     // Emit the label.
-    OutStreamer->emitLabel(getPICLabel(DL.getPrivateGlobalPrefix(),
+    OutStreamer->emitLabel(getPICLabel(DL.getInternalSymbolPrefix(),
                                        getFunctionNumber(),
                                        MI->getOperand(2).getImm(), OutContext));
 
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index cb95356f9cd91..d4f01d0c5879f 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -3201,11 +3201,10 @@ SDValue ARMTargetLowering::LowerConstantPool(SDValue Op,
     auto C = const_cast<Constant*>(CP->getConstVal());
     auto M = DAG.getMachineFunction().getFunction().getParent();
     auto GV = new GlobalVariable(
-                    *M, T, /*isConstant=*/true, GlobalVariable::InternalLinkage, C,
-                    Twine(DAG.getDataLayout().getPrivateGlobalPrefix()) + "CP" +
-                    Twine(DAG.getMachineFunction().getFunctionNumber()) + "_" +
-                    Twine(AFI->createPICLabelUId())
-                  );
+        *M, T, /*isConstant=*/true, GlobalVariable::InternalLinkage, C,
+        Twine(DAG.getDataLayout().getInternalSymbolPrefix()) + "CP" +
+            Twine(DAG.getMachineFunction().getFunctionNumber()) + "_" +
+            Twine(AFI->createPICLabelUId()));
     SDValue GA = DAG.getTargetGlobalAddress(dyn_cast<GlobalValue>(GV),
                                             dl, PtrVT);
     return LowerGlobalAddress(GA, DAG);
diff --git a/llvm/lib/Target/CSKY/CSKYAsmPrinter.cpp b/llvm/lib/Target/CSKY/CSKYAsmPrinter.cpp
index 7e1eb9d9ec43a..9128160e95038 100644
--- a/llvm/lib/Target/CSKY/CSKYAsmPrinter.cpp
+++ b/llvm/lib/Target/CSKY/CSKYAsmPrinter.cpp
@@ -72,8 +72,8 @@ void CSKYAsmPrinter::expandTLSLA(const MachineInstr *MI) {
   DebugLoc DL = MI->getDebugLoc();
 
   MCSymbol *P...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/185164


More information about the llvm-commits mailing list