[llvm-commits] [llvm] r115655 - in /llvm/trunk: lib/MC/MCParser/AsmParser.cpp test/MC/ELF/zero.s
Rafael Espindola
rafael.espindola at gmail.com
Tue Oct 5 12:42:58 PDT 2010
Author: rafael
Date: Tue Oct 5 14:42:57 2010
New Revision: 115655
URL: http://llvm.org/viewvc/llvm-project?rev=115655&view=rev
Log:
Add support for a fill value in the .zero directive.
Modified:
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
llvm/trunk/test/MC/ELF/zero.s
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=115655&r1=115654&r2=115655&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Tue Oct 5 14:42:57 2010
@@ -1498,12 +1498,19 @@
if (ParseAbsoluteExpression(NumBytes))
return true;
+ int64_t Val = 0;
+ if (getLexer().is(AsmToken::Comma)) {
+ Lex();
+ if (ParseAbsoluteExpression(Val))
+ return true;
+ }
+
if (getLexer().isNot(AsmToken::EndOfStatement))
return TokError("unexpected token in '.zero' directive");
Lex();
- getStreamer().EmitFill(NumBytes, 0, DEFAULT_ADDRSPACE);
+ getStreamer().EmitFill(NumBytes, Val, DEFAULT_ADDRSPACE);
return false;
}
Modified: llvm/trunk/test/MC/ELF/zero.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/zero.s?rev=115655&r1=115654&r2=115655&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/zero.s (original)
+++ llvm/trunk/test/MC/ELF/zero.s Tue Oct 5 14:42:57 2010
@@ -1,15 +1,16 @@
// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump --dump-section-data | FileCheck %s
.zero 4
+.zero 1,42
// CHECK: ('sh_name', 1) # '.text'
// CHECK: ('sh_type', 1)
// CHECK: ('sh_flags', 6)
// CHECK: ('sh_addr', 0)
// CHECK: ('sh_offset', 64)
-// CHECK: ('sh_size', 4)
+// CHECK: ('sh_size', 5)
// CHECK: ('sh_link', 0)
// CHECK: ('sh_info', 0)
// CHECK: ('sh_addralign', 4)
// CHECK: ('sh_entsize', 0)
-// CHECK: ('_section_data', '00000000')
+// CHECK: ('_section_data', '00000000 2a')
More information about the llvm-commits
mailing list