1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

67 Commits

Author SHA1 Message Date
Daniel Dunbar
4990c2b03d llvm-mc: Support escaped characters in string literals (for .ascii and .asciz)
llvm-svn: 79010
2009-08-14 18:19:52 +00:00
Daniel Dunbar
8b8ee45c05 llvm-mc: Accept .word as a synonym for .short
llvm-svn: 78641
2009-08-11 04:44:00 +00:00
Daniel Dunbar
9c03cc13de llvm-mc: Sketch parsing for .file, .line, and .loc. No streamer hooks for these
yet (I'm not even sure what they do).

llvm-svn: 78639
2009-08-11 04:24:50 +00:00
Daniel Dunbar
677e05c42d llvm-mc: Fix darwin .section parsing. It was skipping the section name and a ','
(and outputting a diagnostic pointing at the wrong place), all of which lead to
much confusion.

llvm-svn: 78637
2009-08-11 03:42:33 +00:00
Chris Lattner
3e6da637f6 split MachO section handling stuff out to its out .h/.cpp file.
llvm-svn: 78576
2009-08-10 18:15:01 +00:00
Chris Lattner
f14da636ad add a fixme
llvm-svn: 78575
2009-08-10 18:05:55 +00:00
Chris Lattner
cc70d578be Make the big switch: Change MCSectionMachO to represent a section *semantically*
instead of syntactically as a string.  This means that it keeps track of the 
segment, section, flags, etc directly and asmprints them in the right format.
This also includes parsing and validation support for llvm-mc and 
"attribute(section)", so we should now start getting errors about invalid 
section attributes from the compiler instead of the assembler on darwin.

Still todo: 
1) Uniquing of darwin mcsections
2) Move all the Darwin stuff out to MCSectionMachO.[cpp|h]
3) there are a few FIXMEs, for example what is the syntax to get the
   S_GB_ZEROFILL segment type?

llvm-svn: 78547
2009-08-10 01:39:42 +00:00
Chris Lattner
9e2c3aa666 sink the 'name' and 'isdirective' state out of MCSection into its derived classes.
This totally optimizes PIC16 sections by not having an 'isdirective' bit anymore!! ;-)

llvm-svn: 78517
2009-08-08 23:39:42 +00:00
Chris Lattner
f8ab7ad73a switch this to create coff sections for now, it doesn't really matter for
llvm-mc's purpose yet and we'll want to switch to creating semantic sections
at some point.

llvm-svn: 78509
2009-08-08 22:38:48 +00:00
Kevin Enderby
dd20299f97 Added Mac OS X assembler style conditional assembly. I may come back and see if
I can clean this up a bit more and do way with the TheCondState and just use
the top element on the TheCondStack if not empty.  Also may tweak the code
around ParseConditionalAssemblyDirectives() to simplify the AsmParser code.

llvm-svn: 78423
2009-08-07 22:46:00 +00:00
Chris Lattner
944a154399 update for API change.
llvm-svn: 77804
2009-08-01 21:14:30 +00:00
Chris Lattner
04ae6629fe All MCSections are now required to have a SectionKind.
llvm-svn: 77787
2009-08-01 18:25:49 +00:00
Daniel Dunbar
7fd7e31119 llvm-mc: More quoted identifier support.
llvm-svn: 77761
2009-08-01 00:48:30 +00:00
Daniel Dunbar
e150b07b71 llvm-mc: Support quoted identifiers.
- Uses MCAsmToken::getIdentifier which returns the (sub)string representing the
   meaningfull contents a string or identifier token.

 - Directives aren't done yet.

llvm-svn: 77739
2009-07-31 21:55:09 +00:00
Chris Lattner
4d1b33e52e fix some more issues where we expected GetSection to do "get or create"
llvm-svn: 77700
2009-07-31 18:27:48 +00:00
Chris Lattner
dd53131aee fix a bunch of failing tests now that MCContext::GetSection doesn't create sections.
llvm-svn: 77689
2009-07-31 17:47:16 +00:00
Daniel Dunbar
4ed0e9b76c Move X86 instruction parsing into X86/AsmParser.
llvm-svn: 77384
2009-07-28 22:40:46 +00:00
Daniel Dunbar
45429b2b1e Switch AsmLexer::Lex to returning a reference to the current token.
llvm-svn: 77328
2009-07-28 16:56:42 +00:00
Daniel Dunbar
61ef1ddfb4 Drop some AsmLexer methods in favor of their AsmToken equivalents.
llvm-svn: 77323
2009-07-28 16:38:40 +00:00
Daniel Dunbar
1c373fc85a llvm-mc: Sink token enum into AsmToken.
llvm-svn: 77322
2009-07-28 16:08:33 +00:00
Daniel Dunbar
3edfc4bb16 llvm-mc: Implement .abort fully in the front end
llvm-svn: 77272
2009-07-27 23:20:52 +00:00
Daniel Dunbar
5f73e9d3f8 llvm-mc: Move AsmLexer::getCurStrVal to StringRef based API.
- My DFS traversal of LLVM is, at least for now, nearly complete! :)

llvm-svn: 77258
2009-07-27 21:49:56 +00:00
Kevin Enderby
f1c0daa6a7 Removed the DumpSymbolsandMacros and LoadSymbolsandMacros MCStreamer API as
the parsing of the .dump and .load should be done in the assembly parser and
not have any need for an MCStreamer API.  Changed the code for now so these
just produce an error saying these specific directives are not yet implemented
since they are likely no longer used and may never need to be implemented.

llvm-svn: 76462
2009-07-20 20:25:37 +00:00
Daniel Dunbar
fca75cd98e Add MCAsmParser interface.
- This provides the AsmParser interface to the target specific assembly
   parsers.

llvm-svn: 76453
2009-07-20 18:55:04 +00:00
Kevin Enderby
f641ecc6e8 Removed the SubsectionsViaSymbols MCStreamer API and replaced it with a generic
EmitAssemblerFlag API which takes a value from the added AssemblerFlag
enumerated constants.

llvm-svn: 76087
2009-07-16 17:56:39 +00:00
Kevin Enderby
b5346feb10 Clean up the definition of Str in AsmParser::ParseDirectiveDarwinDumpOrLoad
so it is defined with a lifetime that is as short as possible.

llvm-svn: 76082
2009-07-16 17:17:46 +00:00
Chris Lattner
4939bd13ad implement .include in the lexer/parser instead of passing it into the streamer.
llvm-svn: 75896
2009-07-16 06:14:39 +00:00
Kevin Enderby
312f8559cb Added llvm-mc support for parsing the .dump and .load directives.
llvm-svn: 75786
2009-07-15 15:30:11 +00:00
Kevin Enderby
3e47cf1dda Added llvm-mc support for parsing the .include directive.
llvm-svn: 75711
2009-07-14 23:21:55 +00:00
Kevin Enderby
5821cee99b Added llvm-mc support for parsing the .lsym directive.
llvm-svn: 75685
2009-07-14 21:35:03 +00:00
Kevin Enderby
0b1331c43b Added llvm-mc support for parsing the .desc directive.
llvm-svn: 75645
2009-07-14 18:17:10 +00:00
Kevin Enderby
af095fcfb8 Added llvm-mc support for parsing the .abort directive.
llvm-svn: 75545
2009-07-13 23:15:14 +00:00
Kevin Enderby
a461788d6a add llvm-mc support for parsing the .subsections_via_symbols directive.
llvm-svn: 75500
2009-07-13 21:03:15 +00:00
Chris Lattner
1e7e5e5de0 silence vc++ warning.
llvm-svn: 75394
2009-07-11 22:32:37 +00:00
Chris Lattner
84bf9fed2b add support for .zerofill, patch by Kevin Enderby!
llvm-svn: 75301
2009-07-10 22:20:30 +00:00
Chris Lattner
56638bb644 add llvm-mc support for parsing the .lcomm directive, patch by Kevin Enderby!
llvm-svn: 75148
2009-07-09 17:25:12 +00:00
Chris Lattner
2bea79b45b Implement parsing support for the .comm directive. Patch by
Kevin Enderby!

llvm-svn: 74944
2009-07-07 20:30:46 +00:00
Chris Lattner
448c0a2708 implement error recovery in the llvm-mc parser. Feel the power!
llvm-svn: 74728
2009-07-02 21:53:43 +00:00
Daniel Dunbar
b87d6f328e llvm-mc/x86: Fix bug in disambiguation of displacement operand, introduced by me
(I think).
 - We weren't properly parsing the leading parenthesized expression in something
   like 'push (4)(%eax)'.
 
 - Added ParseParenRelocatableExpression to support this. I suspect we should
   just use lookahead, though.

 - Test case to follow.

llvm-svn: 74685
2009-07-02 02:09:07 +00:00
Daniel Dunbar
1960440e70 llvm-mc: Emit parsed instructions to the MCStreamer.
llvm-svn: 74594
2009-07-01 06:35:48 +00:00
Daniel Dunbar
cae97fa7a9 llvm-mc: Introduce method to match a parsed x86 instruction into an MCInst.
llvm-svn: 74573
2009-06-30 23:38:38 +00:00
Daniel Dunbar
2d92d62fb2 llvm-mc: Accept relocatable expressions for .org, assignments, .byte, etc.
llvm-svn: 74498
2009-06-30 02:10:03 +00:00
Daniel Dunbar
c3cac19cfe llvm-mc: Evaluation for relocatable expressions.
llvm-svn: 74496
2009-06-30 01:49:52 +00:00
Daniel Dunbar
5bec168037 Normalize SourceMgr messages.
- Don't print "Parsing" in front of every message.

 - Take additional "type" argument which is prepended to the message (with ": ")
   if given.

 - Update clients to print errors (warnings) as:
<filename>:<line number>: error(warning): ...

llvm-svn: 74489
2009-06-30 00:49:23 +00:00
Daniel Dunbar
e4fd18eda8 llvm-mc: Parse symbol attribute directives.
llvm-svn: 74487
2009-06-30 00:33:19 +00:00
Daniel Dunbar
72c0434597 llvm-mc: Parse .{,b,p2}align{,w,l} directives.
llvm-svn: 74478
2009-06-29 23:46:59 +00:00
Daniel Dunbar
37b8fe7db3 llvm-mc: Diagnose misuse (mix) of defined symbols and labels.
- For example, we diagnose errors on:
--
a:
a = 10
--

 - For now we reject code like:
--
.long a
a = 10
--
   which "as" accepts (on Darwin).

llvm-svn: 74476
2009-06-29 23:43:14 +00:00
Daniel Dunbar
8be858eeb4 Fix uninitialized variable warning.
llvm-svn: 74457
2009-06-29 21:14:21 +00:00
Daniel Dunbar
ade4f03bd0 MC: Improve expression parsing and implement evaluation of absolute expressions.
llvm-svn: 74448
2009-06-29 20:37:27 +00:00
Daniel Dunbar
bfc585a86e MC: Parse .org directives.
llvm-svn: 74218
2009-06-25 22:44:51 +00:00