[llvm] Handle CPI symbols for UEFI (#135652)

UEFI targets besides MSVC environment must support constant pool
symbols.
This commit is contained in:
Prabhu Rajasekaran 2025-04-16 14:14:43 -07:00 committed by GitHub
parent 2afef58e40
commit a9827fbc86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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()) {