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

56 Commits

Author SHA1 Message Date
Rafael Espindola
837258385f Correctly initialize LineSectionSymbol. Thanks to Duncan Sands for noticing it.
llvm-svn: 151979
2012-03-03 14:24:15 +00:00
Rafael Espindola
646dff508a On ELF, create relocations to the abbreviation and line sections when producing
debug info for assembly files. We were already doing the right thing when
producing debug info for C/C++.

ELF linkers don't know dwarf, so they depend on these relocations to produce
valid dwarf output.

llvm-svn: 151655
2012-02-28 21:13:05 +00:00
Jim Grosbach
6280a1137f Better diagnostic for malformed .org assembly directive.
Provide source line number information.

llvm-svn: 149101
2012-01-27 00:37:08 +00:00
Jim Grosbach
2bc9a9f339 Tidy up.
llvm-svn: 149096
2012-01-26 23:47:45 +00:00
Jim Grosbach
f88f0b08c4 Tidy up. MCAsmBackend naming conventions.
llvm-svn: 148400
2012-01-18 18:52:16 +00:00
Rafael Espindola
7618aa1c64 Don't print an unused label before .cfi_endproc.
llvm-svn: 147763
2012-01-09 00:17:29 +00:00
Rafael Espindola
19a13321f8 Don't print a label before .cfi_startproc when we don't need to. This makes
the produce assembly when using CFI just a bit more readable.

llvm-svn: 147743
2012-01-07 22:42:19 +00:00
Rafael Espindola
2d545fa143 Split Finish into Finish and FinishImpl to have a common place to do end of
file error checking. Use that to error on an unfinished cfi_startproc.

The error is not nice, but is already better than a segmentation fault.

llvm-svn: 147717
2012-01-07 03:13:18 +00:00
Kevin Enderby
63cf89d532 The second part of support for generating dwarf for assembly source files. This
generates the dwarf Compile Unit DIE and a dwarf subprogram DIE for each
non-temporary label.

The next part will be to get the clang driver to enable this when assembling
a .s file.  rdar://9275556

llvm-svn: 146262
2011-12-09 18:09:40 +00:00
Akira Hatanaka
9071684dcf This patch addresses gp relative fixups/relocations for jump tables.
llvm-svn: 145112
2011-11-23 22:18:04 +00:00
Evan Cheng
2a0a4e1a73 Rename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to createMCAsmBackend.
llvm-svn: 136010
2011-07-25 23:24:55 +00:00
Evan Cheng
13d54fc7c9 Move TargetAsmParser.h TargetAsmBackend.h and TargetAsmLexer.h to MC where they belong.
llvm-svn: 135833
2011-07-23 00:45:41 +00:00
Evan Cheng
3d2be55d6c Unfortunately several files in MC are badly violating layering rule by using
TargetAsmInfo, which in turn pulls in TargetRegisterInfo, etc. :-( There are
other cases of violations, but this is probably the worst.

This patch is but one small step towards fixing this. 500 more steps to go. :-(

llvm-svn: 135131
2011-07-14 05:43:07 +00:00
Rafael Espindola
c03bb178a0 Misc code refactorings:
* Remove unnecessary arguments now that ForceExpAbs is a method.
* Use ForceExpAbs in EmitAbsValue.

llvm-svn: 131683
2011-05-19 21:40:34 +00:00
Rafael Espindola
2f2c3bf31f 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.

llvm-svn: 130634
2011-05-01 03:50:49 +00:00
Rafael Espindola
17e6a392af Implement MCAsmStreamer::EmitDwarfAdvanceFrameAddr.
llvm-svn: 130585
2011-04-30 03:21:04 +00:00
Rafael Espindola
133c684456 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.

llvm-svn: 130305
2011-04-27 15:21:19 +00:00
Rafael Espindola
c115df57cc No relocation produces a SLEB or ULEB, make sure they are handled in MC.
llvm-svn: 130181
2011-04-26 02:17:58 +00:00
Rafael Espindola
856ed14418 Remove unused argument.
llvm-svn: 129955
2011-04-21 23:39:26 +00:00
Eli Friedman
9009047cff malloc elimination: it's a bad idea to use raw_svector_ostream on a
small heap-allocated SmallString because it unconditionally forces a malloc.

(Revised version of r129688, with the necessary flush() call.)

llvm-svn: 129716
2011-04-18 20:54:46 +00:00
Eli Friedman
9654b5718d Revert r129688; it's breaking buildbots.
llvm-svn: 129689
2011-04-18 05:54:54 +00:00
Eli Friedman
fe593ec2d0 More malloc elimination: it's a bad idea to use raw_svector_ostream on a
small heap-allocated SmallString because it unconditionally forces a malloc.

llvm-svn: 129688
2011-04-18 05:38:58 +00:00
Jan Sjödin
6791bc64a2 Add constructors to MCElfStreamer and MCObjectStreamer to take an extra MCAssembler * argument.
llvm-svn: 127343
2011-03-09 17:33:05 +00:00
Rafael Espindola
5fd4a261e7 Add some limited support for labels in org directives. Hopefully enough to fix
PR9245.

llvm-svn: 126091
2011-02-20 20:20:07 +00:00
Rafael Espindola
b59fdeb3de Add support for pushsection and popsection. Patch by Joerg Sonnenberger.
llvm-svn: 125629
2011-02-16 01:08:29 +00:00
Evan Cheng
cc474b4864 Model :upper16: and :lower16: as ARM specific MCTargetExpr. This is a step
in the right direction. It eliminated some hacks and will unblock codegen
work. But it's far from being done. It doesn't reject illegal expressions,
e.g. (FOO - :lower16:BAR). It also doesn't work in Thumb2 mode at all.

llvm-svn: 123369
2011-01-13 07:58:56 +00:00
Rafael Espindola
c97d642bf7 Relax address updates in the eh_frame section.
llvm-svn: 122591
2010-12-28 05:39:27 +00:00
Rafael Espindola
3897d5e658 Assert that the AddrDelta expression is really constant and wrap it in a set
if we have a lame assembler.

llvm-svn: 122446
2010-12-22 22:04:28 +00:00
Rafael Espindola
f3aeaaa3f4 Revert 122011, 122012, 122013, 122023 adding back an important optimization.
I added a note, but suggestions on how to add a test are really welcome.

llvm-svn: 122138
2010-12-18 03:57:21 +00:00
Daniel Dunbar
54b3f3e5db MC/Assembler: Make the MCObjectWriter available through the lifetime of the
assembler.

llvm-svn: 122031
2010-12-17 02:45:41 +00:00
Daniel Dunbar
565c90b316 MC: Remove another dead MCAssembler argument, and update clients.
llvm-svn: 122013
2010-12-17 01:07:35 +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
8dad37785c Sorry for such a large commit. The summary is that only MachO cares about the
actuall addresses in a .o file, so it is better to let the MachO writer compute
it.

This is good for two reasons. First, areas that shouldn't care about
addresses now don't have access to it. Second, the layout of each section
is independent. I should use this in a subsequent commit to speed it up.

Most of the patch is just removing the section address computation. The two
interesting parts are the change on how we handle padding in the end
of sections and how MachO can get the address of a-b when a and b are in
different sections.

Since now the expression evaluation normally doesn't know the section address,
it will think that a-b needs relocation and let the MachO writer know. Once
it has computed the section addresses, it calls back the expression evaluation
with the section addresses to resolve these expressions.

The remaining problem is the handling of padding. Currently it will create
a special alignment fragment at the end. Since that fragment doesn't update
the alignment of the section, it needs the real address to be computed.

Since now the layout will not compute a-b with a and b in different sections,
the only effect that the special alignment fragment has is update the
address size of the section. This can also be done by the MachO writer.

llvm-svn: 121076
2010-12-07 00:27:36 +00:00
Rafael Espindola
82d3d8dc2c Use references to simplify the code a bit.
llvm-svn: 121050
2010-12-06 22:30:54 +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
ec560cdae3 Make EmitIntValue more efficient and more like what we do for leb128. The
difference is much smaller (about 0.3s) but significant.

llvm-svn: 120787
2010-12-03 02:54:21 +00:00
Rafael Espindola
dc103b1755 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.

llvm-svn: 120774
2010-12-03 01:19:49 +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
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
2dabc56340 Move EmitValueToOffset to the ObjectStreamer.
llvm-svn: 120691
2010-12-02 05:59:38 +00:00
Rafael Espindola
3bc5d20c38 Add EmitInstToFragment to the generic object streamer.
llvm-svn: 120690
2010-12-02 05:44:06 +00:00
Rafael Espindola
4ba6ca3725 Move EmitValue to MCObjectStreamer.
llvm-svn: 120269
2010-11-28 23:08:47 +00:00
Rafael Espindola
53ee16b7b6 Fixed verson of r120245.
Factor some duplicated code into MCObjectStreamer::EmitLabel.

llvm-svn: 120248
2010-11-28 17:18:55 +00:00
Rafael Espindola
cb1e3ad6bc Revert previous patch while I debug the darwin bootstrap failure.
llvm-svn: 120246
2010-11-28 16:22:59 +00:00
Rafael Espindola
975a3f8fa7 Factor some duplicated code into MCObjectStreamer::EmitLabel.
llvm-svn: 120245
2010-11-28 15:54:36 +00:00
Rafael Espindola
1db6a21aff Add support for expressions in .sleb/.uleb directives.
llvm-svn: 118023
2010-11-02 17:22:24 +00:00
Rafael Espindola
5571ce5ed4 Move EmitInstruction to MCObjectStreamer so that ELF and MachO can share it.
llvm-svn: 117925
2010-11-01 16:27:31 +00:00
Rafael Espindola
7a38cb0144 Implement .weakref.
llvm-svn: 117911
2010-11-01 14:28:48 +00:00