[llvm] r279655 - Use isTargetMachO instead of isTargetDarwin.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 24 12:02:30 PDT 2016


Author: rafael
Date: Wed Aug 24 14:02:29 2016
New Revision: 279655

URL: http://llvm.org/viewvc/llvm-project?rev=279655&view=rev
Log:
Use isTargetMachO instead of isTargetDarwin.

Added:
    llvm/trunk/test/CodeGen/ARM/macho-extern-hidden.ll
Modified:
    llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp

Modified: llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp?rev=279655&r1=279654&r2=279655&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp Wed Aug 24 14:02:29 2016
@@ -282,7 +282,7 @@ bool ARMSubtarget::isGVIndirectSymbol(co
   // 32 bit macho has no relocation for a-b if a is undefined, even if b is in
   // the section that is being relocated. This means we have to use o load even
   // for GVs that are known to be local to the dso.
-  if (isTargetDarwin() && TM.isPositionIndependent() &&
+  if (isTargetMachO() && TM.isPositionIndependent() &&
       (GV->isDeclarationForLinker() || GV->hasCommonLinkage()))
     return true;
 

Added: llvm/trunk/test/CodeGen/ARM/macho-extern-hidden.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/macho-extern-hidden.ll?rev=279655&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/macho-extern-hidden.ll (added)
+++ llvm/trunk/test/CodeGen/ARM/macho-extern-hidden.ll Wed Aug 24 14:02:29 2016
@@ -0,0 +1,10 @@
+; RUN: llc < %s -mtriple=thumbv7em-apple-unknown-macho | FileCheck %s
+
+; CHECK: movw   r0, :lower16:(L_bar$non_lazy_ptr-(LPC0_0+4))
+; CHECK: movt   r0, :upper16:(L_bar$non_lazy_ptr-(LPC0_0+4))
+
+ at bar = external hidden global i32
+define i32 @foo() {
+  %tmp = load i32, i32* @bar, align 4
+  ret i32 %tmp
+}




More information about the llvm-commits mailing list