Commit Graph

163 Commits

Author SHA1 Message Date
Chris Lattner 63779b8d57 PreferredEHDataFormat is always call with data and global, but this whole
thing is #if0'd out anyway.  Just simplify the code by reducing the interface.
Not deleting this is essential for Bill's continuing happiness.

llvm-svn: 77736
2009-07-31 21:39:55 +00:00
Bill Wendling bef0437d61 Change the "PreferredEHDataFormat" from "absptr" if we're on a Darwin system >
Leopard.

llvm-svn: 77414
2009-07-29 00:59:34 +00:00
Bill Wendling 403990ad58 Darwin outputs (DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4) when we're
dealing with Data.

llvm-svn: 77372
2009-07-28 21:53:17 +00:00
Chris Lattner 5e693ed07b Rip all of the global variable lowering logic out of TargetAsmInfo. Since
it is highly specific to the object file that will be generated in the end,
this introduces a new TargetLoweringObjectFile interface that is implemented
for each of ELF/MachO/COFF/Alpha/PIC16 and XCore.

Though still is still a brutal and ugly refactoring, this is a major step
towards goodness.

This patch also:
1. fixes a bunch of dangling pointer problems in the PIC16 backend.
2. disables the TargetLowering copy ctor which PIC16 was accidentally using.
3. gets us closer to xcore having its own crazy target section flags and
   pic16 not having to shadow sections with its own objects.
4. fixes wierdness where ELF targets would set CStringSection but not
   CStringSection_.  Factor the code better.
5. fixes some bugs in string lowering on ELF targets.

llvm-svn: 77294
2009-07-28 03:13:23 +00:00
Chris Lattner 1814e81e17 make COFF work like ELF and macho, by splitting out into its own
header even though there is only one COFF target.

llvm-svn: 77204
2009-07-27 16:45:59 +00:00
Chris Lattner 3679ad5a77 apparently we have "windows" and "coff", which are different(?)
llvm-svn: 77197
2009-07-27 16:22:39 +00:00
Chris Lattner 469ae8ac54 32-bit darwin targets support .literal16 too.
llvm-svn: 77191
2009-07-27 15:44:04 +00:00
Chris Lattner 86b7255776 Eliminate getNamed/getUnnamedSection, adding a new and unified getOrCreateSection
instead.

llvm-svn: 77186
2009-07-27 06:17:14 +00:00
Chris Lattner 149465ea06 Eliminate SectionFlags, just embed a SectionKind into Section
instead and drive things based off of that.

llvm-svn: 77184
2009-07-27 05:32:16 +00:00
Chris Lattner 602d44fa70 untangle a TargetAsmInfo hack where ELFTargetAsmInfo would create a
'unnamed' bss section, but some impls would want a named one.  Since
they don't have consistent behavior, just make each target do their
own thing, instead of doing something "sortof common" then having
targets change immutable objects later.

llvm-svn: 77165
2009-07-26 19:23:28 +00:00
Chris Lattner 1db210322a remove a densemap from TargetAsmInfo that was uniquing the targetflags strings,
just use a smallstring instead.

llvm-svn: 77144
2009-07-26 07:33:58 +00:00
Chris Lattner 29151b0218 rename Mergable -> Mergeable and Writable -> Writeable
llvm-svn: 77138
2009-07-26 06:48:26 +00:00
Chris Lattner 1d68bd7f97 Rearrange all the SectionKinds and structure them into a hierarchical
group instead of a bunch of random unrelated ideas.  Provide predicates
to categorize a SectionKind into a group, and use them instead of 
getKind() throughout the code.

This also renames a ton of SectionKinds to be more consistent and
evocative, and adds a huge number of comments on the enums so that
I will hopefully be able to remember how this stuff works long from
now.

llvm-svn: 77129
2009-07-26 05:44:20 +00:00
Chris Lattner 0af00396a7 make SectionKind be a first-class pod struct instead of just
an enum.

llvm-svn: 77096
2009-07-25 23:21:55 +00:00
Chris Lattner 60f3b73e11 this is (unfortunately) several changes mixed together:
1. Spell SectionFlags::Writeable as "Writable".
2. Add predicates for deriving SectionFlags from SectionKinds.
3. Sink ELF-specific getSectionPrefixForUniqueGlobal impl into
   ELFTargetAsmInfo.
4. Fix SectionFlagsForGlobal to know that BSS/ThreadBSS has the
   BSS bit set (the real fix for PR4619).
5. Fix isSuitableForBSS to not put globals with explicit sections
   set in BSS (which was the reason #4 wasn't fixed earlier).
6. Remove my previous hack for PR4619.

llvm-svn: 77085
2009-07-25 18:57:34 +00:00
Chris Lattner 708e559247 make SectionKindForGlobal target independent, and therefore non-virtual.
It's classifications now include elf-specific discriminators.  Targets
that don't have these features (like darwin and pecoff) simply treat
data.rel like data, etc.

llvm-svn: 76993
2009-07-24 19:15:47 +00:00
Daniel Dunbar 12368685d8 Switch to getNameStr().
llvm-svn: 76962
2009-07-24 08:24:36 +00:00
Chris Lattner 0f5ebf5509 Replace UniqueSectionForGlobal with getSectionPrefixForUniqueGlobal.
The later doesn't depend on any crazy LLVM IR stuff, and this
pulls the concatenation of prefix with GV name (the root problem behind
PR4584) out one level.

llvm-svn: 76948
2009-07-24 04:49:34 +00:00
Chris Lattner 6b1be83937 remove TargetAsmInfo::ExpandInlineAsm
llvm-svn: 76445
2009-07-20 17:59:32 +00:00
Chris Lattner e79b2bc088 Untangle a snarl that I discovered when updating the mangler,
starting in getCurrentFunctionEHName.  Among other problems,
we would try to privative a "foo.eh" label, but end up emitting
the label as _Lfoo.eh instead of L_foo.eh on darwin.  This is really
bad, and the linker has always tolerated these labels existing.
For now, just emit them as _foo.eh.

This patch also fixes problems with ".eh" labels on unnamed
functions and eliminates two strangely defined TargetAsmInfo
hooks.

llvm-svn: 76231
2009-07-17 20:46:40 +00:00
Torok Edwin fbcc663cbf llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").

llvm-svn: 75640
2009-07-14 16:55:14 +00:00
Bill Wendling e3ac197457 Reverted r75484. It was causing a failure with Apple-style builds.
llvm-svn: 75491
2009-07-13 20:27:41 +00:00
Bill Wendling 1b7661e588 More standard way of specifying greater than Leopard.
llvm-svn: 75488
2009-07-13 20:18:43 +00:00
Bill Wendling 0a860df8ef On greater than Leopard systems, place exception tables in the __TEXT section.
llvm-svn: 75484
2009-07-13 18:48:39 +00:00
Torok Edwin 56d0659726 assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.

llvm-svn: 75379
2009-07-11 20:10:48 +00:00
Eli Friedman 707cbc4126 Misc tweaks to Intel asm printing to make it more compatible with MASM.
Patch by Benedict Gaster.

llvm-svn: 73753
2009-06-19 04:48:38 +00:00
Chris Lattner 8284b66264 merge the common darwin settings from the X86/PPC/ARM targets
into DarwinTargetAsmInfo.cpp.  The remaining differences should
be evaluated.  It seems strange that x86/arm has .zerofill but ppc
doesn't, etc.

llvm-svn: 73742
2009-06-19 00:08:39 +00:00
Chris Lattner b84764516d move mangler quote handling from asm printers to TargetAsmInfo.
llvm-svn: 73738
2009-06-18 23:41:35 +00:00
Chris Lattner 09081b25a5 simplify macro debug info directive handling.
llvm-svn: 73736
2009-06-18 23:31:37 +00:00
Evan Cheng de9e36a74e On Darwin, ams printer should output a second label before a jump table so the linker knows it's a new atom. But this is only needed if the jump table is put in a separate section from the function body.
llvm-svn: 73720
2009-06-18 20:37:15 +00:00
Devang Patel 80be3511ed Reapply 68847.
Now debug_inlined section is covered by TAI->doesDwarfUsesInlineInfoSection(), which is false by default.

llvm-svn: 68964
2009-04-13 17:02:03 +00:00
Dan Gohman 825236b116 Revert r68847. It breaks the build on non-Darwin targets, with this message
from the assembler:

Error: unknown pseudo-op: `.debug_inlined'
llvm-svn: 68863
2009-04-11 15:57:04 +00:00
Devang Patel 790e60999e Keep track of inlined functions and their locations. This information is collected when nested llvm.dbg.func.start intrinsics are seen. (Right now, inliner removes nested llvm.dbg.func.start intrinisics during inlining.)
Create debug_inlined dwarf section using these information. This info is used by gdb, at least on Darwin, to enable better experience debugging inlined functions. See DwarfWriter.cpp for more information on structure of debug_inlined section.

llvm-svn: 68847
2009-04-11 00:16:47 +00:00
Anton Korobeynikov 7c5f3c40ca Do not propagate ELF-specific stuff (data.rel) into other targets. This simplifies code and also ensures correctness.
llvm-svn: 68032
2009-03-30 15:27:43 +00:00
Anton Korobeynikov c247fd396c Add data.rel stuff
llvm-svn: 68031
2009-03-30 15:27:03 +00:00
Dan Gohman d6e571b202 Recognize bswapl as bswap too.
llvm-svn: 67072
2009-03-17 02:45:40 +00:00
Dan Gohman 77a9279d80 Recognize "bswapq" as an alternate spelling for the bswap instruction.
llvm-svn: 67071
2009-03-17 02:17:27 +00:00
Dan Gohman 31dd016f81 Recognize inline asm for bswap on x86-64 GLIBC. This allows it
to be supported in the JIT.

llvm-svn: 62730
2009-01-21 23:40:54 +00:00
Bill Wendling f9b5ba7bcb Revert r61415 and r61484. Duncan was correct that these weren't needed.
llvm-svn: 61765
2009-01-05 22:53:45 +00:00
Devang Patel 56a8bb670f squash warnings.
llvm-svn: 61707
2009-01-05 17:31:22 +00:00
Bill Wendling 03f2af79b8 Linux wants the FDE initial location and address range to be forced to 32-bit.
Darwin doesn't. Make this optional for platforms.

llvm-svn: 61484
2008-12-29 22:12:11 +00:00
Bill Wendling d6bd7e9372 Darwin likes for the EH frame to be non-local.
llvm-svn: 61420
2008-12-24 08:05:17 +00:00
Bill Wendling 066b5f6724 GCC doesn't emit DW_EH_PE_sdata4 for the FDE encoding on Darwin. I'm not sure
about other platforms.

llvm-svn: 61415
2008-12-24 05:25:49 +00:00
Rafael Espindola 770b4b830a Fix bug 3202.
The EH_frame and .eh symbols are now private, except for darwin9 and earlier.
The patch also fixes the definition of PrivateGlobalPrefix on pcc linux.

llvm-svn: 61242
2008-12-19 10:55:56 +00:00
Rafael Espindola cda011b5ad Fix bug 3140.
Print a single parameter .file directive if we have an ELF target.

llvm-svn: 60480
2008-12-03 11:01:37 +00:00
Dan Gohman ac41d9f5d8 Refactor various TargetAsmInfo subclasses' TargetMachine members away
adding a TargetMachine member to the base TargetAsmInfo class instead.

llvm-svn: 58624
2008-11-03 18:22:42 +00:00
Anton Korobeynikov d2aded08ac Fix weird think-o and unbreak build on all gcc-3.4.x-based platforms (e.g. mingw)
llvm-svn: 57106
2008-10-05 08:53:29 +00:00
Anton Korobeynikov 87001fd6fd Reapply 56585:56589 with proper fix for some gcc versions
llvm-svn: 56621
2008-09-25 21:00:33 +00:00
Evan Cheng 84301390ae Temporarily backing out 56585:56589 to unbreak the build.
llvm-svn: 56607
2008-09-25 07:38:08 +00:00
Anton Korobeynikov 3097c10347 Minor cleanup
llvm-svn: 56588
2008-09-24 22:22:54 +00:00