Rafael Espindola
004725876e
Small improvement to the recursion detection logic from the previous commit.
...
llvm-svn: 149175
2012-01-28 06:22:14 +00:00
Rafael Espindola
72f5f170c6
Handle recursive variable definitions directly. This gives us better error
...
messages and allows us to fix PR11865.
llvm-svn: 149174
2012-01-28 05:57:00 +00:00
Kevin Enderby
6223cf72e6
The error check for using -g with a .s file already containing dwarf .file
...
directives was in the wrong place and getting triggered incorectly with a
cpp .file directive. This change fixes that and adds a test case.
llvm-svn: 147951
2012-01-11 18:04:47 +00:00
Rafael Espindola
0708209642
Split Finish into Finish and FinishImpl to have a common place to do end of
...
file error checking. Use that to error on an unfinished cfi_startproc.
The error is not nice, but is already better than a segmentation fault.
llvm-svn: 147717
2012-01-07 03:13:18 +00:00
Kevin Enderby
ad41ab5015
Improve the implementation of .incbin directive by replacing a loop by using
...
getStreamer().EmitBytes. Suggestion by Benjamin Kramer!
llvm-svn: 146599
2011-12-14 22:34:45 +00:00
Kevin Enderby
109f25c966
Add the .incbin directive which takes the binary data from a file and emits
...
it to the streamer. rdar://10383898
llvm-svn: 146592
2011-12-14 21:47:48 +00:00
Rafael Espindola
300dcb8e37
Move test to the X86 directory, note the PR number and only run MC once.
...
llvm-svn: 143352
2011-10-31 17:23:09 +00:00
NAKAMURA Takumi
7636f55348
test/MC/AsmParser/2011-09-06-NoNewline.s: Add explicit -mtriple=i386. It uses X86 instruction.
...
FIXME: Would it be reproduced without target-specific operands?
FIXME: Why run llvm-mc as the same input by 3 times?
llvm-svn: 143195
2011-10-28 14:12:30 +00:00
Rafael Espindola
e0d0908356
Fix parsing of a line with only a # in it.
...
llvm-svn: 142537
2011-10-19 18:48:52 +00:00
Nick Lewycky
40f8f2ff24
Add support for a new extension to the .file directive:
...
.file filenumber "directory" "filename"
This removes one join+split of the directory+filename in MC internals. Because
bitcode files have independent fields for directory and filenames in debug info,
this patch may change the .o files written by existing .bc files.
llvm-svn: 142300
2011-10-17 23:05:28 +00:00
Stepan Dyatkovskiy
12746ea313
Added regression test for bug #10869 .
...
llvm-svn: 140012
2011-09-19 07:48:08 +00:00
Jim Grosbach
bd16424f91
Fix AsmParser binary precedence for shift operators.
...
rdar://9976729
llvm-svn: 138208
2011-08-20 16:24:13 +00:00
Jim Grosbach
3322f02a03
Tidy up. Whitespace.
...
llvm-svn: 138207
2011-08-20 16:10:09 +00:00
Jim Grosbach
38b1ed8ce2
Move some ELF directives into ELF asm parser.
...
The .local, .hidden, .internal, and .protected are not legal for all supported
file formats (in particular, they're invalid for MachO). Move the parsing for
them into the ELF assembly parser since that's the format they're for.
Similarly, .weak is used by COFF and ELF, but not MachO, so move the parsing
to the COFF and ELF asm parsers. Previously, using any of these directives
on Darwin would result in an assertion failure in the parser; now we get
a diagnostic as we should.
rdar://9827089
llvm-svn: 135921
2011-07-25 17:55:35 +00:00
Jim Grosbach
76346c3bf7
Asm parser range checking on .<size> <value> directives.
...
For example, ".byte 256" would previously assert() when emitting an object
file. Now it generates a diagnostic that the literal value is out of range.
rdar://9686950
llvm-svn: 134069
2011-06-29 16:05:14 +00:00
Hans Wennborg
3fefc65c1d
MC: Allow .common as alias for .comm assembler directive. PR10116.
...
llvm-svn: 133349
2011-06-18 13:51:54 +00:00
Roman Divacky
a81247af34
Test that ".byte 1, 2, 3, 4" does the right thing.
...
Requested by nbjoerg!
llvm-svn: 132716
2011-06-07 17:32:17 +00:00
Rafael Espindola
1134ab23df
Basic support for macros with explicit arguments.
...
We still don't handle
* default values
* :req
* :vararg
* \()
llvm-svn: 132656
2011-06-05 02:43:45 +00:00
Charles Davis
567a1ad7c5
Add a test for the chained directives that I forgot last time.
...
llvm-svn: 132110
2011-05-26 05:17:43 +00:00
Charles Davis
006e1c39d0
Test .seh_startchained and .seh_endchained parsing.
...
Rework how the MCWin64EHUnwindInfo instances are stored. Fix issues with
chained unwind areas exposed by the test that were related to this.
The ChainedParent field had the wrong address, because when the chained unwind
info was added, the addresses shifted around. Now we store the pointers to the
structures, which are now allocated from the MC heap.
llvm-svn: 132106
2011-05-26 02:45:47 +00:00
Charles Davis
2f6ecea19d
Add tests for .seh_setframe and .seh_handlerdata parsing. Fix issues with
...
them.
I had to add a special SwitchSectionNoChange method to MCStreamer just for
.seh_handlerdata. If this isn't OK, please let me know, and I'll find some
other way to fix .seh_handlerdata streaming.
llvm-svn: 132084
2011-05-25 21:43:45 +00:00
Charles Davis
828b00c0e1
Add tests for .seh_savereg and .seh_savexmm parsing. Once again, fix the
...
buggy methods that parse these directives.
llvm-svn: 132045
2011-05-25 04:51:25 +00:00
Charles Davis
b0c4f39173
Add a test for .seh_pushframe parsing. Fix the bug exposed by it (and another
...
one I found by inspection).
llvm-svn: 132037
2011-05-25 04:08:15 +00:00
Charles Davis
fc1e7ce850
Add a test for the .seh_handler directive. Fix problems with the parsing
...
method exposed by the test. While we're at it, simplify the .seh_proc
parsing method.
llvm-svn: 132028
2011-05-25 01:33:42 +00:00
Charles Davis
f4ce8fde18
Test basic SEH directive-parsing functionality. Fix a latent bug exposed by
...
this test.
llvm-svn: 132004
2011-05-24 21:22:53 +00:00
Eric Christopher
ffc0e1f6e6
Match case for invalid constant error messages and add a new
...
test for invalid hexadecimals.
llvm-svn: 129326
2011-04-12 00:18:03 +00:00
Eric Christopher
0a68959604
Test for invalid constant expr addition - bad octal constant.
...
llvm-svn: 129323
2011-04-12 00:03:38 +00:00
Benjamin Kramer
2b6c96b43d
Don't store Twine temporaries, it's not safe.
...
And don't append the name over and over again in the loop.
llvm-svn: 129210
2011-04-09 11:26:27 +00:00
Rafael Espindola
9a1a34b105
Update tests
...
llvm-svn: 129116
2011-04-07 23:51:25 +00:00
Rafael Espindola
88bc341061
Add support for .skip.
...
Patch by Roman Divacky.
Fixes PR9361.
llvm-svn: 129106
2011-04-07 20:26:23 +00:00
Kevin Enderby
df4935cc90
Adding a test for "-inf" as well.
...
llvm-svn: 128495
2011-03-29 21:54:10 +00:00
Kevin Enderby
5bbe957155
Added support symbolic floating point constants in the MC assembler for Infinity
...
and Nans with the same strings as GAS supports. rdar://8673024
llvm-svn: 128488
2011-03-29 21:11:52 +00:00
Daniel Dunbar
6f4c9425eb
MC: Improve some diagnostics on uses of '.' pseudo-symbol.
...
llvm-svn: 128289
2011-03-25 17:47:17 +00:00
Devang Patel
b52040da17
Move arch specific tests in arch specific directories.
...
llvm-svn: 126401
2011-02-24 19:06:27 +00:00
Jim Grosbach
fe4858f269
Remove file. Previous commit deleted content, but left the file around.
...
llvm-svn: 126337
2011-02-23 21:43:31 +00:00
Jim Grosbach
0c03a3a146
Revert r125595, which is an X86-only undocumented assembly syntax extension
...
enabled for all targets. Non-X86 targets should not have this behavior
enabled by default.
Joerg, if you would like to resubmit with the behavior conditionalized to be
X86-ELF only, that's fine.
llvm-svn: 126336
2011-02-23 21:26:51 +00:00
Rafael Espindola
58ac6e1677
Add support for pushsection and popsection. Patch by Joerg Sonnenberger.
...
llvm-svn: 125629
2011-02-16 01:08:29 +00:00
Roman Divacky
4e0f4957bc
Add support for parsing [expr].
...
This is submitted by Joerg Sonnenberger and fixes his PR8685.
llvm-svn: 125595
2011-02-15 20:43:39 +00:00
Benjamin Kramer
7b7caf51e9
Support for .ifdef / .ifndef in the assembler parser. Patch by Joerg Sonnenberger.
...
llvm-svn: 125120
2011-02-08 22:29:56 +00:00
Roman Divacky
7e9e290952
Add support for parsing .float
...
llvm-svn: 124485
2011-01-28 14:20:32 +00:00
Nico Weber
4ada0d9164
PR8951: Support for .equiv in integrated assembler, patch by Jörg Sonnenberger!
...
llvm-svn: 124467
2011-01-28 03:04:41 +00:00
Kevin Enderby
fa3c6f148c
In llvm-mc parse a Hash token as a full line comment. Allows handling of
...
preprocessed .s files and matches darwin gas. rdar://8798690
Also fix a comment on the next line of AsmParser.cpp after this new code.
llvm-svn: 122531
2010-12-24 00:12:02 +00:00
Roman Divacky
71d29167ea
Add support for lexing single quotes like 'c'.
...
This fixed 8615.
llvm-svn: 122150
2010-12-18 08:56:37 +00:00
Rafael Espindola
5fe5f45352
Rename temporary symbols if they conflict with artificial symbols created
...
by the assembler. This was blocking parsing any large .s produced by clang for
example.
Fixes PR8596.
llvm-svn: 120603
2010-12-01 20:46:11 +00:00
Rafael Espindola
f01b622902
Parse and remember discriminators in .loc line. I try to output them with
...
another patch.
This lets us parse a bit more of the gcc 4.5 output.
llvm-svn: 118975
2010-11-13 03:18:27 +00:00
Rafael Espindola
144fb8af58
Add support for .value.
...
llvm-svn: 117922
2010-11-01 15:29:07 +00:00
Rafael Espindola
63760ba38e
Add support for the .string directive.
...
llvm-svn: 117592
2010-10-28 20:02:27 +00:00
Roman Divacky
fdac6365ab
Implement .equ directive as a synonym to .set.
...
llvm-svn: 117553
2010-10-28 16:22:58 +00:00
Daniel Dunbar
b3a48f3459
MC/AsmParser: Fix relative precedence of {+,-} and comparison ops.
...
llvm-svn: 117299
2010-10-25 20:18:56 +00:00
Daniel Dunbar
7484d2cbec
MC/AsmLexer: Fix bug in source location for Slash token.
...
llvm-svn: 117298
2010-10-25 20:18:53 +00:00