[llvm-commits] [llvm] r115133 - in /llvm/trunk: include/llvm/MC/MCDirectives.h lib/MC/MCAsmStreamer.cpp lib/MC/MCELFStreamer.cpp lib/Target/ARM/ARMAsmPrinter.cpp test/CodeGen/ARM/2010-09-29-mc-asm-header-test.ll
Jason W Kim
jason.w.kim.2009 at gmail.com
Wed Sep 29 19:45:56 PDT 2010
Author: jasonwkim
Date: Wed Sep 29 21:45:56 2010
New Revision: 115133
URL: http://llvm.org/viewvc/llvm-project?rev=115133&view=rev
Log:
Tiny patch for proof-of-concept cleanup of ARMAsmPrinter::EmitStartOfAsmFile()
Small test for sanity check of resulting ARM .s file.
Tested against -r115129.
Added:
llvm/trunk/test/CodeGen/ARM/2010-09-29-mc-asm-header-test.ll
Modified:
llvm/trunk/include/llvm/MC/MCDirectives.h
llvm/trunk/lib/MC/MCAsmStreamer.cpp
llvm/trunk/lib/MC/MCELFStreamer.cpp
llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp
Modified: llvm/trunk/include/llvm/MC/MCDirectives.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCDirectives.h?rev=115133&r1=115132&r2=115133&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCDirectives.h (original)
+++ llvm/trunk/include/llvm/MC/MCDirectives.h Wed Sep 29 21:45:56 2010
@@ -43,6 +43,7 @@
};
enum MCAssemblerFlag {
+ MCAF_SyntaxUnified, ///< .syntax (ARM/ELF)
MCAF_SubsectionsViaSymbols ///< .subsections_via_symbols (MachO)
};
Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=115133&r1=115132&r2=115133&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Wed Sep 29 21:45:56 2010
@@ -244,6 +244,7 @@
void MCAsmStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
switch (Flag) {
default: assert(0 && "Invalid flag!");
+ case MCAF_SyntaxUnified: OS << "\t.syntax unified"; break;
case MCAF_SubsectionsViaSymbols: OS << ".subsections_via_symbols"; break;
}
EmitEOL();
Modified: llvm/trunk/lib/MC/MCELFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCELFStreamer.cpp?rev=115133&r1=115132&r2=115133&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCELFStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCELFStreamer.cpp Wed Sep 29 21:45:56 2010
@@ -197,6 +197,7 @@
void MCELFStreamer::EmitAssemblerFlag(MCAssemblerFlag Flag) {
switch (Flag) {
+ case MCAF_SyntaxUnified: return; // no-op here?
case MCAF_SubsectionsViaSymbols:
getAssembler().setSubsectionsViaSymbols(true);
return;
Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp?rev=115133&r1=115132&r2=115133&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp Wed Sep 29 21:45:56 2010
@@ -416,7 +416,7 @@
}
// Use unified assembler syntax.
- OutStreamer.EmitRawText(StringRef("\t.syntax unified"));
+ OutStreamer.EmitAssemblerFlag(MCAF_SyntaxUnified);
// Emit ARM Build Attributes
if (Subtarget->isTargetELF()) {
Added: llvm/trunk/test/CodeGen/ARM/2010-09-29-mc-asm-header-test.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2010-09-29-mc-asm-header-test.ll?rev=115133&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/2010-09-29-mc-asm-header-test.ll (added)
+++ llvm/trunk/test/CodeGen/ARM/2010-09-29-mc-asm-header-test.ll Wed Sep 29 21:45:56 2010
@@ -0,0 +1,13 @@
+; RUN: llc < %s -mtriple=arm-linux-gnueabi | FileCheck %s
+; This tests that MC/asm header conversion is smooth
+;
+; CHECK: .syntax unified
+; CHECK-NEXT: .eabi_attribute 20, 1
+; CHECK-NEXT: .eabi_attribute 21, 1
+; CHECK-NEXT: .eabi_attribute 23, 3
+; CHECK-NEXT: .eabi_attribute 24, 1
+; CHECK-NEXT: .eabi_attribute 25, 1
+
+define i32 @f(i64 %z) {
+ ret i32 0
+}
More information about the llvm-commits
mailing list