[llvm] r239647 - AArch64: map bare-metal arm64-macho triple to MachO MC layer.
Tim Northover
tnorthover at apple.com
Fri Jun 12 16:37:11 PDT 2015
Author: tnorthover
Date: Fri Jun 12 18:37:11 2015
New Revision: 239647
URL: http://llvm.org/viewvc/llvm-project?rev=239647&view=rev
Log:
AArch64: map bare-metal arm64-macho triple to MachO MC layer.
Far better than an assertion about expecting ELF.
Added:
llvm/trunk/test/CodeGen/AArch64/simple-macho.ll
Modified:
llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp
llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp
Modified: llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp?rev=239647&r1=239646&r2=239647&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp Fri Jun 12 18:37:11 2015
@@ -523,7 +523,7 @@ MCAsmBackend *llvm::createAArch64leAsmBa
const MCRegisterInfo &MRI,
const Triple &TheTriple,
StringRef CPU) {
- if (TheTriple.isOSDarwin())
+ if (TheTriple.isOSBinFormatMachO())
return new DarwinAArch64AsmBackend(T, MRI);
assert(TheTriple.isOSBinFormatELF() && "Expect either MachO or ELF target");
Modified: llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp?rev=239647&r1=239646&r2=239647&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp Fri Jun 12 18:37:11 2015
@@ -60,7 +60,7 @@ static MCRegisterInfo *createAArch64MCRe
static MCAsmInfo *createAArch64MCAsmInfo(const MCRegisterInfo &MRI,
const Triple &TheTriple) {
MCAsmInfo *MAI;
- if (TheTriple.isOSDarwin())
+ if (TheTriple.isOSBinFormatMachO())
MAI = new AArch64MCAsmInfoDarwin();
else {
assert(TheTriple.isOSBinFormatELF() && "Only expect Darwin or ELF");
Added: llvm/trunk/test/CodeGen/AArch64/simple-macho.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/simple-macho.ll?rev=239647&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/simple-macho.ll (added)
+++ llvm/trunk/test/CodeGen/AArch64/simple-macho.ll Fri Jun 12 18:37:11 2015
@@ -0,0 +1,12 @@
+; RUN: llc -mtriple=arm64-macho -o - %s | FileCheck %s
+; RUN: llc -mtriple=arm64-macho -filetype=obj -o %t %s
+; RUN: llvm-objdump -triple=arm64-macho -d %t | FileCheck --check-prefix=CHECK-OBJ %s
+
+define void @foo() {
+; CHECK-LABEL: _foo:
+; CHECK: ret
+
+; CHECK-OBJ: 0: c0 03 5f d6 ret
+
+ ret void
+}
\ No newline at end of file
More information about the llvm-commits
mailing list