[llvmlinux] Fwd: [llvm] r201474 - MCAsmParser: relax declaration parsing

Renato Golin renato.golin at linaro.org
Sun Feb 16 11:39:36 UTC 2014


FYI, I believe the macro problem with the kernel build using IAS was
solved by this commit.

I'm working on the -mfpu=softvfp+vfp and should have a patch next
week, while the --gdwarf-2 should be moved to -gdwarf-2 and be
consistent with other GCC and LLVM flags of the same type.

For now, if you could omit the two failing flags, we'd be able to
progress a little further.

Vinicius, can you please try again and see where the build fails next? ;)

cheers,
--renato


---------- Forwarded message ----------
From: Saleem Abdulrasool <compnerd at compnerd.org>
Date: 16 February 2014 04:56
Subject: [llvm] r201474 - MCAsmParser: relax declaration parsing
To: llvm-commits at cs.uiuc.edu


Author: compnerd
Date: Sat Feb 15 22:56:31 2014
New Revision: 201474

URL: http://llvm.org/viewvc/llvm-project?rev=201474&view=rev
Log:
MCAsmParser: relax declaration parsing

The Linux kernel defines empty macros for compatibility with ARM UAL syntax.
The comma after the name is optional, and if present can be safely lexed.  This
improves compatibility with the GNU assembler.


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

Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=201474&r1=201473&r2=201474&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Sat Feb 15 22:56:31 2014
@@ -3152,12 +3152,15 @@ bool AsmParser::parseDirectiveMacrosOnOf
 }

 /// parseDirectiveMacro
-/// ::= .macro name [parameters]
+/// ::= .macro name[,] [parameters]
 bool AsmParser::parseDirectiveMacro(SMLoc DirectiveLoc) {
   StringRef Name;
   if (parseIdentifier(Name))
     return TokError("expected identifier in '.macro' directive");

+  if (getLexer().is(AsmToken::Comma))
+    Lex();
+
   MCAsmMacroParameters Parameters;
   while (getLexer().isNot(AsmToken::EndOfStatement)) {
     MCAsmMacroParameter Parameter;

Added: llvm/trunk/test/MC/AsmParser/macros-argument-parsing.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AsmParser/macros-argument-parsing.s?rev=201474&view=auto
==============================================================================
--- llvm/trunk/test/MC/AsmParser/macros-argument-parsing.s (added)
+++ llvm/trunk/test/MC/AsmParser/macros-argument-parsing.s Sat Feb 15
22:56:31 2014
@@ -0,0 +1,10 @@
+# RUN: llvm-mc -triple i386 -filetype asm -o - %s | FileCheck %s
+
+       .macro  it, cond
+       .endm
+
+       it ne
+       .long 1
+
+# CHECK: .long 1
+


_______________________________________________
llvm-commits mailing list
llvm-commits at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


More information about the LLVMLinux mailing list