Commit Graph

57 Commits

Author SHA1 Message Date
Rafael Espindola
40a7dbbeff Add support for producing .deubg_frame sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131121 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-10 03:54:12 +00:00
Rafael Espindola
c25dad8750 Factor some code into a new EmitFrames method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131119 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-10 03:14:15 +00:00
Rafael Espindola
f9efd83166 Parsing and plumbing for .cfi_sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131117 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-10 01:10:18 +00:00
Rafael Espindola
debd7e4e8b Simplify the handling of pcrel relocations on ELF. Now we do the right thing
for all symbol differences and can drop the old EmitPCRelSymbolValue
method.

This also make getExprForFDESymbol on ELF equal to the one on MachO, and it
can be made non-virtual.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130634 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-01 03:50:49 +00:00
Rafael Espindola
a37bd1d02c Implement MCAsmStreamer::EmitDwarfAdvanceFrameAddr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130585 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 03:21:04 +00:00
Rafael Espindola
8bca4106df Mark the EH symbol global or weak if the corresponding function is.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130397 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 12:50:37 +00:00
Rafael Espindola
ed708f9c1f Factor a bit of code to MCStreamer::EmitLabel. Keep track of the last
non private symbol. This will be use for handling

foo:
  .cfi_startproc
  ...

On OS X where we have to create a foo.eh symbol.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130305 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 15:21:19 +00:00
Devang Patel
3f3bf9387b Reduce clutter in asm output. Do not emit source location as comment for each instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129715 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-18 20:26:49 +00:00
Rafael Espindola
066c2f495a Be consistent about being virtual and returning void in the cfi methods.
Implement the ones that were missing in the asm streamer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129413 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-12 23:59:07 +00:00
Rafael Espindola
5d7dcd3335 Remove LastOffset from the asm parser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129378 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-12 18:53:30 +00:00
Rafael Espindola
25f492e778 Fix the case of a .cfi_rel_offset before any .cfi_def_cfa_offset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129362 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-12 16:12:03 +00:00
Rafael Espindola
c57543964d Implement .cfi_same_value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129361 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-12 15:31:05 +00:00
Anton Korobeynikov
57caad7a33 Preliminary support for ARM frame save directives emission via MI flags.
This is just very first approximation how the stuff should be done
(e.g. ARM-only for now). More to follow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127101 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-05 18:43:32 +00:00
Anton Korobeynikov
b5e16af9ea Some first rudimentary support for ARM EHABI: print exception table in "text mode".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127099 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-05 18:43:15 +00:00
Joerg Sonnenberger
7d0805dcb8 Use a vector of pairs to implement the section stack, not two
independent vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126099 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 01:07:42 +00:00
Rafael Espindola
7768a9dce1 Add support for pushsection and popsection. Patch by Joerg Sonnenberger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125629 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-16 01:08:29 +00:00
Rafael Espindola
9c54c14cad Remove second return.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122616 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-29 02:42:33 +00:00
Rafael Espindola
b40a71fda1 Implement cfi_def_cfa. Also don't convert to dwarf reg numbers twice. Looks
like 6 is a fixed point of that and so the previous tests were OK :-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122614 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-29 01:42:56 +00:00
Rafael Espindola
b4601bd2ff Implement cfi_def_cfa_register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122612 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-29 00:26:06 +00:00
Rafael Espindola
b790a17efb Initial .cfi_offset implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122611 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-29 00:09:59 +00:00
Rafael Espindola
fe024d0a62 Implement .cfi_remember_state and .cfi_restore_state.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122602 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-28 18:36:23 +00:00
Rafael Espindola
5bba084253 Start adding basic support for emitting the call frame instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122590 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-28 04:15:37 +00:00
Rafael Espindola
bdc3167c08 Add support for .cfi_lsda.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122584 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-27 15:56:22 +00:00
Rafael Espindola
3a83c40ab6 Add support for the same encodings of the personality function that gnu as
supports.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122577 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-27 00:36:05 +00:00
Rafael Espindola
90a5a0cd7c Rename NeedsSetToChangeDiffSize to HasAggressiveSymbolFolding which is a much
better name and matches what is used in the MachO writer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122443 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 21:51:29 +00:00
Matt Beaumont-Gay
818b5f5dd7 Better fix for opt build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121910 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-15 23:14:45 +00:00
Matt Beaumont-Gay
e194b26ffd Fix opt -Werror build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121904 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-15 22:21:20 +00:00
Rafael Espindola
b35d56c2fe Generalize an assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121851 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-15 07:12:24 +00:00
Rafael Espindola
89b9372605 Fixed version of 121434 with no new memory leaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121471 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-10 07:39:47 +00:00
Rafael Espindola
f7fd4aa261 Revert my previous patch to make the valgrind bots happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121461 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-10 04:01:09 +00:00
Rafael Espindola
1c952b9cc9 Initial support for the cfi directives. This is just enough to get
f:
        .cfi_startproc
        nop
        .cfi_endproc

assembled (on ELF).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121434 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 23:48:29 +00:00
Devang Patel
dea914bed9 Add assert to catch an attempt to emit .byte 256
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121402 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 19:26:21 +00:00
Rafael Espindola
0bbe0b440e Second try at making direct object emission produce the same results
as llc + llvm-mc. This time ELF is not changed and I tested that llvm-gcc
bootstrap on darwin10 using darwin9's assembler and linker.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121006 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 17:27:56 +00:00
Rafael Espindola
6d86492f5e Revert previous two patches while I try to find out how to make both
linux and darwin assemblers happy :-(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121004 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 15:35:15 +00:00
Rafael Espindola
2303c9dd69 Add an EmitAbsValue helper method and use it in cases where we want to be sure
that no relocations are used (on MochO).
Fixes llc producing different output from llc + llvm-mc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121000 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-06 14:53:14 +00:00
Rafael Espindola
2df042cb32 Make EmitIntValue more efficient and more like what we do for leb128. The
difference is much smaller (about 0.3s) but significant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120787 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 02:54:21 +00:00
Rafael Espindola
660b5fc4d0 Do with uleb the same trick we now do with dwarf line/address advances. This
avoids creating leb128 fragments and speeds up the test in PR8711 to 33s.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120774 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 01:19:49 +00:00
Rafael Espindola
32a006e606 Try to resolve symbol differences early, and if successful create a plain
data fragment. This reduces the time to assemble the test in 8711 from 60s to
54s.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120767 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-03 00:55:40 +00:00
Rafael Espindola
3e03211625 Avoid code duplication in the many unsupported EmitGPRel32Value implementations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120243 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 15:09:24 +00:00
Rafael Espindola
cdfecc8759 Add basic CFI methods to the streamer interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119972 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-22 14:27:24 +00:00
Rafael Espindola
af6b580875 Add .loc methods to the streamer.
Next: Add support for the !HasDotLocAndDotFile case to the MCAsmStreamer
and then switch codegen to use it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119384 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 21:20:32 +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
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
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
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
Michael J. Spencer
e5c8d95f1a _[A-Z] identifiers are reserved for the implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108682 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-19 06:26:19 +00:00
Matt Fleming
ab3b3651ad Grammar fix. This is a test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104264 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-20 19:45:09 +00:00
Chris Lattner
58bc4dd4a9 add a twine form of MCStreamer::EmitRawText, and mc'ize
a few more things in AsmPrinter.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100294 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 22:12:35 +00:00
Chris Lattner
3580dea910 add <cstdlib> header for abort() on linux builders.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100290 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 21:48:59 +00:00
Chris Lattner
91bead7905 add a new EmitInlineAsm function to asmprinter to handle inline asm.
If we have an MCAsmStreamer, we continue to emit asm textually, 
otherwise we (currently) emit an error to errs and ignore it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100289 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 21:35:55 +00:00