Commit Graph

149 Commits

Author SHA1 Message Date
Rafael Espindola
e13a0ff8ac Parse and record the gnu_unique_object type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118980 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13 04:51:02 +00:00
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