[llvm] r245232 - [SPARC]: recognize '.' as the start of an assembler expression.

Douglas Katzman via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 12:55:01 PDT 2015


Author: dougk
Date: Mon Aug 17 14:55:01 2015
New Revision: 245232

URL: http://llvm.org/viewvc/llvm-project?rev=245232&view=rev
Log:
[SPARC]: recognize '.' as the start of an assembler expression.

Modified:
    llvm/trunk/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
    llvm/trunk/test/MC/Sparc/sparc-assembly-exprs.s

Modified: llvm/trunk/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp?rev=245232&r1=245231&r2=245232&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/AsmParser/SparcAsmParser.cpp Mon Aug 17 14:55:01 2015
@@ -796,6 +796,7 @@ SparcAsmParser::parseSparcAsmOperand(std
   case AsmToken::Minus:
   case AsmToken::Integer:
   case AsmToken::LParen:
+  case AsmToken::Dot:
     if (!getParser().parseExpression(EVal, E))
       Op = SparcOperand::CreateImm(EVal, S, E);
     break;

Modified: llvm/trunk/test/MC/Sparc/sparc-assembly-exprs.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Sparc/sparc-assembly-exprs.s?rev=245232&r1=245231&r2=245232&view=diff
==============================================================================
--- llvm/trunk/test/MC/Sparc/sparc-assembly-exprs.s (original)
+++ llvm/trunk/test/MC/Sparc/sparc-assembly-exprs.s Mon Aug 17 14:55:01 2015
@@ -4,3 +4,10 @@
         mov      (0x400|9), %o1
         ! CHECK: mov 60, %o2    ! encoding: [0x94,0x10,0x20,0x3c]
         mov      (12+3<<2), %o2
+
+! "." is exactly like a temporary symbol equated to the current line.
+! RUN: llvm-mc %s -arch=sparc | FileCheck %s --check-prefix=DOTEXPR
+
+        ! DOTEXPR: .Ltmp0
+        ! DOTEXPR-NEXT: ba .Ltmp0+8
+        b . + 8




More information about the llvm-commits mailing list