Commit Graph

68 Commits

Author SHA1 Message Date
Rafael Espindola
e3a0e987f3 On MachO, unlike ELF, there should be no relocation to produce the CIE pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131149 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-10 20:59:42 +00:00
Rafael Espindola
12f197b3bc The EH symbols are only needed in eh_frame, not debug_frame.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131146 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-10 19:51:53 +00:00
Rafael Espindola
0d450dc659 In a debug_frame the cfi offset is to the start of the debug_frame section!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131129 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-10 15:20:23 +00:00
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
774466a8a5 Small cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131120 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-10 03:26:21 +00:00
Rafael Espindola
9f270dadd4 Remove unused argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131118 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-10 03:01:39 +00:00
NAKAMURA Takumi
8a1f2b2bcf Eliminate an unused line to fix a warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131078 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-08 23:19:04 +00:00
Rafael Espindola
4eafe10945 Don't force relaxation of AdvanceLoc instructions on OS X. gdb is happy with
the smaller encoding and this cuts 270336 bytes from a release version of
clang and 1246272 bytes from a debug build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131067 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-08 14:35:21 +00:00
Rafael Espindola
be91117c4d Switch Darwin to the generic CIE/FDE printer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131031 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-06 22:29:04 +00:00
Daniel Dunbar
b47426b4de MCDwarf: Don't save Twine to local variable, this is almost never safe to do
(and should thus never be done).
 - Should fix a crash on win32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130793 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 21:33:37 +00:00
Rafael Espindola
5426a9ee37 GCC uses a different encoding of pointers in the FDE when using
-fno-dwarf2-cfi-asm. Implement the same behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130637 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-01 04:49:54 +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
1f6c87554a Avoid some uses of .uleb128. This is a small speedup and more importantly
lets this code be used when producing assembly code for old assemblers without
uleb support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130544 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 21:50:57 +00:00
Rafael Espindola
4892dff07e Last bit by bit compatibility patch to MCDwarf.cpp: If a FDE with no LSDA is
assigned to a CIE that requires one, just output a 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130472 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 03:06:29 +00:00
Rafael Espindola
9099813bd5 Add an alternative implementation of CIE and FDE emission that outputs them
in the same order as the one in CodeGen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130471 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 02:42:28 +00:00
Rafael Espindola
a0057ca13f Add the getExprForFDESymbol method that responsible for computing the
expressions used in the FDE to refer to symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130437 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 21:04:39 +00:00
Rafael Espindola
bfa27cc5d7 Add a getExprForPersonalitySymbol method to MCAsmInfo. Use it when
converting the symbol passed to .cfi_personality into bytes is the file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130400 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 16:09:09 +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
235b830328 Add a small temporary hack for producing identical eh_frame sections on OS X.
This removes one of the main advantages of moving eh_frame to MC, but
makes the transition a lot easier to debug (run md5).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130379 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 04:04:14 +00:00
Rafael Espindola
514cecc72b Produce the EH_frame# symbols if needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130378 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 03:26:11 +00:00
Rafael Espindola
a8cfb87fa2 Forward isFunctionEHFrameSymbolPrivate. If it is false, produce the foo.eh
symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130375 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 02:46:42 +00:00
Rafael Espindola
9266cc400e Force some values to be absolute and align based on the FDE pointers size. A small
step towards using .cfi_* on OS X.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130273 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-27 01:43:49 +00:00
Chandler Carruth
add2944559 Delete the other unused variable in this function. Sorry I missed this
the first time through.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129969 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 01:29:18 +00:00
Chandler Carruth
32bd250d30 Remove an unused variable from a function. This is a likely cut-paste-o.
Silences GCC warning.

I wonder why Clang doesn't warn on this...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129968 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 01:21:06 +00:00
Rafael Espindola
abf9af60ad Compute the size of the FDE encoding instead of hard coding it. Update
X8664_ELFTargetObjectFile::getFDEEncoding to match reality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129959 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-22 00:08:43 +00:00
Rafael Espindola
e8cfbd843d Remove unused argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129955 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 23:39:26 +00:00
Rafael Espindola
eccbad78e0 Don't pass address spaces to EmitULEB128IntValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129953 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 23:26:40 +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
16c29b5f28 Rename TargetFrameInfo into TargetFrameLowering. Also, put couple of FIXMEs and fixes here and there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123170 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 12:39:04 +00:00
Benjamin Kramer
1928236514 Make a bunch of symbols internal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122642 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-30 22:34:44 +00:00
Rafael Espindola
caf1158b0f Correctly encode pcrel|indirect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122624 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-29 04:31:26 +00:00
Rafael Espindola
a7e450574c Fix bug when trying to output uint16_t or uint32_t.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122615 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-29 02:30:49 +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
3b78cdc57a Don't produce a "DW_CFA_advance_loc 0".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122609 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-28 23:38:03 +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
Duncan Sands
849ecb1431 Fix warning about size potentially being used uninitialized
when doing a release build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122594 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-28 10:02:42 +00:00
Rafael Espindola
245a1e2041 Relax address updates in the eh_frame section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122591 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-28 05:39:27 +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
390b693dac Fix .cfi_personality on 32 bit systems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122570 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-26 22:47:37 +00:00
Rafael Espindola
d7c8ccae8e Add basic support for .cfi_personality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122566 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-26 20:20:31 +00:00
Rafael Espindola
dfe125cc9c "Fix" FDE alignment to match what gas does.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122006 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17 00:28:02 +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
Rafael Espindola
5fad7a99c0 Use const references.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121426 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09 23:08:35 +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