Commit Graph

102 Commits

Author SHA1 Message Date
Chris Lattner
4e0f25b603 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73742 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-19 00:08:39 +00:00
Chris Lattner
a93ca92379 move mangler quote handling from asm printers to TargetAsmInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73738 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-18 23:41:35 +00:00
Chris Lattner
b839c3f577 simplify macro debug info directive handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73736 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-18 23:31:37 +00:00
Devang Patel
0f7fef3872 Reapply 68847.
Now debug_inlined section is covered by TAI->doesDwarfUsesInlineInfoSection(), which is false by default.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68964 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 17:02:03 +00:00
Dan Gohman
c6fa3ff0bd Revert r68847. It breaks the build on non-Darwin targets, with this message
from the assembler:

Error: unknown pseudo-op: `.debug_inlined'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68863 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-11 15:57:04 +00:00
Devang Patel
2057532679 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68847 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-11 00:16:47 +00:00
Anton Korobeynikov
fca82deecb Do not propagate ELF-specific stuff (data.rel) into other targets. This simplifies code and also ensures correctness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68032 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-30 15:27:43 +00:00
Anton Korobeynikov
71a7c6cde0 Add data.rel stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68031 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-30 15:27:03 +00:00
Anton Korobeynikov
db2323148b Honour relocation behaviour stuff for ro objects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68005 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-29 17:13:49 +00:00
Duncan Sands
667d4b8de6 Introduce new linkage types linkonce_odr, weak_odr, common_odr
and extern_weak_odr.  These are the same as the non-odr versions,
except that they indicate that the global will only be overridden
by an *equivalent* global.  In C, a function with weak linkage can
be overridden by a function which behaves completely differently.
This means that IP passes have to skip weak functions, since any
deductions made from the function definition might be wrong, since
the definition could be replaced by something completely different
at link time.   This is not allowed in C++, thanks to the ODR
(One-Definition-Rule): if a function is replaced by another at
link-time, then the new function must be the same as the original
function.  If a language knows that a function or other global can
only be overridden by an equivalent global, it can give it the
weak_odr linkage type, and the optimizers will understand that it
is alright to make deductions based on the function body.  The
code generators on the other hand map weak and weak_odr linkage
to the same thing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66339 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07 15:45:40 +00:00
Anton Korobeynikov
72bb40229e Treat [1 x i8] zeroinitializer as a C string, placing such stuff into
mergeable string section. I don't see any bad impact of such decision
(rather then placing it into mergeable const section, as it was before),
but at least Darwin linker won't complain anymore.

The problem in LLVM is that we don't have special type for string constants
(like gcc does). Even more, we have two separate types: ConstatArray for non-null
strings and ConstantAggregateZero for null stuff.... It's a bit weird :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63142 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27 22:29:24 +00:00
Scott Michel
210de72cd7 Make the Dwarf macro information section optional; CellSPU's assembler
doesn't support it. The default is set to 'true', so this should not
impact any other target backends.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63058 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-26 22:32:51 +00:00
Bill Wendling
d60de51878 Revert r61415 and r61484. Duncan was correct that these weren't needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61765 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 22:53:45 +00:00
Devang Patel
8a84e4402a squash warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61707 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 17:31:22 +00:00
Bill Wendling
998dee96d3 Linux wants the FDE initial location and address range to be forced to 32-bit.
Darwin doesn't. Make this optional for platforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61484 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-29 22:12:11 +00:00
Bill Wendling
722f5f1cfb Darwin likes for the EH frame to be non-local.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61420 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-24 08:05:17 +00:00
Bill Wendling
d4121bef3c GCC doesn't emit DW_EH_PE_sdata4 for the FDE encoding on Darwin. I'm not sure
about other platforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61415 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-24 05:25:49 +00:00
Rafael Espindola
952b839ce9 Fix bug 3140.
Print a single parameter .file directive if we have an ELF target.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60480 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 11:01:37 +00:00
Dan Gohman
8f092252d3 Refactor various TargetAsmInfo subclasses' TargetMachine members away
adding a TargetMachine member to the base TargetAsmInfo class instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58624 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 18:22:42 +00:00
Duncan Sands
5df3186f59 Rename isWeakForLinker to mayBeOverridden. Use it
instead of hasWeakLinkage in a bunch of optimization
passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56782 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 11:25:42 +00:00
Anton Korobeynikov
32b952a2a6 Reapply 56585:56589 with proper fix for some gcc versions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56621 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-25 21:00:33 +00:00
Evan Cheng
688535e005 Temporarily backing out 56585:56589 to unbreak the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56607 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-25 07:38:08 +00:00
Anton Korobeynikov
8490322fa9 Use crazy template-based inheritance instead of virtual one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56585 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 22:21:39 +00:00
Anton Korobeynikov
00181a33d8 Get rid of ReadOnlySection duplicate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56582 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 22:20:27 +00:00
Anton Korobeynikov
6481873dc0 Get rid of now unused {Four,Eight,Sixteen}ByteConstantSection
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56580 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 22:18:54 +00:00
Anton Korobeynikov
36133dd324 Get rid of duplicate char*/Section* stuff for TLS sections
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56577 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 22:17:06 +00:00
Anton Korobeynikov
315690ec2a Get rid of duplicate char*/Section* DataSection
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56575 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 22:16:16 +00:00
Anton Korobeynikov
d7ca416d6c Get rid of duplicate char*/Section* TextSection
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56574 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 22:15:21 +00:00
Anton Korobeynikov
c25e1ea5e9 Move actual section printing stuff to AsmPrinter from TAI reducing heap traffic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56573 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 22:14:23 +00:00
Dale Johannesen
b2dfb89e0e Fix logic for not emitting no-dead-strip for some
objects in llvm.used (thanks Anton).  Makes visible
the magic 'l' prefix for symbols on Darwin which are
to be passed through the assembler, then removed at
linktime (previously all references to this had been
hidden in the ObjC FE code, oh well).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55973 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-09 01:21:22 +00:00
Anton Korobeynikov
328da65bd1 Add interface for section override. Use this for Sparc, since it should use named BSS section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54844 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 12:58:12 +00:00
Anton Korobeynikov
ffe31d7bf1 Move SLEB/ULEB size calculation routines from AsmPrinter to TargetAsmInfo. This makes JIT asmprinter-free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54843 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 12:57:46 +00:00
Anton Korobeynikov
d0c1e29aec Reduce heap trashing due to std::string construction / concatenation via caching of section flags string representations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54842 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 12:57:07 +00:00
Evan Cheng
42ccc21ce7 Undo most of r54519.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54534 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 17:56:50 +00:00
Evan Cheng
711b6dce24 It's not legal to output a GV in a coalesced section if it's used in an ARM PIC relative constantpool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54519 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 06:56:16 +00:00
Anton Korobeynikov
4578862dcc Provide convenient helpers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54451 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 09:51:54 +00:00
Anton Korobeynikov
93cacf131d Select section for constant pool entries
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54448 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 09:50:34 +00:00
Anton Korobeynikov
04dda73926 Provide default implementation of different small-sections related stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53920 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-22 17:09:59 +00:00
Bruno Cardoso Lopes
62d590cc8e Basic support for small sections
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53907 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-22 15:26:53 +00:00
Dan Gohman
9c578eb223 TargetAsmInfo::SectionForGlobal showed up in a profile. Simplify it a little.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53639 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-15 18:37:51 +00:00
Anton Korobeynikov
7d51edfc08 Use only 'subset' of flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53323 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:29:44 +00:00
Anton Korobeynikov
0d44ba82b4 First sketch of special section objects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53320 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:28:49 +00:00
Anton Korobeynikov
c33a744f0e Use isWeakForLinker() hook
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53318 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:27:59 +00:00
Anton Korobeynikov
2a889172a4 Fix several bugs in named sections handling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53312 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:25:46 +00:00
Anton Korobeynikov
b20015b621 Add hacky way to distinguish named and named sections. This will be generalized in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53311 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:25:26 +00:00
Anton Korobeynikov
5248670096 Use 'gnu.linkonce', where needed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53310 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:24:55 +00:00
Anton Korobeynikov
0e48a0ca16 Fix thinko
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53309 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:24:38 +00:00
Anton Korobeynikov
4260ad3e7d Provide section selection for X86 ELF targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53305 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:23:08 +00:00
Anton Korobeynikov
265c5259ab Provide general hook for section name calculation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53304 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:22:46 +00:00
Anton Korobeynikov
29b03f7375 Properly handle linkonce stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53296 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 13:19:38 +00:00