Commit Graph

1387 Commits

Author SHA1 Message Date
Jim Grosbach
ba8297ec08 Refactor MachO relocation generaration into the Target directories.
Move the target-specific RecordRelocation logic out of the generic MC
MachObjectWriter and into the target-specific object writers. This allows
nuking quite a bit of target knowledge from the supposedly target-independent
bits in lib/MC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133844 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 23:44:37 +00:00
Jim Grosbach
32e7abd080 tidy up whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133815 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 19:43:27 +00:00
Jim Grosbach
535e58b910 Fixup info for Thumb2 unconditional branch.
rdar://9667872

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133808 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-24 18:48:32 +00:00
Jim Grosbach
0edb05b9e4 Tidy up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133770 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 22:29:00 +00:00
Jay Foad
95c3e48f95 Reinstate r133513 (reverted in r133700) with an additional fix for a
-Wshorten-64-to-32 warning in Instructions.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133708 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 09:09:15 +00:00
Bill Wendling
5b46e8e6b8 Use a reference. Don't make a useless copy of the vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133707 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 07:55:41 +00:00
Bill Wendling
a8c9e6a943 Formatting changes. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133706 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 07:44:54 +00:00
Eric Christopher
e59fbc04ad Revert r133513:
"Reinstate r133435 and r133449 (reverted in r133499) now that the clang
self-hosted build failure has been fixed (r133512)."

Due to some additional warnings.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133700 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 06:24:52 +00:00
Bill Wendling
4c0c446d74 Use the presence of the __compact_unwind section to indicate that a target
supports compact unwind info instead of having a separate flag indicating this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133685 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 05:13:28 +00:00
Bill Wendling
e3cd13f0e2 Some skeleton code to emit the compact unwind. If the information is unable to
be emitted in a compact way, we then default to emitting a CIE and FDE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133676 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 01:06:23 +00:00
Bill Wendling
3f2ea825bd 80-column violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133668 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-23 00:09:43 +00:00
Bill Wendling
bbdffa9ab0 Move class methods out-of-line. This reduces the indentation, and is more in
line with LLVM's general coding style.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133645 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-22 21:07:27 +00:00
Bill Wendling
b8c6ed3b62 Remove the subclassing. This will be moved to the ASM printer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133473 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-20 22:12:24 +00:00
Benjamin Kramer
dcf0e0c44b Directly print to a raw_ostream instead of printing to a buffer first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133352 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-18 14:42:47 +00:00
Hans Wennborg
5cc6491f50 MC: Allow .common as alias for .comm assembler directive. PR10116.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133349 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-18 13:51:54 +00:00
Bill Wendling
edb15d6872 * Override the "EmitBytes" function, since it can sneak values in that way.
* Make this used only if CFI is used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133319 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-18 00:19:35 +00:00
Bill Wendling
ccfae86da1 Remove false assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133314 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17 23:42:01 +00:00
Bill Wendling
50cb96931a Disable for another investigation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133299 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17 21:44:15 +00:00
Bill Wendling
30507ef3c3 Support only DwarfCFI or SjLj exception handling in LSDA decoder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133297 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17 21:31:43 +00:00
Bill Wendling
5ba89837d7 SjLj exception handling LSDA decoding support wasn't represented correctly. Use
the correct values, etc. In particular, the exception handling type is SjLj, not
ARM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133296 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17 21:29:06 +00:00
Bill Wendling
2fb86a8fe6 Disable to investigate ARM failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133293 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17 21:09:50 +00:00
Bill Wendling
e266ce6c6e Use the verbose asm flag instead of a new flag for decoding the LSDA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133292 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17 20:55:01 +00:00
Bill Wendling
916a94b870 Add an option that allows one to "decode" the LSDA.
The LSDA is a bit difficult for the non-initiated to read. Even with comments,
it's not always clear what's going on. This wraps the ASM streamer in a class
that retains the LSDA and then emits a human-readable description of what's
going on in it.

So instead of having to make sense of:

Lexception1:
        .byte   255
        .byte   155
        .byte   168
        .space  1
        .byte   3
        .byte   26
Lset0 = Ltmp7-Leh_func_begin1
      .long     Lset0
Lset1 = Ltmp812-Ltmp7
      .long     Lset1
Lset2 = Ltmp913-Leh_func_begin1
      .long     Lset2
      .byte     3
Lset3 = Ltmp812-Leh_func_begin1
      .long     Lset3
Lset4 = Leh_func_end1-Ltmp812
      .long     Lset4
      .long     0
      .byte     0
      .byte     1
      .byte     0
      .byte     2
      .byte     125
      .long     __ZTIi@GOTPCREL+4
      .long     __ZTIPKc@GOTPCREL+4

you can read this instead:

## Exception Handling Table: Lexception1
##  @LPStart Encoding: omit
##    @TType Encoding: indirect pcrel sdata4
##        @TType Base: 40 bytes
## @CallSite Encoding: udata4
## @Action Table Size: 26 bytes

## Action 1:
##   A throw between Ltmp7 and Ltmp812 jumps to Ltmp913 on an exception.
##     For type(s):  __ZTIi@GOTPCREL+4 __ZTIPKc@GOTPCREL+4
## Action 2:
##   A throw between Ltmp812 and Leh_func_end1 does not have a landing pad.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133286 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17 20:35:21 +00:00
Benjamin Kramer
738f05aa90 Remove a useless copy of MCELFStreamer. Patch by Logan Chien!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133272 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17 18:05:30 +00:00
Jim Grosbach
e82b8eeaa2 Diagnostic for undefined assembler local symbols.
Re-apply 133010, with fixes for inline assembler.

Original commit message:
"When an assembler local symbol is used but not defined in a module, a
Darwin assembler wants to issue a diagnostic to that effect."

Added fix to only perform the check when finalizing, as otherwise we're not
done and undefined symbols may simply not have been encountered yet.

Passes "make check" and a self-host check on Darwin.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133071 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-15 18:33:28 +00:00
Jim Grosbach
6c3044db28 Revert 133010. Self-hosted buildbot unhappy.
Apparently llvm itself generates undefined assembler local labels, causing
self-hosting problems with this patch. Reverting until that's sorted out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133013 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-14 21:51:20 +00:00
Jim Grosbach
c35dd25ab8 Diagnostic for undefined assembler local symbols.
When an assembler local symbol is used but not defined in a module, a
Darwin assembler wants to issue a diagnostic to that effect.

rdar://9559714


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133010 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-14 21:13:25 +00:00
Roman Divacky
a1000742d2 Fix emission of PPC64 assembler on non-darwin platforms by splitting
VK_PPC_{HA,LO}16 into darwin and gas variants.

Darwin wants {ha,lo}16(symbol) while gnu as wants symbol@{ha,l}.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132802 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-09 20:25:38 +00:00
Jason W Kim
bebd44a95a Remove an uneeded switch - Turns out reloc results are identical w/o the switch. (face+palm)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132790 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-09 19:13:45 +00:00
Roman Divacky
65891533a3 Make EmitIntValue() work properly on big-endian targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132715 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-07 17:31:02 +00:00
Rafael Espindola
6536644713 Basic support for macros with explicit arguments.
We still don't handle

* default values
* :req
* :vararg
* \()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132656 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-05 02:43:45 +00:00
Rafael Espindola
378e0ecf24 Produce an undefined reference to _GLOBAL_OFFSET_TABLE_ if we have a
VK_GOTOFF reloc. This matches as' behavior, but it is not clear why the linker
might need this, so I added a FIXME.

I could test this by duplicating test/MC/ELF/got.s, but it doesn't look
worthwhile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132655 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-05 01:20:06 +00:00
Nick Lewycky
e0b87032f5 Add support for @GOTPTOFF in i386 mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132643 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-04 17:38:07 +00:00
Jim Grosbach
6f888a80d5 .cfi directive register parsing flexibility.
Parsing a register name/number for .cfi directives can't assume that a
register name starts with a '%' token. Be more flexible and check for a
register number instead. Still unlikely to be perfect, but it allows us
to parse both plain identifiers as register names and integers as register
numbers, which is what we're wanting to support at this point.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132466 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-02 17:14:04 +00:00
Rafael Espindola
cde4ce411b Don't hardcode the %reg format in the streamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132451 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-02 02:34:55 +00:00
Joerg Sonnenberger
dd137903e4 Add new -d option to tblgen. It writes a make(1)-style dependency file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132395 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-01 13:10:15 +00:00
Rafael Espindola
6e032942cf Use the dwarf->llvm mapping to print register names in the cfi
directives.

Fixes PR9826.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132317 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-30 20:20:15 +00:00
Charles Davis
7b06b7357a Add a parameter to the Win64 EH section getters to get a section with a
suffix (e.g. .xdata$myfunc). The suffix part isn't implemented yet, but
I'll get to it in the next patch.

Fix up all callers of the affected functions. Make them pass said suffix to
the function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132205 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 19:09:24 +00:00
Charles Davis
07cbe23173 Assorted fixes for Win64 EH unwind info emission:
- Flip order of bitfields. This gets our output matching GAS.
- Handle case where the end of the prolog wasn't specified.
- If the resulting unwind info struct is less than 8 bytes, pad to 8 bytes.

Add a test for the latter two.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132188 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 15:10:25 +00:00
Charles Davis
c4cbf9b6aa Start keeping track of where the various unwind instructions are in the prolog.
Use them to calculate the offset inside the prolog. Emit this value when
emitting the unwind codes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132177 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 03:25:01 +00:00
Charles Davis
ef60724ddc Add missing break statements. Align UNWIND_INFO and RUNTIME_FUNCTION structs
to 4 bytes.

I'm surprised no one caught the missing break statements.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132176 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 02:43:19 +00:00
Charles Davis
4eeb7b662b My attempt at fixing the leak reported by the valgrind buildbots. Valgrind will
still report leaks, but they're spurious now. Valgrind cannot peer into
std::vector objects--or any dynamic array, for that matter--because it doesn't
know how big the array is.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132174 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 02:01:08 +00:00
Charles Davis
c2d3022aa6 Fix inverted conditional in SaveReg and SaveXMM. Err when the frame pointer is
already defined, and err when the PushMachFrame operation isn't the first
operation (if specified at all).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132173 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-27 01:42:17 +00:00
Charles Davis
ca93138e11 Test .seh_startchained and .seh_endchained parsing.
Rework how the MCWin64EHUnwindInfo instances are stored. Fix issues with
chained unwind areas exposed by the test that were related to this.

The ChainedParent field had the wrong address, because when the chained unwind
info was added, the addresses shifted around. Now we store the pointers to the
structures, which are now allocated from the MC heap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132106 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-26 02:45:47 +00:00
Charles Davis
410ef2b263 Add tests for .seh_setframe and .seh_handlerdata parsing. Fix issues with
them.

I had to add a special SwitchSectionNoChange method to MCStreamer just for
.seh_handlerdata. If this isn't OK, please let me know, and I'll find some
other way to fix .seh_handlerdata streaming.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132084 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-25 21:43:45 +00:00
Charles Davis
575630ccb8 Add tests for .seh_savereg and .seh_savexmm parsing. Once again, fix the
buggy methods that parse these directives.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132045 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-25 04:51:25 +00:00
Charles Davis
47268164f3 Add a test for .seh_pushframe parsing. Fix the bug exposed by it (and another
one I found by inspection).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132037 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-25 04:08:15 +00:00
Charles Davis
309213279e Add a test for the .seh_handler directive. Fix problems with the parsing
method exposed by the test. While we're at it, simplify the .seh_proc
parsing method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132028 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-25 01:33:42 +00:00
Charles Davis
40de0e013a Test basic SEH directive-parsing functionality. Fix a latent bug exposed by
this test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132004 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 21:22:53 +00:00
Charles Davis
3b32d0240c Implement the rest of the SEH directive-parsing methods in the COFFAsmParser.
Add a size alignment check to the .seh_stackalloc directive parser. Add a
more descriptive error message to the .seh_handler directive parser.

Add methods to the TargetAsmInfo struct in support of all this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131992 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-24 20:06:30 +00:00
Jim Grosbach
95ae09afde Propagate error correctly in the MC Asm parser for leading '$' expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131918 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 20:36:04 +00:00
Charles Davis
16e1b3fcf6 Implement .seh_stackalloc and .seh_pushframe parsing.
I haven't implemented any of the ones that take registers yet. The problem is
that for x86-64 the streamer methods expect a native x86 register number (note:
%r8-%r15 want 8-15 instead of 0-7; same for %xmm8-%xmm15). I haven't figured
out exactly how I want to do that yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131899 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-23 16:43:09 +00:00
Charles Davis
fbc539ff37 Add methods to parse the SEH directives to the COFFAsmParser. Implement some
of them, particularly the ones that don't take arguments. Also implement
.seh_proc and .seh_handler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131866 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-22 21:12:15 +00:00
Chris Lattner
9063b55f9b switch to using a smallvector to avoid allocations for most normal size instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131837 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-22 04:53:24 +00:00
Chris Lattner
97ff42d51d tidy some things up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131836 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-22 04:52:24 +00:00
Charles Davis
38ea9eecd7 Implement emission of all Win64 exception tables. Make the COFF streamer emit
these tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131833 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-22 04:15:07 +00:00
Charles Davis
3185f5c353 Make the COFF streamer emit unwind info when processing a .seh_handlerdata
directive.

Implement emission of Win64 EH unwind info.

Pull in <cassert> in MCWin64EH.h so it can use the assert() macro.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131832 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-22 03:01:05 +00:00
Charles Davis
edeecbff0e Don't allow unaligned offsets and sizes in the Win64 EH directives.
Also, fix threshold for 'Big' register saves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131830 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-22 00:56:20 +00:00
Charles Davis
81f3830f2e Don't allow .seh_handler and .seh_handlerdata directives inside chained
unwind areas.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131795 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-21 17:36:25 +00:00
Charles Davis
321fe74b2d A handler for a function in the Win64 EH scheme can be both an unwind handler
and an exception handler. Handle that case.

Also, add an 'Emitted' member to the MCWin64EHUnwindInfo struct. It will be
needed later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131791 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-21 15:57:49 +00:00
Charles Davis
5c2256a571 Set the "LastFrameInst" field when streaming a .seh_setframe directive. This
is needed for an upcoming patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131772 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-21 00:09:04 +00:00
Jim Grosbach
958b68140e No reason not to allow defining the CFA as a reg w/ offset zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131760 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-20 21:50:09 +00:00
Jim Grosbach
ae8e829d39 Add missing leading \t when printing .cfi_def_cfa in the asmstreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131755 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-20 21:22:37 +00:00
Rafael Espindola
298c8e12ea fixes target address tBL and tBLX and sets relocation type
of tBL/tBLX to R_ARM_THM_CALL (ARM ELF 4.7.1.6)

Patch by koan-sin tan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131748 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-20 20:01:01 +00:00
Charles Davis
cde87e2377 Now that they're implemented, make the Win64 EH MCAsmStreamer methods call
super.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131743 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-20 18:19:22 +00:00
Charles Davis
d0b76d0004 "Implement" the HandlerData Win64 EH method in the base MCStreamer.
There's really nothing to implement. All this really does is swap to a
pseudo-section that later gets written to the unwind info struct. That
needs to be implemented in the object streamers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131734 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-20 16:06:22 +00:00
Rafael Espindola
78ff647e44 Looks like OS X assemblers (including MC) don't like
foo:
bar = foo
.quad bar

Avoid producing it. Fixes PR9951.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131687 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 22:05:56 +00:00
Rafael Espindola
a6f2678f08 Misc code refactorings:
* Remove unnecessary arguments now that ForceExpAbs is a method.
* Use ForceExpAbs in EmitAbsValue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131683 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 21:40:34 +00:00
Charles Davis
61558aaf4f Implement the EndProlog Win64 EH method on the base MCStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131679 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 21:24:54 +00:00
Charles Davis
c3b162857a Implement the Win64 EH prolog instruction methods on the base MCStreamer.
I had to change the API slightly to avoid overloading issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131666 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 19:35:55 +00:00
Joerg Sonnenberger
f8cd708f14 Reapply 131644 including the missing header changes:
Introduce -fatal-assembler-warnings for the obvious purpose


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131655 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 18:00:13 +00:00
Eli Friedman
8bd71a1ec1 Revert r131644; it's breaking the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131653 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 17:48:09 +00:00
Charles Davis
440596ffe5 Turns out GAS does have Win64 EH directives. (It also supports WinCE EH.) Make
ours compatible with GAS.

In retrospect, I should have emailed binutils about this earlier. Thanks to
Kai Tietz for pointing out that GAS already had SEH directives.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131652 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 17:46:39 +00:00
Joerg Sonnenberger
bae1c924ce Introduce -fatal-assembler-warnings for the obvious purpose
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131644 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 17:27:01 +00:00
Charles Davis
91d9a1c0f7 Implement the StartChained and EndChained Win64 EH methods on MCStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131629 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 04:04:13 +00:00
Charles Davis
0855bc5b97 Implement the StartProc and EndProc Win64 EH methods on the base MCStreamer.
Based largely on Rafael Espindola's work on CFI. Other methods soon to follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131623 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 02:49:00 +00:00
Charles Davis
8b3e5e5afa Remove comments as Chris requested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131590 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 22:13:51 +00:00
Cameron Zwarich
d36d26d008 Fix an obvious typo in r131572.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131579 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 21:29:07 +00:00
Charles Davis
f07090134d Add some more Win64 EH directives:
- StartChained and EndChained delimit a chained unwind area, which can contain
  additional operations to be undone if an exception occurs inside of it.
- UnwindOnly declares that this function doesn't handle any exceptions. If it
  has a handler, it's an unwind handler instead of an exception handler.
- Lsda declares the location and size of the LSDA, which in the Win64 EH
  scheme is kept inside the UNWIND_INFO struct. Windows itself ignores the
  LSDA; it's used by the Language-Specific Handler (the "Personality Function"
  from DWARF).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131572 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 20:54:10 +00:00
Charles Davis
0e30f02f44 Implement the Win64 EH directive methods for the assembly language streamer.
GAS has no such directives (not even mingw-w64 GAS has them), so I took
creative license with their names in assembly. I prefixed them all with
"w64_" to avoid namespace collisions, for example. If I discover that GAS
has taken a different approach, I'll change ours to match.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131525 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 04:58:05 +00:00
Charles Davis
9c77398d1c While thinking about how to know where the functions' boundaries are for
the purposes of the Win64 EH tables, I realized we had no way to tell where
the function ends. (MASM bounds functions with PROC and ENDP keywords.)
Add a directive to delimit the end of the function, and rename the 'frame'
directive to more accurately reflect its duality with the new directive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131522 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 04:47:22 +00:00
Charles Davis
cacdc4fc41 Add a method I forgot in the last commit. Don't worry, this one passed
self-host :).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131421 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 21:13:58 +00:00
Jason W Kim
97c07dac7f Add a FIXME reminder to remove ForceARMElfPIC switch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131411 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 16:35:21 +00:00
Rafael Espindola
6469540adf sets bit 0 of the function address of thumb function in .symtab
("T is 1 if the target symbol S has type STT_FUNC and the
symbol addresses a Thumb instruction ;it is 0 otherwise."
from "ELF for the ARM Architecture" 4.7.1.2)

Patch by Koan-Sin Tan!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131406 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-16 16:17:21 +00:00
Charles Davis
baaa320168 Fix copy-pasto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131384 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-15 17:28:27 +00:00
Charles Davis
ff96a12db6 Add stub methods to MCStreamer for emitting Win64 exception-handling
information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131382 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-15 17:20:01 +00:00
Matt Beaumont-Gay
6dcd413fbb Remove an unused variable and move a couple others inside DEBUG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131208 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-11 23:34:51 +00:00
Jason W Kim
e964d1192a Address the last bit of relocation flag related divergence betweeen
LLVM and binutils.

With this patch, there are no functional differences between the .o
produced directly from LLVM versus the .s to .o via GNU as, for relocation tags
at least, for both PIC and non-PIC modes.

Because some non-PIC reloc tags are used (legally) on PIC, so IsPCRel flag is
necessary but not sufficient to determine whether the overall codegen mode is
PIC or not. Why is this necessary? There is an incompatibility of how relocs
are emitted in the .rodata section.  Binutils PIC likes to emit certain relocs
as section relative offsets.  Non-PIC does not do this.

So I added a hidden switch on the ELFObjectwriter "-arm-elf-force-pic" which
forces the objectwriter to pretend that all relocs are for PIC mode.


Todo: Activate ForceARMElfPIC to true if -relocation-model=pic is selected
on llc.

Todo: There are probably more issues for PIC mode on ARM/MC/ELF...

Todo: Existing tests in MC/ARM/elf-reloc*.ll need to be converted over to .s 
tests as well as expanded to cover the gamut.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131205 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-11 22:53:06 +00:00
Rafael Espindola
9989ef43fa Avoid a gcc warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131161 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-10 22:28:35 +00:00
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
dc52ecf6fd Rename DwarfRequiresRelocationForStmtList to
DwarfRequiresRelocationForSectionOffset as this is not specific to StmtList.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131148 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-10 20:35:05 +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
713c4bfc36 Add CFIStartSections to the asm printer. Add an assert that at least
one of the sections is created.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131124 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-10 13:39:48 +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
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
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
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
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
Rafael Espindola
f2b0423200 Dead code elimination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130984 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-06 14:56:22 +00:00
Rafael Espindola
7af1a59382 Don't produce a __debug_frame.
I tested both gdb on a bootstrapped clang and and the gdb testsuite on OS X (snow leopard)
and both are happy using __eh_frame.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130937 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-05 18:43:39 +00:00
Rafael Espindola
597a7664e1 Producing a DW_FORM_addr for DW_AT_stmt_list is probably correct, but
it is both inefficient and unexpected by dwarfdump. Change to
a DW_FORM_data4.

While in here, change the predicate name to reflect that the position
is not really absolute (it is an offset), just that the linker needs a
relocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130846 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-04 17:44:06 +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
450a5a1207 Add r130623 back now that ELF has been fixed to work with -fno-dwarf2-cfi-asm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130658 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-01 15:44:13 +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
2b3e12d0cb Revert the previous patch while I figure out how to make llvm-gcc
less agressive about disabling cfi on linux :-(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130626 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 23:03:44 +00:00
Rafael Espindola
89fc9e8f5e Enable CFI on OS X.
Currently the output should be almost identical to the one produced by CodeGen
to make the transition easier.

The only two differences I know of are:

* Some files get an extra advance loc of size 0. This will be fixed when
relaxations are enabled.
* The optimization of declaring an EH symbol as an external variable is not
implemented. This is a subset of adding the nounwind attribute, so we if really
this at -O0 we should probably do it at the IL level.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130623 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 22:29:54 +00:00
Rafael Espindola
277abc8172 Implement MCAsmStreamer::EmitEHSymAttributes. Doing this in the asm streamer
is a bit ugly, but doing it on the base MCStreamer would be redundant
with the object streamer which does it using SD.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130611 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 16:34:57 +00:00
Rafael Espindola
97f7f4e43d Handle PrivateExtern eh symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130609 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 16:22:46 +00:00
Rafael Espindola
f1a5c7ec04 Add all the plumbing needed for MC to expand cfi to the old tables in
the final assembly. It is the same technique used when targeting
assemblers that don't support .loc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130587 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-30 03:44:37 +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
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
7f46b08082 Implement MCAsmStreamer::EmitCFIDefCfa.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130543 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 21:41:06 +00:00
Daniel Dunbar
c8497b6a25 MCAsmLayout: Add support for computing the symbol offset of variables. Not
currently used, because variables don't get reported as being "defined".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130524 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:20:20 +00:00
Daniel Dunbar
90604ab725 MC: Change variable symbols to be recognized as defined, by assigning their sections based on FindAssociatedSection().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130523 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:20:17 +00:00
Daniel Dunbar
173aa9ce32 MC/Mach-O: Update getSymbolAddress() to support evaluation of variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130522 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:13:42 +00:00
Daniel Dunbar
5ff919b324 MC/Mach-O: Allow emission of relocations for variables in some more cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130520 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:10:47 +00:00
Daniel Dunbar
08b9935b51 MC/Mach-O: Find section ordinal's by looking at the symbol, instead of assuming they are present in a fragment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130519 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:07:43 +00:00
Devang Patel
49a3ff9d17 Hoist MCLineEntry construction AsmPrinter so that anyone who derives from AsmPrinter can have line number entries.
PR 9810



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130518 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:00:54 +00:00
Daniel Dunbar
0eab5c4d85 MCExpr: Add FindAssociatedSection, which attempts to mirror the 'as' semantics
that associate sections with expressions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130517 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 18:00:03 +00:00
Daniel Dunbar
6db7fe8736 MC/AsmParser: Generalize a check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130515 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-29 17:53:11 +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
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
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
Rafael Espindola
d88cac0a6e No relocation produces a SLEB or ULEB, make sure they are handled in MC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130181 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-26 02:17:58 +00:00
Sebastian Redl
69ffd7ad14 Give MC/MCDisassembler/Disassembler.h a header guard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130096 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-24 15:46:56 +00:00
Jay Foad
ddcdcc8863 Remove unused STL header includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130068 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-23 19:53:52 +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
1ac7fe0f4d Fix relative relocations. This is sufficient for running the rust testsuite with
MC :-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129923 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-21 18:36:50 +00:00
Rafael Espindola
3660a847f1 Behave like gnu as when a relocation crosses sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129850 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 14:01:45 +00:00
Sean Callanan
863f84648f Made the MC disassembler check before accessing
MCInst operands for ARM.  This allows it to be
more tolerant of malformed MCInsts or incorrect
instruction metadata.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129840 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-20 00:43:34 +00:00
Eli Friedman
50ebe53353 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.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129716 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-18 20:54:46 +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
Eli Friedman
205132e904 Revert r129688; it's breaking buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129689 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-18 05:54:54 +00:00
Eli Friedman
24b9654f12 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129688 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-18 05:38:58 +00:00