[llvm-branch-commits] [llvm-branch] r252456 - Merging r249165:

Renato Golin via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Nov 9 01:59:24 PST 2015


Author: rengolin
Date: Mon Nov  9 03:59:23 2015
New Revision: 252456

URL: http://llvm.org/viewvc/llvm-project?rev=252456&view=rev
Log:
Merging r249165:
------------------------------------------------------------------------
r249165 | rdivacky | 2015-10-02 19:25:25 +0100 (Fri, 02 Oct 2015) | 2 lines

Actually switch the arch when we see .arch. PR21695

Added:
    llvm/branches/release_37/test/MC/ARM/directive-arch-semantic-action.s
Modified:
    llvm/branches/release_37/lib/Target/ARM/AsmParser/ARMAsmParser.cpp

Modified: llvm/branches/release_37/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_37/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=252456&r1=252455&r2=252456&view=diff
==============================================================================
--- llvm/branches/release_37/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/branches/release_37/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Mon Nov  9 03:59:23 2015
@@ -15,6 +15,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringSwitch.h"
+#include "llvm/ADT/Triple.h"
 #include "llvm/ADT/Twine.h"
 #include "llvm/MC/MCAsmInfo.h"
 #include "llvm/MC/MCAssembler.h"
@@ -9104,6 +9105,10 @@ bool ARMAsmParser::parseDirectiveArch(SM
     return false;
   }
 
+  Triple T;
+  STI.setDefaultFeatures(T.getARMCPUForArch(Arch));
+  setAvailableFeatures(ComputeAvailableFeatures(STI.getFeatureBits()));
+
   getTargetStreamer().emitArch(ID);
   return false;
 }

Added: llvm/branches/release_37/test/MC/ARM/directive-arch-semantic-action.s
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_37/test/MC/ARM/directive-arch-semantic-action.s?rev=252456&view=auto
==============================================================================
--- llvm/branches/release_37/test/MC/ARM/directive-arch-semantic-action.s (added)
+++ llvm/branches/release_37/test/MC/ARM/directive-arch-semantic-action.s Mon Nov  9 03:59:23 2015
@@ -0,0 +1,12 @@
+@ RUN: not llvm-mc -triple arm-gnueabi-linux -filetype asm %s 2>&1 | FileCheck %s
+
+        .arch	armv6
+        dsb
+@ CHECK: error: instruction requires: data-barriers
+
+        .arch   armv7
+        dsb
+@ CHECK-NOT: error: instruction requires: data-barriers
+
+        .arch   invalid_architecture_name
+@ CHECK: error: Unknown arch name




More information about the llvm-branch-commits mailing list