[llvm] [llvm] Handle CPI symbols for UEFI (PR #135652)
Prabhu Rajasekaran via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 14 11:04:34 PDT 2025
https://github.com/Prabhuk created https://github.com/llvm/llvm-project/pull/135652
UEFI targets besides MSVC environment must support constant pool
symbols.
>From 4dc4f82aeae93aaeda90d37ec6a763dccf8da73b Mon Sep 17 00:00:00 2001
From: prabhukr <prabhukr at google.com>
Date: Mon, 14 Apr 2025 17:59:47 +0000
Subject: [PATCH] [llvm] Handle CPI symbols for UEFI
UEFI targets besides MSVC environment must support constant pool
symbols.
---
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 743551822a8fc..c87c5e16f8f9c 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -4096,7 +4096,8 @@ const MCExpr *AsmPrinter::lowerBlockAddressConstant(const BlockAddress &BA) {
/// GetCPISymbol - Return the symbol for the specified constant pool entry.
MCSymbol *AsmPrinter::GetCPISymbol(unsigned CPID) const {
- if (getSubtargetInfo().getTargetTriple().isWindowsMSVCEnvironment()) {
+ if (getSubtargetInfo().getTargetTriple().isWindowsMSVCEnvironment() ||
+ getSubtargetInfo().getTargetTriple().isUEFI()) {
const MachineConstantPoolEntry &CPE =
MF->getConstantPool()->getConstants()[CPID];
if (!CPE.isMachineConstantPoolEntry()) {
More information about the llvm-commits
mailing list