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

102 Commits

Author SHA1 Message Date
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
Benjamin Kramer
1b44e6e359 Always initialize AsmConds.
llvm-svn: 78463
2009-08-08 11:26:50 +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
Daniel Dunbar
2781e4bd89 Remove now unused arguments from TargetRegistry::lookupTarget.
llvm-svn: 77950
2009-08-03 04:20:57 +00:00
Chris Lattner
506b49ffa0 Make SectionKind::get() private.
llvm-svn: 77835
2009-08-02 00:02:44 +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
48d0ed9534 Update CMakeLists
llvm-svn: 77385
2009-07-28 22:46:39 +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
ec1ea2e240 Make expression parsing and error/warning reporting available through the
generic MCAsmParser interface.

llvm-svn: 77381
2009-07-28 22:22:31 +00:00
Daniel Dunbar
d0d6b26e87 Provide generic MCAsmParser when constructing target specific parsers.
llvm-svn: 77362
2009-07-28 20:47:52 +00:00
Daniel Dunbar
20903ee1b9 Switch X86 assembly parser to using the generic lexer interface.
llvm-svn: 77341
2009-07-28 18:17:26 +00:00
Daniel Dunbar
6e2f7db6b6 Expose Tokens to target specific assembly parsers.
llvm-svn: 77337
2009-07-28 17:58:44 +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
f7ad1ea8dd llvm-mc: Factor AsmToken class out of AsmLexer.
llvm-svn: 77292
2009-07-28 03:00:54 +00:00
Daniel Dunbar
9e627e8dc8 llvm-mc: Stop uniqueing string tokens, nothing actually uses this.
llvm-svn: 77287
2009-07-28 00:58:50 +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
Daniel Dunbar
a7a01acc7c Factor commonality in triple match routines into helper template for registering
classes, and migrate existing targets over.

llvm-svn: 77126
2009-07-26 05:03:33 +00:00
Daniel Dunbar
62e74f03c7 Add TargetRegistry::lookupTarget.
- This is a simplified mechanism which just looks up a target based on the
   target triple, with a few additional flags.

 - Remove getClosestStaticTargetForModule, the moral equivalent is now:
     lookupTarget(Mod->getTargetTriple, true, false, ...);

 - This no longer does the fuzzy matching with target data (based on endianness
   and pointer width) that getClosestStaticTargetForModule was doing, but this
   was deemed unnecessary.

llvm-svn: 77111
2009-07-26 02:12:58 +00:00
Daniel Dunbar
b5adc13728 Convert StringMap to using StringRef for its APIs.
- Yay for '-'s and simplifications!

 - I kept StringMap::GetOrCreateValue for compatibility purposes, this can
   eventually go away. Likewise the StringMapEntry Create functions still follow
   the old style.

 - NIFC.

llvm-svn: 76888
2009-07-23 18:17:34 +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
2e4aeceacd Add MCAsmLexer interface.
- This provides the AsmLexer interface to the target specific assembly parsers.

llvm-svn: 76460
2009-07-20 20:01:54 +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
Daniel Dunbar
961c43b2b0 llvm-mc: Default -triple to LLVM_HOSTTRIPLE.
llvm-svn: 76260
2009-07-17 22:51:20 +00:00
Daniel Dunbar
ab1316fbaf llvm-mc: Add -triple, and start fetching the target asm printer.
llvm-svn: 76257
2009-07-17 22:38:58 +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
0afb18f239 llvm-mc/x86: Fix various nit-picky bugs in displacement parsing.
- Test case to follow.

llvm-svn: 74687
2009-07-02 02:26:39 +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
ffbf6228a2 llvm-mc/x86: Factor out ParseX86Register.
llvm-svn: 74684
2009-07-02 01:58:24 +00:00
Daniel Dunbar
7c83d0ed14 llvm-mc/x86: Rename X86Operand::ScaleReg to IndexReg and make order consistent
with syntax.

llvm-svn: 74679
2009-07-02 00:51:52 +00:00