Commit Graph

198 Commits

Author SHA1 Message Date
Rafael Espindola
c50a0fd7cb 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118975 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13 03:18:27 +00:00
Rafael Espindola
d4a352609f gnu as support both % and @ before types, do the same.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118893 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-12 15:47:08 +00:00
Rafael Espindola
e1a2587ee2 Mark labels declared in tls sections as STT_TLS. This matches the behavior of
gas.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118818 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11 19:04:55 +00:00
Rafael Espindola
2ff9e83a82 Initial comdat implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118805 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11 18:13:52 +00:00
Rafael Espindola
34be396a12 Fixed version of 118639 with an extra assert to catch similar problems
earlier. Implicit bool -> int conversions are evil!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118651 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 23:42:07 +00:00
Rafael Espindola
037b5be15a Revert previous patch. Missed a case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118645 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 22:54:38 +00:00
Rafael Espindola
e61a1ac595 Remove IsExplicit. It was always false.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118639 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 22:37:44 +00:00
Daniel Dunbar
603abd5619 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118421 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-08 17:53:02 +00:00
Rafael Espindola
4faf7c78fe Set default flags for .rodata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118395 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-08 02:47:59 +00:00
Rafael Espindola
3ff57094a7 Add support for expressions in .sleb/.uleb directives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118023 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 17:22:24 +00:00
Rafael Espindola
cc3acee7b3 Add support for .value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117922 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 15:29:07 +00:00
Rafael Espindola
484291c273 Implement .weakref.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117911 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 14:28:48 +00:00
Rafael Espindola
f4b0f3e616 Improvements to .section parsing:
* If we have a M or a G, reject sections without the type
* Only parse the flag specific arguments if we have M or G
* Parse the corresponding arguments for M and G

We ignore the G arguments and flag for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117608 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 21:33:33 +00:00
Rafael Espindola
787c33718d Add support for the .string directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117592 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 20:02:27 +00:00
Roman Divacky
f9d1752104 Use the IDVal directly as there's no need to convert to std::string.
Pointed out by Chris!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117557 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 16:57:58 +00:00
Roman Divacky
50e7a78709 Implement .equ directive as a synonym to .set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117553 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 16:22:58 +00:00
Rafael Espindola
4fa3478fc2 Set default type and flags for .init and .fini.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117471 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 18:45:20 +00:00
Rafael Espindola
8818213247 Add support for the .symver directive. This is really ugly, but most of it is
contained in the ELF object writer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117448 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27 15:18:17 +00:00
Rafael Espindola
61e3b91da7 Add support for .ident.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117389 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-26 19:35:47 +00:00
Daniel Dunbar
b1e0f76352 MC/AsmParser: Fix relative precedence of {+,-} and comparison ops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117299 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-25 20:18:56 +00:00
Daniel Dunbar
bdf90d679b MC/AsmLexer: Fix bug in source location for Slash token.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-25 20:18:53 +00:00
Chandler Carruth
1cd9708f5c Remove remaining uses of ATTRIBUTE_UNUSED on variables, and delete three
#includes in the process.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116919 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20 08:27:02 +00:00
Bill Wendling
cf2561d111 Fix spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116804 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-19 10:18:23 +00:00
Daniel Dunbar
138abae2a2 MC/AsmParser: Report .stabs directive as unsupported.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116659 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-16 04:56:42 +00:00
Michael J. Spencer
7d4900416a MC-COFF: Add COFFAsmParser. Completes PR8343.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116150 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-09 11:01:07 +00:00
Michael J. Spencer
c0c8df3cea Fix Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116149 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-09 11:00:50 +00:00
Michael J. Spencer
e90ea139f4 MC: Move ParseDirectiveELFType into ELFAsmParser. COFF uses .type for something else.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116142 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-09 03:47:55 +00:00
Rafael Espindola
e452b17130 Add support for a fill value in the .zero directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115655 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 19:42:57 +00:00
Kevin Enderby
3f55c24df9 Incorporate suggestions by Daniel Dunbar after his review. Thanks Daniel!
1) Changed ValidateDwarfFileNumber() to isValidDwarfFileNumber() to be better
   named.  Since it is just a predicate and isn't actually changing any state.

2) Added a missing return in the comments for setCurrentDwarfLoc() in 
   include/llvm/MC/MCContext.h for fix formatting.

3) Changed clearDwarfLocSeen() to ClearDwarfLocSeen() since it does change
   state.

4) Simplified the last test in isValidDwarfFileNumber() to just a one line
   boolean test of MCDwarfFiles[FileNumber] != 0 for the final return statement.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115551 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 20:17:24 +00:00
Jan Wen Voung
083cf1574f Add hook in MCSection to decide when to use "optimized nops", for each
section kind. Previously, optimized nops were only used for MachO.
Also added tests for ELF and COFF.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115523 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 17:32:41 +00:00
Kevin Enderby
c095793b4a This is the last major patch to implement support for the .loc directive
and output the dwarf line number tables.  This contains the code to emit and
encode the dwarf line tables from the previously gathered information in the
MCLineSection objects.  This contains all the details to encode the line and
address deltas into the dwarf line table.

To do this an MCDwarfLineAddrFragment has been added.

Also this moves the interface code out of Mach-O streamer into
MCDwarf so it should be useable by other object file formats.

There is now one call to be made from an MCObjectStreamer
EmitInstruction() method:
   MCLineEntry::Make(this, getCurrentSection());
to create a line entry after each instruction is assembled.

And one call call to be made from an MCObjectStreamer Finish() method:
   MCDwarfFileTable::Emit(this, DwarfLineSection);
when getContext().hasDwarfFiles() is true and is passed a object file specific
MCSection where to emit the dwarf file and the line tables.

This appears to now be correct for 32-bit targets, at least x86.  But the
relocation entries for 64-bit Darwin needs some further work which is next
up to work on.  So for now the 64-bit Mach-O target does not output the
dwarf file and line tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115157 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 16:52:03 +00:00
Jan Wen Voung
12ad94e03c Have ELFAsmParser.cpp use the already parsed "Size" (entry size) when
constructing a section. Test for a few cases also included.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115132 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 02:41:46 +00:00
Jan Wen Voung
a854a4bbc8 Test commit - Deleted some whitespace at the end of a line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115122 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 01:09:20 +00:00
Chris Lattner
7036f8be4d change the protocol TargetAsmPArser::MatchInstruction method to take an
MCStreamer to emit into instead of an MCInst to fill in.  This allows the
matcher extra flexibility and is more convenient.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115014 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 01:42:58 +00:00
Rafael Espindola
0453dd9ca0 Make sure .text doesn't produce extra alignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114895 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 21:40:27 +00:00
Daniel Dunbar
4f2afe3d39 MC/AsmParser: Handle exponents in floating point literals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114861 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 20:12:52 +00:00
Benjamin Kramer
d1e1703c39 Push twines deeper into SourceMgr's error handling methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114847 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 17:42:11 +00:00
Daniel Dunbar
facb34b41c MC/AsmParser: Handle a missed case of floating literals in the lexer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114733 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 17:10:26 +00:00
Daniel Dunbar
b95a079cae MC/AsmParser: Support .single and .double for embedding floating point literals.
- I believe more modern 'gas' supports a more enhanced set of arithmetic on
   them, but for now the only thing we can do is emit them as data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114719 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 01:59:56 +00:00
Daniel Dunbar
54f0a625b0 MC/Lexer: Add 'Real' token type for floating point literals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114718 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 01:59:31 +00:00
Chris Lattner
f7d4da0c1d fix rdar://8456417 - llvm-mc can't do basic math
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114532 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 05:05:16 +00:00
Rafael Espindola
f7c10a3cff Implement support for .local and its "interesting" interactions with .comm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114382 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 00:24:38 +00:00
Daniel Dunbar
f3f95c9274 Fix an MSVC warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114184 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 16:34:24 +00:00
Daniel Dunbar
cceba83893 MC/AsmParser: Add support for 'a + 4@GOTPCREL' and friends, by reconsing the
expression to include the modifier.
 - Gross, but this a corner case we don't expect to see often in practice, but
   it is worth accepting.
 - Also improves diagnostics on invalid modifiers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114154 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 02:47:07 +00:00
Rafael Espindola
34e3d0cfe5 Make sure that names like .note.GNU-stack are accepted as valid section names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114091 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 17:05:55 +00:00
Rafael Espindola
2ea2ac798b Add support for the .zero directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114077 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 15:03:59 +00:00
Rafael Espindola
d80781b98b Add a InitSections method to the streamer interface.
The ELF implementation now creates text, data and bss to match the gnu as
behavior.

The text streamer still has the old MachO specific behavior since
the testsuite checks that it will error when a directive is given
before a setting the current section for example.

A nice benefit is that -n is not required anymore when producing
ELF files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114027 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 21:48:40 +00:00
Rafael Espindola
b98ac2a71e Add support for leb128 of absolute expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113691 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-11 16:45:15 +00:00
Chris Lattner
cbf8a98c7c fix the asmparser so that the target is responsible for skipping to
the end of the line on a parser error, allowing skipping to happen
for syntactic errors but not for semantic errors.  Before we would
miss emitting a diagnostic about the second line, because we skipped
it due to the semantic error on the first line:

  foo %eax
  bar %al

This fixes rdar://8414033 - llvm-mc ignores lines after an invalid instruction mnemonic errors


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113688 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-11 16:18:25 +00:00
Daniel Dunbar
1ab6f2fa7a llvm-mc: Don't crash when using -n and we see a directive before the initial section.
- This is annoying, because we have to scatter this check everywhere that could emit real data, but I see no better solution.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113552 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 22:42:59 +00:00
Daniel Dunbar
93bd4d1e6b llvm-mc: Make sure we exit != 0 if any errors are encountered.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113551 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 22:42:56 +00:00
Chris Lattner
34e53140c2 change the MC "ParseInstruction" interface to make it the
implementation's job to check for and lex the EndOfStatement
marker.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113347 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08 05:10:46 +00:00
Benjamin Kramer
1674b0b0e4 Add AsmParser support for the ELF .previous directive. Patch by Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112849 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 18:53:37 +00:00
Kevin Enderby
6d8f1a9a18 Change the parsing of .loc back to allow the LineNumber field to be optional as
it is with other assemblers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111967 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 21:14:47 +00:00
Kevin Enderby
c1840b3da2 First bit of support for the dwarf .loc directive. This patch updates the
needed parsing for the .loc directive and saves the current info from that
into the context.  The next patch will take the current loc info after an
instruction is assembled and save that info into a vector for each section for
use to build the line number tables.  The patch after that will encode the info
from those vectors into the output file as the dwarf line tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 20:32:42 +00:00
Daniel Dunbar
e17edff28f MC/AsmParser: Change ParseExpression to use ParseIdentifier(), to support
dollars in identifiers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111946 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 19:13:42 +00:00
Daniel Dunbar
1f1b865c40 MC/Parser: Accept leading dollar signs in identifiers.
- Implemented by manually splicing the tokens. If this turns out to be
   problematically platform specific, a more elegant solution would be to
   implement some context dependent lexing support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111934 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 18:12:12 +00:00
Chris Lattner
a78c67e9bb fix rdar://7997827 - Accept and ignore LL and ULL suffixes on integer literals.
Also fix 0b010 syntax to actually work while we're at it :-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111876 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 00:43:25 +00:00
Daniel Dunbar
f1e29d4c21 MC/AsmParser: Push the burdon of emitting diagnostics about unmatched
instructions onto the target specific parser, which can do a better job.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110889 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 00:55:38 +00:00
Daniel Dunbar
3c14ca47fc llvm-mc: Add -show-inst-operands, for dumping the parsed instruction representation before matching.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110791 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 06:37:09 +00:00
Daniel Dunbar
b3cb696794 MCAsmParser: Add dump() hook to MCParsedAsmOperand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110790 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-11 06:37:04 +00:00
Daniel Dunbar
e25c6b95ce MC/AsmParser: Fix a bug in macro argument parsing, which was dropping
parentheses from argument lists.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110692 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-10 17:38:52 +00:00
Daniel Dunbar
56491303a6 MC: Destroy Macro instances.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109720 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-29 01:51:55 +00:00
Kevin Enderby
7cbf73a73f Added first bit of support for the dwarf .file directive. This patch collects
the info from the .file directive and makes file and directory tables that
will eventually be put out as part of the dwarf info in the output file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109651 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 20:55:35 +00:00
Matt Fleming
f525c2a8af Add some more handlers for ELF section directives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108928 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-20 21:12:46 +00:00
Daniel Dunbar
54074b5f04 TblGen/AsmMatcher: Add support for honoring instruction Requires<[]> attributes as part of the matcher.
- Currently includes a hack to limit ourselves to "In32BitMode" and "In64BitMode", because we don't have the other infrastructure to properly deal with setting SSE, etc. features on X86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108677 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 05:44:09 +00:00
Eli Friedman
5d68ec2229 Make .align parse correctly on platforms where .align is measured in bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108674 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 04:17:25 +00:00
Daniel Dunbar
1edf6ca2cb MC/AsmParser: Stop playing unsafe member function pointer calls, this isn't
portable enough.
 - Downside is we now double dispatch through a stub function, but this isn't
   performance critical.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108661 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-18 22:22:07 +00:00
Daniel Dunbar
6a46d571b4 MC/AsmParser: Fix .abort and .secure_log_unique to accept arbitrary token
sequences, not just strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108655 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-18 20:15:59 +00:00
Daniel Dunbar
7a570d09ac MC/AsmParser: Add macro argument substitution support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108654 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-18 19:00:10 +00:00
Daniel Dunbar
c64a0d7c3e MC/AsmParser: Add basic support for macro instantiation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108653 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-18 18:54:11 +00:00
Daniel Dunbar
6d8cf082f6 MC/AsmParser: Add basic parsing support for .macro definitions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108652 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-18 18:47:21 +00:00
Daniel Dunbar
3c802de01a MC/AsmParser: Add .macros_{off,on} support, not that makes sense since we don't
support macros.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108649 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-18 18:38:02 +00:00
Daniel Dunbar
275ce39794 MC/AsmParser: Use Error() instead of calling PrintMessage() directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108648 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-18 18:31:45 +00:00
Daniel Dunbar
f21e4e9326 MC/AsmParser: Fix TokError() to accept a Twine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108647 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-18 18:31:42 +00:00
Daniel Dunbar
aef87e3307 MC/AsmParser: Hide the AsmParser implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108646 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-18 18:31:38 +00:00
Eli Friedman
dc1ad22d53 Start of .sleb128/.uleb128 parsing support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108612 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17 06:27:28 +00:00
Eli Friedman
21444efae0 Work-in-progress parsing for ELF .section directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108609 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17 04:29:04 +00:00
Eli Friedman
f82ccf5a0d Add support for parsing .size directives for ELF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108606 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17 03:09:18 +00:00
Daniel Dunbar
d1e3b44d6c MC/AsmParser: Lift Run() and TargetParser to base class.
Also, add constructor function for creating AsmParser instances.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108604 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-17 02:26:10 +00:00
Chris Lattner
a955853961 fix indentation and 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108460 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-15 21:19:31 +00:00
Benjamin Kramer
38e59891ee Don't pass StringRef by reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108366 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14 22:38:02 +00:00
Daniel Dunbar
5146a0970d MC/AsmParser: Move ELF specific parser to ELFAsmParser.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108196 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 21:23:32 +00:00
Daniel Dunbar
9c23d7f25e MC/AsmParser: Move Darwin specific parse to DarwinAsmParser.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108193 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 20:51:51 +00:00
Daniel Dunbar
4d5fe97c47 MC/AsmParser: Move .section parsing to Darwin specific parser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108190 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 20:42:34 +00:00
Daniel Dunbar
47f5608029 MC/AsmParser: Move special section directive parsing to Darwin specific parser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108187 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 20:23:36 +00:00
Daniel Dunbar
7a56fc224c MC/AsmParser: Add a basic ELFAsmParser extension.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108185 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 20:08:04 +00:00
Daniel Dunbar
4c7c08bfbf MC/AsmParser: Inline AsmParser::CreateSymbol into callers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108183 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 19:52:10 +00:00
Daniel Dunbar
b6c3a607ac MC/AsmParser: Move .tbss and .zerofill parsing to Darwin specific parser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108180 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 19:37:35 +00:00
Daniel Dunbar
492b7a21cb MC/AsmParser: Move .desc parsing to Darwin specific parser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108179 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 19:22:53 +00:00
Daniel Dunbar
38a4e2acb7 MC/AsmParser: Move .lsym parsing to Darwin specific parser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108176 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 19:08:25 +00:00
Daniel Dunbar
9ac66b008d MC/AsmParser: Move some misc. Darwin directive handling to DarwinAsmParser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108174 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 18:49:22 +00:00
Daniel Dunbar
e47497087b MC/AsmParser: Add a DarwinAsmParser extension.
- Currently initialization is a bit of a hack, but harmless. We need to rework
   various parts of target initialization to clean this up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108165 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 18:12:02 +00:00
Daniel Dunbar
8f34bead90 MC/AsmParser: Switch a bunch of directive parsing to use accessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108163 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 18:03:11 +00:00
Daniel Dunbar
81ea00f45d MCAsmParser: Pull some directive handling out into a helper class, and change
DirectiveMap to be based on MCAsmParserExtension.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108161 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 17:54:38 +00:00
Daniel Dunbar
eceec05c82 MC/AsmParser: Switch some directive parsing to use accessor methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108160 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 17:45:27 +00:00
Daniel Dunbar
53131982d6 MC: Add MCAsmParserExtension, a base class for all the target/object specific
classes which want to extend the basic asm parser.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108158 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 17:27:45 +00:00
Daniel Dunbar
dc4c7da5d4 MC: Move AsmParser::TokError to MCAsmParser().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108155 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 17:18:45 +00:00
Daniel Dunbar
ca90dc6d29 MC: Move getLoc() to MCAsmLexer().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108154 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 17:10:00 +00:00
Duncan Sands
3472766f9e Convert some tab stops into spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108130 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-12 08:16:59 +00:00