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

230 Commits

Author SHA1 Message Date
Rafael Espindola
c97d642bf7 Relax address updates in the eh_frame section.
llvm-svn: 122591
2010-12-28 05:39:27 +00:00
Rafael Espindola
0552cb0638 Start adding basic support for emitting the call frame instructions.
llvm-svn: 122590
2010-12-28 04:15:37 +00:00
Rafael Espindola
12c30aed07 Add support for .cfi_lsda.
llvm-svn: 122584
2010-12-27 15:56:22 +00:00
Rafael Espindola
e7e67fce10 Add support for the same encodings of the personality function that gnu as
supports.

llvm-svn: 122577
2010-12-27 00:36:05 +00:00
Rafael Espindola
e9e6794917 Fix .cfi_personality on 32 bit systems.
llvm-svn: 122570
2010-12-26 22:47:37 +00:00
Rafael Espindola
99f1527316 Add basic support for .cfi_personality.
llvm-svn: 122566
2010-12-26 20:20:31 +00:00
Rafael Espindola
bd13ceed72 "Fix" FDE alignment to match what gas does.
llvm-svn: 122006
2010-12-17 00:28:02 +00:00
Rafael Espindola
0e665e502d Fixed version of 121434 with no new memory leaks.
llvm-svn: 121471
2010-12-10 07:39:47 +00:00
Rafael Espindola
011e168728 Revert my previous patch to make the valgrind bots happy.
llvm-svn: 121461
2010-12-10 04:01:09 +00:00
Rafael Espindola
03ad1e8f1f Initial support for the cfi directives. This is just enough to get
f:
        .cfi_startproc
        nop
        .cfi_endproc

assembled (on ELF).

llvm-svn: 121434
2010-12-09 23:48:29 +00:00
Rafael Espindola
ebe4cab1db Use const references.
llvm-svn: 121426
2010-12-09 23:08:35 +00:00
Rafael Espindola
3e954d16f4 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.

llvm-svn: 121006
2010-12-06 17:27:56 +00:00
Rafael Espindola
4ec917db9b Revert previous two patches while I try to find out how to make both
linux and darwin assemblers happy :-(

llvm-svn: 121004
2010-12-06 15:35:15 +00:00
Rafael Espindola
3dc2b4cba7 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.

llvm-svn: 121000
2010-12-06 14:53:14 +00:00
Rafael Espindola
1bf8d261f1 Remember the contents of leb and dwarfline fragments when relaxing. This avoids
having to evaluate the expression again when writing.

llvm-svn: 120920
2010-12-04 21:58:52 +00:00
Rafael Espindola
9215947c83 There are two reasons why we might want to use
foo = a - b
.long foo
instead of just
.long a - b

First, on darwin9 64 bits the assembler produces the wrong result. Second,
if "a" is the end of the section all darwin assemblers (9, 10 and mc) will not
consider a - b to be a constant but will if the dummy foo is created.

Split how we handle these cases. The first one is something MC should take care
of. The second one has to be handled by the caller.

llvm-svn: 120889
2010-12-04 03:21:47 +00:00
Rafael Espindola
50b6170457 Next step: Only pad debug_line when the target is darwin. Add a FIXME to avoid
doing that if the target is darwin10 or newer.

This fixes
*) Direct object emission was producing objects without the workaround on
   darwin9.
*) Assembly printing was producing objects with the workaround on linux.

llvm-svn: 120866
2010-12-04 00:31:13 +00:00
Rafael Espindola
4145acdc3b First step in fixing MC. Make it clear that we are avoiding a bug in the
darwin9 linker, what is needed to avoid it and where to get more information.

Also make the workaround simpler. Just the regular end_sequence we normally
create is more than 4 bytes.

Tested by building cctools and ld64 from darwin9 on a darwin10 system and using
those. I checked that I was able to reproduce the bootstrap failure when
the the workaround was disabled.

llvm-svn: 120854
2010-12-03 23:36:59 +00:00
Rafael Espindola
3e119b0bb4 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.

llvm-svn: 120767
2010-12-03 00:55:40 +00:00
Devang Patel
77a1457f1a It may not be an option to skip .debug_line if there are file reference in already emitted debug info. So, for now, emit dummy line table entry to make older linker and assemblers happy. This is not a new behavior, original AsmPrinter emitted similar line table entries.
llvm-svn: 120760
2010-12-03 00:10:48 +00:00
Devang Patel
822facd787 Use set directive for StartMinusEndExpr.
This is a fix for llvm-gcc-i386-darwin9 buildbot failure.

llvm-svn: 120742
2010-12-02 21:32:30 +00:00
Rafael Espindola
5f582e980e Remove some #includes.
llvm-svn: 119967
2010-11-22 11:53:17 +00:00
Rafael Espindola
7c6bd9e0f9 Add a MCLineSectionOrder vector so that we produce the line tables in a
deterministic order.

llvm-svn: 119795
2010-11-19 07:41:23 +00:00
Rafael Espindola
b33e5e07e1 Change some methods in MCDwarf.cpp to be able to handle an arbitrary
MCStreamer instead of just MCObjectStreamer. Address changes cannot
be as efficient as we have to use DW_LNE_set_addres, but at least
most of the logic is shared.

This will be used so that, with CodeGen still using EmitDwarfLocDirective,
llvm-gcc is able to produce debug_line sections without needing an
assembler that supports .loc.

llvm-svn: 119777
2010-11-19 02:26:16 +00:00
Rafael Espindola
e296fd654b Fix the encoding of negative line deltas.
llvm-svn: 118962
2010-11-13 01:06:27 +00:00
Rafael Espindola
77cad43f26 Remove what looks like dead code in the production of debug lines.
We only produce debug line information if we have seen a line directive, so
this code is dead. Also, if we want to be bug by bug compatible with
gas and sometimes produce "empty" .debug_line sections, this will
match the content produced by gas.

llvm-svn: 118914
2010-11-12 18:41:26 +00:00
Rafael Espindola
1db6a21aff Add support for expressions in .sleb/.uleb directives.
llvm-svn: 118023
2010-11-02 17:22:24 +00:00
Kevin Enderby
01b93a4319 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.

llvm-svn: 115551
2010-10-04 20:17:24 +00:00
Kevin Enderby
767a9365f0 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.

llvm-svn: 115157
2010-09-30 16:52:03 +00:00
Kevin Enderby
3f202e65e8 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.

llvm-svn: 109651
2010-07-28 20:55:35 +00:00