[llvm] a9827fb - [llvm] Handle CPI symbols for UEFI (#135652)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 16 14:14:46 PDT 2025
Author: Prabhu Rajasekaran
Date: 2025-04-16T14:14:43-07:00
New Revision: a9827fbc86b3d2973b9eef7bfb8f726dd75f17a5
URL: https://github.com/llvm/llvm-project/commit/a9827fbc86b3d2973b9eef7bfb8f726dd75f17a5
DIFF: https://github.com/llvm/llvm-project/commit/a9827fbc86b3d2973b9eef7bfb8f726dd75f17a5.diff
LOG: [llvm] Handle CPI symbols for UEFI (#135652)
UEFI targets besides MSVC environment must support constant pool
symbols.
Added:
Modified:
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 1d72a1e116ecd..4b05ad398f053 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -4113,7 +4113,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