[PATCH] D49929: [AArch64] Disallow the MachO specific .loh directive for windows

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 31 23:50:39 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL338493: [AArch64] Disallow the MachO specific .loh directive for windows (authored by mstorsjo, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D49929?vs=158193&id=158470#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D49929

Files:
  llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
  llvm/trunk/test/MC/AArch64/arm64-directive_loh.s


Index: llvm/trunk/test/MC/AArch64/arm64-directive_loh.s
===================================================================
--- llvm/trunk/test/MC/AArch64/arm64-directive_loh.s
+++ llvm/trunk/test/MC/AArch64/arm64-directive_loh.s
@@ -1,5 +1,7 @@
 # RUN: not llvm-mc -triple arm64-apple-darwin < %s 2> %t | FileCheck %s
 # RUN: FileCheck --check-prefix=CHECK-ERRORS < %t %s
+# RUN: not llvm-mc -triple aarch64-linux-gnu < %s 2>&1 | FileCheck --check-prefix=UNKNOWN %s
+# RUN: not llvm-mc -triple aarch64-win32-gnu < %s 2>&1 | FileCheck --check-prefix=UNKNOWN %s
 
 .globl _fct1
 _fct1:
@@ -15,6 +17,8 @@
 
 # CHECK: .loh AdrpAdrp L1, L2
 # CHECK: .loh AdrpAdrp L1, L2
+# UNKNOWN: error: unknown directive
+# UNKNOWN-NEXT: .loh AdrpAdrp L1, L2
 .loh AdrpAdrp L1, L2
 .loh 1 L1, L2
 
Index: llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
===================================================================
--- llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+++ llvm/trunk/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
@@ -4859,7 +4859,6 @@
   const MCObjectFileInfo::Environment Format =
     getContext().getObjectFileInfo()->getObjectFileType();
   bool IsMachO = Format == MCObjectFileInfo::IsMachO;
-  bool IsCOFF = Format == MCObjectFileInfo::IsCOFF;
 
   StringRef IDVal = DirectiveID.getIdentifier();
   SMLoc Loc = DirectiveID.getLoc();
@@ -4875,11 +4874,12 @@
     parseDirectiveUnreq(Loc);
   else if (IDVal == ".inst")
     parseDirectiveInst(Loc);
-  else if (!IsMachO && !IsCOFF)
-    return true;
-  else if (IDVal == MCLOHDirectiveName())
-    parseDirectiveLOH(IDVal, Loc);
-  else
+  else if (IsMachO) {
+    if (IDVal == MCLOHDirectiveName())
+      parseDirectiveLOH(IDVal, Loc);
+    else
+      return true;
+  } else
     return true;
   return false;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49929.158470.patch
Type: text/x-patch
Size: 1806 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180801/8f3bf153/attachment.bin>


More information about the llvm-commits mailing list