[llvm-commits] [llvm] r155926 - in /llvm/trunk: lib/MC/MCParser/AsmParser.cpp test/MC/AsmParser/macros-parsing.s test/MC/AsmParser/macros.s

Jim Grosbach grosbach at apple.com
Tue May 1 11:38:27 PDT 2012


Author: grosbach
Date: Tue May  1 13:38:27 2012
New Revision: 155926

URL: http://llvm.org/viewvc/llvm-project?rev=155926&view=rev
Log:
MC: Unknown assembler directives are now hard errors.

Previously, an unsupported/unknown assembler directive issued a warning.
That's generally unsafe, and inconsistent with the behaviour of pretty
much every system assembler. Now that the MC assemblers are mature
enough to be the default on multiple targets, it's reasonable to
issue errors for these.

For target or platform directives that need to stay warnings, we
should add explicit handlers for them in, e.g., ELFAsmParser.cpp,
DarwinAsmParser.cpp, et. al., and issue the warning there.

rdar://9246275

Modified:
    llvm/trunk/lib/MC/MCParser/AsmParser.cpp
    llvm/trunk/test/MC/AsmParser/macros-parsing.s
    llvm/trunk/test/MC/AsmParser/macros.s

Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=155926&r1=155925&r2=155926&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Tue May  1 13:38:27 2012
@@ -1238,7 +1238,7 @@
     if (!getTargetParser().ParseDirective(ID))
       return false;
 
-    return Warning(IDLoc, "ignoring directive for now");
+    return Error(IDLoc, "unknown directive");
   }
 
   CheckForValidSection();

Modified: llvm/trunk/test/MC/AsmParser/macros-parsing.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/macros-parsing.s?rev=155926&r1=155925&r2=155926&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/macros-parsing.s (original)
+++ llvm/trunk/test/MC/AsmParser/macros-parsing.s Tue May  1 13:38:27 2012
@@ -5,7 +5,7 @@
 .endmacro
 
 .macros_off
-// CHECK-ERRORS: 9:1: warning: ignoring directive for now
+// CHECK-ERRORS: 9:1: error: unknown directive
 .test0
 .macros_on
 

Modified: llvm/trunk/test/MC/AsmParser/macros.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/macros.s?rev=155926&r1=155925&r2=155926&view=diff
==============================================================================
--- llvm/trunk/test/MC/AsmParser/macros.s (original)
+++ llvm/trunk/test/MC/AsmParser/macros.s Tue May  1 13:38:27 2012
@@ -1,4 +1,4 @@
-// RUN: llvm-mc -triple x86_64-apple-darwin10 %s 2> %t.err | FileCheck %s
+// RUN: not llvm-mc -triple x86_64-apple-darwin10 %s 2> %t.err | FileCheck %s
 // RUN: FileCheck --check-prefix=CHECK-ERRORS %s < %t.err
 
 .macro .test0
@@ -9,7 +9,7 @@
 .endmacro
 
 .test1
-// CHECK-ERRORS: <instantiation>:1:1: warning: ignoring directive for now
+// CHECK-ERRORS: <instantiation>:1:1: error: unknown directive
 // CHECK-ERRORS-NEXT: macrobody0
 // CHECK-ERRORS-NEXT: ^
 // CHECK-ERRORS: <instantiation>:1:1: note: while in macro instantiation





More information about the llvm-commits mailing list