Skip to content

[llvm] Use masm for UEFI #132461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 20, 2025
Merged

[llvm] Use masm for UEFI #132461

merged 1 commit into from
Apr 20, 2025

Conversation

Prabhuk
Copy link
Contributor

@Prabhuk Prabhuk commented Mar 21, 2025

For UEFI targets use Microsoft masm.

For UEFI targets use Microsoft masm.
@llvmbot
Copy link
Member

llvmbot commented Mar 21, 2025

@llvm/pr-subscribers-backend-x86

Author: Prabhuk (OOO till April 2nd Week) (Prabhuk)

Changes

For UEFI targets use Microsoft masm.


Full diff: https://github.com/llvm/llvm-project/pull/132461.diff

1 Files Affected:

  • (modified) llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp (+1-1)
diff --git a/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
index ad94e306f339e..9d86f8eb91506 100644
--- a/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
+++ b/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp
@@ -444,7 +444,7 @@ static MCAsmInfo *createX86MCAsmInfo(const MCRegisterInfo &MRI,
     // Force the use of an ELF container.
     MAI = new X86ELFMCAsmInfo(TheTriple);
   } else if (TheTriple.isWindowsMSVCEnvironment() ||
-             TheTriple.isWindowsCoreCLREnvironment()) {
+             TheTriple.isWindowsCoreCLREnvironment() || TheTriple.isUEFI()) {
     if (Options.getAssemblyLanguage().equals_insensitive("masm"))
       MAI = new X86MCAsmInfoMicrosoftMASM(TheTriple);
     else

@Prabhuk Prabhuk requested a review from petrhosek March 21, 2025 19:54
@Prabhuk Prabhuk merged commit cd84ba2 into llvm:main Apr 20, 2025
13 checks passed
@petrhosek
Copy link
Member

Can you remove the second UEFI case?

} else if (TheTriple.isUEFI()) {
MAI = new X86MCAsmInfoGNUCOFF(TheTriple);
} else {

Prabhuk added a commit to Prabhuk/llvm-project that referenced this pull request Apr 21, 2025
In `X86MCTargetDesc.cpp` while fixing the handling of UEFI target in the
`createX86MCAsmInfo` function (llvm#132461), the previous incorrect handling
of isUEFI was not removed. This patch cleans up that case.
Prabhuk added a commit that referenced this pull request Apr 22, 2025
In `X86MCTargetDesc.cpp` while fixing the handling of UEFI target in the
`createX86MCAsmInfo` function (#132461), the previous incorrect handling
of isUEFI was not removed. This patch cleans up that case.
@Prabhuk
Copy link
Contributor Author

Prabhuk commented Apr 22, 2025

Can you remove the second UEFI case?

} else if (TheTriple.isUEFI()) {
MAI = new X86MCAsmInfoGNUCOFF(TheTriple);
} else {

Landed this cleanup as an NFC here: #136593

@Prabhuk Prabhuk deleted the x86_64_be_1 branch April 22, 2025 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants