Commit Graph

52 Commits

Author SHA1 Message Date
Daniel Dunbar b442e04259 llvm-mc: Add some more doxyments.
llvm-svn: 74607
2009-07-01 15:14:50 +00:00
Daniel Dunbar 9c4809a887 llvm-mc: Fill in the rest of tokens for 'as-lex' mode.
llvm-svn: 74598
2009-07-01 06:56:54 +00:00
Daniel Dunbar 0d5fc9a5b0 Rename MCValue::isConstant to isAbsolute.
llvm-svn: 74596
2009-07-01 06:48:00 +00:00
Chris Lattner e4dfc89615 add some of the new tokens, others are still missing.
llvm-svn: 74595
2009-07-01 06:36:49 +00:00
Daniel Dunbar fc35841077 llvm-mc: Emit parsed instructions to the MCStreamer.
llvm-svn: 74594
2009-07-01 06:35:48 +00:00
Daniel Dunbar d0a08e0430 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 cfcdf5c1ac llvm-mc: Accept relocatable expressions when parsing displacements and
immediates.

llvm-svn: 74568
2009-06-30 23:02:44 +00:00
Daniel Dunbar 8561b6aea0 llvm-mc: Symbols in a relocatable expression of the (a - b + cst) form are
allowed to be undefined when the expression is seen, we cannot enforce the
same-section requirement until the entire assembly file has been seen.

llvm-svn: 74565
2009-06-30 22:49:27 +00:00
Daniel Dunbar 3971273aa2 Suppress may-be-used-uninitialized warning.
llvm-svn: 74529
2009-06-30 16:02:47 +00:00
Douglas Gregor 16f652876f Fix CMake build
llvm-svn: 74527
2009-06-30 14:37:26 +00:00
Daniel Dunbar 75630b355a llvm-mc: Accept relocatable expressions for .org, assignments, .byte, etc.
llvm-svn: 74498
2009-06-30 02:10:03 +00:00
Daniel Dunbar 19f847fa68 llvm-mc: Rewrite binary subtraction for relocatable expressions, we can't always
legally negate an MCValue.

llvm-svn: 74497
2009-06-30 02:08:27 +00:00
Daniel Dunbar bd4bf3d4f7 llvm-mc: Evaluation for relocatable expressions.
llvm-svn: 74496
2009-06-30 01:49:52 +00:00
Daniel Dunbar c9dc78ae40 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 a5508c893a llvm-mc: Parse symbol attribute directives.
llvm-svn: 74487
2009-06-30 00:33:19 +00:00
Daniel Dunbar cc566a714b llvm-mc: Parse .{,b,p2}align{,w,l} directives.
llvm-svn: 74478
2009-06-29 23:46:59 +00:00
Daniel Dunbar ae7ac01059 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 5992b4a211 llvm-mc: Recognize C++ style comments.
llvm-svn: 74463
2009-06-29 22:00:57 +00:00
Daniel Dunbar 6b22f9ca45 llvm-mc: Recognize C++ style comments.
llvm-svn: 74462
2009-06-29 21:58:22 +00:00
Daniel Dunbar 231898baf5 Fix uninitialized variable warning.
llvm-svn: 74457
2009-06-29 21:14:21 +00:00
Daniel Dunbar 84bfd7b184 MC: Improve expression parsing and implement evaluation of absolute expressions
(missed files).

llvm-svn: 74450
2009-06-29 20:40:36 +00:00
Daniel Dunbar 7e8d6c7215 MC: Improve expression parsing and implement evaluation of absolute expressions.
llvm-svn: 74448
2009-06-29 20:37:27 +00:00
Daniel Dunbar 4a5a561a24 MC: Parse .org directives.
llvm-svn: 74218
2009-06-25 22:44:51 +00:00
Daniel Dunbar 2d2ee150eb MC: Parse .set and assignments.
llvm-svn: 74208
2009-06-25 21:56:11 +00:00
Daniel Dunbar a10e519e04 Basic .s parsing for .asci[iz], .fill, .space, {.byte, .short, ... }
- Includes some DG tests in test/MC/AsmParser, which are rather primitive since
   we don't have a -verify mode yet.

llvm-svn: 74139
2009-06-24 23:30:00 +00:00
Chris Lattner f7ebca4db6 implement a bunch of synonyms for section switching.
llvm-svn: 74062
2009-06-24 05:13:15 +00:00
Chris Lattner bedf6c2995 add support for parsing and emitting .section directives. We can now parse
things like:
.section __TEXT,__cstring,cstring_literals

llvm-svn: 74058
2009-06-24 04:43:34 +00:00
Chris Lattner 3f5738d599 add trivial support for passing label definitions through the MCStreamer.
This is suboptimal in several aspects, see the commented out assertion.
I need to talk to Daniel about this.

llvm-svn: 74057
2009-06-24 04:31:49 +00:00
Chris Lattner 92ffdd15f8 create an MCStreamer and provide it to AsmParser.
llvm-svn: 74039
2009-06-24 00:52:40 +00:00
Chris Lattner 4c501fc196 make the lexer unique strings it lexes instead of passing them back as
std::strings.

llvm-svn: 74036
2009-06-24 00:33:19 +00:00
Daniel Dunbar ca29e4d7f4 Start flushing out MCContext.
- Lives inside new library lib/MC (LLVMMC.a)

llvm-svn: 74013
2009-06-23 22:01:43 +00:00
Chris Lattner 3417d71ff4 refactor a bunch of X86 specific stuff out to its own file.
llvm-svn: 73982
2009-06-23 18:41:30 +00:00
Chris Lattner f97d8bbe73 implement a trivial binary expression parser, we can now parse all of 176.gcc.llc.s
llvm-svn: 73950
2009-06-23 05:57:07 +00:00
Chris Lattner 9ec76a0b79 get a definition of strull on windows, thanks to Howard Su.
llvm-svn: 73929
2009-06-23 00:24:36 +00:00
Duncan Sands 376c6f16de Include cstdio to get EOF, needed with gcc-4.4.
llvm-svn: 73879
2009-06-22 06:59:32 +00:00
Chris Lattner 1d1fe918de process memory operands with a parenthesized expression for a displacement,
like "(4+5)(%eax)".

llvm-svn: 73878
2009-06-22 06:35:58 +00:00
Chris Lattner 7fdbce7a60 Implement full support for parsing primary expressions. We can now parse
all of health and voronoi (ignoring directives).  We only get 409 lines into
176.gcc though because we don't have binary operators yet:

Parsing 176.gcc.llc.s:409: unexpected token in operand list
	movsbl	_arityvec+1(,%edi,8), %eax
	      	         ^

llvm-svn: 73877
2009-06-22 06:32:03 +00:00
Chris Lattner a7b51ed5e6 implement parser support for '*' operands, as in "call *%eax".
llvm-svn: 73876
2009-06-22 06:02:13 +00:00
Chris Lattner 78db36271c implement memory operand parsing.
llvm-svn: 73875
2009-06-22 05:51:26 +00:00
Chris Lattner e5074c46b2 start implementing some simple operand parsing.
llvm-svn: 73867
2009-06-22 01:29:09 +00:00
Chris Lattner 2adc9e739c rename SourceMgr::PrintError to PrintMessage.
llvm-svn: 73861
2009-06-21 21:22:11 +00:00
Chris Lattner 36e0212c16 set up the top-level parsing loop.
llvm-svn: 73860
2009-06-21 20:54:55 +00:00
Chris Lattner b013345338 stub out parser for asm files. Change invariant on lexer to always
print its error message when it returns an asmtok::Error token.
Compute a proper error code for llvm-mc in 'lex' mode.  Add new
-as-lex option to enable lexing mode (vs parsing mode).

llvm-svn: 73859
2009-06-21 20:16:42 +00:00
Chris Lattner 419a97491a add string literals.
llvm-svn: 73858
2009-06-21 19:56:35 +00:00
Chris Lattner 99f0b60f45 hopefully fix the build on linux.
llvm-svn: 73857
2009-06-21 19:43:50 +00:00
Chris Lattner d0765617d2 implement enough of a lexer to get through Olden/health/Output/health.llc.s
without errors.

llvm-svn: 73855
2009-06-21 19:21:25 +00:00
Chris Lattner d485848229 oh yeah, cmake needs to be told explicitly about new files :)
llvm-svn: 73849
2009-06-21 07:19:34 +00:00
Chris Lattner c8dfbcbb31 some baby steps.
llvm-svn: 73848
2009-06-21 07:19:10 +00:00
Chris Lattner d70e15b46f start wiring up support for asm parsing.
llvm-svn: 73846
2009-06-21 05:22:37 +00:00
Chris Lattner 2cce7d5988 fix build problem pointed out by John Thompson!
llvm-svn: 73739
2009-06-18 23:46:04 +00:00