[llvm] r197787 - ARM IAS: add support for the .pool directive

Saleem Abdulrasool compnerd at compnerd.org
Thu Dec 19 23:21:16 PST 2013


Author: compnerd
Date: Fri Dec 20 01:21:16 2013
New Revision: 197787

URL: http://llvm.org/viewvc/llvm-project?rev=197787&view=rev
Log:
ARM IAS: add support for the .pool directive

The .pool directive is an alias for the .ltorg directive used to create a
literal pool.  Simply treat .pool as if .ltorg was passed.

Added:
    llvm/trunk/test/MC/ARM/pool.s
Modified:
    llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp

Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=197787&r1=197786&r2=197787&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Fri Dec 20 01:21:16 2013
@@ -7910,7 +7910,7 @@ bool ARMAsmParser::ParseDirective(AsmTok
     return parseDirectiveInst(DirectiveID.getLoc(), 'n');
   else if (IDVal == ".inst.w")
     return parseDirectiveInst(DirectiveID.getLoc(), 'w');
-  else if (IDVal == ".ltorg")
+  else if (IDVal == ".ltorg" || IDVal == ".pool")
     return parseDirectiveLtorg(DirectiveID.getLoc());
   return true;
 }
@@ -8464,7 +8464,7 @@ bool ARMAsmParser::parseDirectiveInst(SM
 }
 
 /// parseDirectiveLtorg
-///  ::= .ltorg
+///  ::= .ltorg | .pool
 bool ARMAsmParser::parseDirectiveLtorg(SMLoc L) {
   MCStreamer &Streamer = getParser().getStreamer();
   const MCSection *Section = Streamer.getCurrentSection().first;

Added: llvm/trunk/test/MC/ARM/pool.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/pool.s?rev=197787&view=auto
==============================================================================
--- llvm/trunk/test/MC/ARM/pool.s (added)
+++ llvm/trunk/test/MC/ARM/pool.s Fri Dec 20 01:21:16 2013
@@ -0,0 +1,18 @@
+@ RUN: llvm-mc -triple thumbv7-linux-gnueabi -o - %s | FileCheck %s
+
+	.syntax unified
+
+	.align 2
+	.global pool
+	.type pool,%function
+pool:
+	ldr r0, =0xba5eba11
+	bx lr
+	.pool
+
+@ CHECK-LABEL: pool
+@ CHECK: ldr r0, .Ltmp0
+@ CHECK: .align	2
+@ CHECK-LABEL: .Ltmp0:
+@ CHECK: .long	3126770193
+





More information about the llvm-commits mailing list