Commit Graph

525 Commits

Author SHA1 Message Date
Michael J. Spencer
1f6efa3996 Merge System into Support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-29 18:16:10 +00:00
Rafael Espindola
ec0b428398 Make EmitIntValue non virtual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120271 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 23:22:44 +00:00
Rafael Espindola
6f95023a7f Move EmitValue to MCObjectStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120269 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 23:08:47 +00:00
Rafael Espindola
ea4afa91eb Fixed verson of r120245.
Factor some duplicated code into MCObjectStreamer::EmitLabel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 17:18:55 +00:00
Rafael Espindola
ba210243ef Revert previous patch while I debug the darwin bootstrap failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120246 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 16:22:59 +00:00
Rafael Espindola
f90a2de72c Factor some duplicated code into MCObjectStreamer::EmitLabel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120245 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 15:54:36 +00:00
Rafael Espindola
175ccab75f Make EmitSymbolValue non virtual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120244 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 15:12:55 +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
71e7f9210d Make EmitULEB128IntValue and EmitSLEB128IntValue non virtual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120242 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 14:56:52 +00:00
Rafael Espindola
e04ed7e45f Define generic 1, 2 and 4 byte pc relative relocations. They are common
and at least the 4 byte one will be needed to implement the .cfi_* directives.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120240 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-28 14:17:56 +00:00
Michael J. Spencer
326990f1eb Fix Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120166 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-26 04:16:08 +00:00
Rafael Espindola
a9d4281cc0 Invalidate the layout on any relaxation, not just Instructions. Bug found by David Meyer.
While here, remove unused argument and rename UpdateForSlide to Invalidate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120009 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-23 08:08:33 +00:00
Rafael Espindola
0e11dfc4a6 Reuse data fragments while lowering. Patch by David Meyer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119999 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-23 05:49:35 +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
ad8aaa069c Remove some #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119967 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-22 11:53:17 +00:00
Kevin Enderby
e8e98d7f2e Added support for the Mach-O .symbol_resolver directive. rdar://8673046
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119816 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 18:39:33 +00:00
Rafael Espindola
17fd7bda5a Add a MCLineSectionOrder vector so that we produce the line tables in a
deterministic order.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119795 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 07:41:23 +00:00
Rafael Espindola
195a0ce484 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119777 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-19 02:26:16 +00:00
Rafael Espindola
5c0556341e Change CodeGen to use .loc directives. This produces a lot more readable output
and testing is easier.  A good example is the unknown-location.ll test that
now can just look for ".loc 1 0 0".  We also don't use a DW_LNE_set_address for
every address change anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119613 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 02:04:25 +00:00
Rafael Espindola
f2dc4aa562 make isVirtualSection a virtual method on MCSection. Chris' suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119547 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 20:03:54 +00:00
Daniel Dunbar
abc756216d MC-JIT: Stub out "pure" streamer.
- No immediate use, but maybe someone feels like hacking on it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119510 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 16:06:47 +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
342e39f9e5 Add const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119380 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-16 20:56:23 +00:00
Rafael Espindola
94ed5fca3f Change MCExpr::EvaluateAsRelocatableImpl of variables to return the original
variable if recursing fails to simplify it.

Factor AliasedSymbol to be a method of MCSymbol.

Update MCAssembler::EvaluateFixup to match the change in
EvaluateAsRelocatableImpl.

Remove the WeakRefExpr hack, as the object writer now sees the weakref with
no extra effort needed.

Nothing else is using MCTargetExpr, but keep it for now.

Now that the ELF writer sees relocations with aliases, handle

    .weak    foo2
foo2:
    .weak    bar2
    .set    bar2,foo2
    .quad    bar2

the same way gas does and produce a relocation with bar2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119152 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15 16:33:49 +00:00
Rafael Espindola
db9835d089 Fix PR8565.
This moves most of the isUsed logic to the MCSymbol itself. With this we
get a bit more relaxed about allowing definitions after uses: uses that
don't evaluate their argument immediately (jmp foo) are accepted.

ddunbar, this was the smallest compromise I could think of that lets us
accept gcc (and clang!) assembly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119144 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15 14:40:36 +00:00
Chris Lattner
1e61e69d40 add targetoperand flags for jump tables, constant pool and block address
nodes to indicate when ha16/lo16 modifiers should be used.  This lets
us pass PowerPC/indirectbr.ll.

The one annoying thing about this patch is that the MCSymbolExpr isn't
expressive enough to represent ha16(label1-label2) which we need on
PowerPC.  I have a terrible hack in the meantime, but this will have
to be revisited at some point.

Last major conversion item left is global variable references.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119105 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15 02:46:57 +00:00
Chris Lattner
6135a96792 reimplement ppc asmprinter "toc" handling to use a VariantKind
on the operand, required for .o file writing and fixing 
the PowerPC/mult-alt-generic-powerpc64.ll failure with the new
instprinter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119087 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-14 22:22:59 +00:00
Daniel Dunbar
115a3dd066 MC: Simplify Mach-O and ELF object writer implementations.
- What was I thinking?????

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118992 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13 07:33:40 +00:00
Rafael Espindola
e13a0ff8ac Parse and record the gnu_unique_object type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118980 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13 04:51:02 +00:00
Rafael Espindola
c50a0fd7cb Parse and remember discriminators in .loc line. I try to output them with
another patch.
This lets us parse a bit more of the gcc 4.5 output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118975 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13 03:18:27 +00:00
Rafael Espindola
2ff9e83a82 Initial comdat implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118805 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-11 18:13:52 +00:00
Rafael Espindola
4283f4b81e Use MCSectionELF in places we know we have an ELF section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118699 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10 19:05:07 +00:00
Jim Grosbach
2c4d5125c7 Update ARMConstantPoolValue to not use a modifier string. Use an explicit
VariantKind marker to indicate the additional information necessary. Update
MC to handle the new Kinds. rdar://8647623



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118671 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10 03:26:07 +00:00
Rafael Espindola
34be396a12 Fixed version of 118639 with an extra assert to catch similar problems
earlier. Implicit bool -> int conversions are evil!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118651 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 23:42:07 +00:00
Rafael Espindola
037b5be15a Revert previous patch. Missed a case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118645 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 22:54:38 +00:00
Rafael Espindola
e61a1ac595 Remove IsExplicit. It was always false.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118639 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-09 22:37:44 +00:00
Rafael Espindola
187d8339db Relax dwarf line fragments. This fixes a crash in the included testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118365 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-07 02:07:12 +00:00
Jim Grosbach
ba21957cbd Add '.code 32' assembler directive to MC streamers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118309 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-05 22:40:09 +00:00
Jim Grosbach
ce79299f78 MC'ize the '.code 16' and '.thumb_func' ARM directives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118301 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-05 22:08:08 +00:00
Jim Grosbach
d54986f609 Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118296 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-05 20:41:12 +00:00
Jim Grosbach
c9d1439051 Allow targets to specify the MachO CPUType/CPUSubtype information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118288 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-05 18:48:58 +00:00
Rafael Espindola
187ce544b2 Do relaxations with FT_Org fragments. Fixes the FIXME:
// FIXME: We should compute this sooner, we don't want to recurse here, and
    // we would like to be more functional.

In MCAssembler::ComputeFragmentSize.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118080 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02 21:38:23 +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
f89671d994 Move EmitInstruction to MCObjectStreamer so that ELF and MachO can share it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117925 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01 16:27:31 +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
Rafael Espindola
b4d1721eff Implement TLSLD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117547 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 15:02:40 +00:00
Rafael Espindola
0cf15d61b7 Implement DTPOFF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117546 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 14:48:59 +00:00
Rafael Espindola
a264f72d3f Implement TLSLDM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117544 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 14:37:09 +00:00
Rafael Espindola
a0a2f8734c Implement VK_GOTNTPOFF and switch RelocNeedsGOT to use VariantKind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117543 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-28 14:22:44 +00:00
Wesley Peck
eecb858ca8 Making the e_machine configurable by the target backend in ELFObjectWriter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117099 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22 15:52:49 +00:00