Chris Lattner
eebe4b24c3
add some fixme's and cleanups. TargetAsmInfo shouldn't depend on VMCore eventually.
...
llvm-svn: 76439
2009-07-20 17:47:48 +00:00
Chris Lattner
19134c0748
rename TargetAsmInfo::getASDirective -> getDataASDirective
...
llvm-svn: 76431
2009-07-20 17:12:46 +00:00
Evan Cheng
fe529a2c29
Revert 76177 for now. It's messing up ARM asm printing. Also this significant debate about its efficiency.
...
llvm-svn: 76279
2009-07-18 01:43:53 +00:00
Chris Lattner
ffe0c407be
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
David Greene
70e8a51127
Add logic to align instruction operands to columns for pretty-printing.
...
No target uses this currently. This patch only adds the mechanism so
that local installations can choose to enable this.
llvm-svn: 76177
2009-07-17 14:24:46 +00:00
Duncan Sands
765b981647
Remove StringConstantPrefix now that the only user
...
(llvm-gcc) has gone.
llvm-svn: 75781
2009-07-15 12:39:48 +00:00
Dan Gohman
19222a6572
Delete a spurious const.
...
llvm-svn: 75493
2009-07-13 20:46:11 +00:00
David Greene
814f6a648f
Add infrastructure to allow post instruction printing action triggers.
...
We'll eventually use this to print comments in asm files and do other
fun things.
This adds interfaces to the AsmPrinter and changes TableGen to invoke
the postInstructionAction when appropriate. It also add parameters to
TargetAsmInfo to control comment layout.
llvm-svn: 75490
2009-07-13 20:25:48 +00:00
Chris Lattner
c2b0fd0304
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
6cd267dcc5
move mangler quote handling from asm printers to TargetAsmInfo.
...
llvm-svn: 73738
2009-06-18 23:41:35 +00:00
Chris Lattner
ea0ea2f4bc
simplify macro debug info directive handling.
...
llvm-svn: 73736
2009-06-18 23:31:37 +00:00
Sanjiv Gupta
20d1683822
Add directive to declare external globals.
...
llvm-svn: 70379
2009-04-29 08:23:18 +00:00
Devang Patel
ad7f61c279
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
ac11c8d30f
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
6f907173e0
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
2ea565a37b
Add data.rel stuff
...
llvm-svn: 68031
2009-03-30 15:27:03 +00:00
Anton Korobeynikov
ec131d94ff
Honour relocation behaviour stuff for ro objects
...
llvm-svn: 68005
2009-03-29 17:13:49 +00:00
Chris Lattner
2291a8be5e
add a friend needed by a stringmap change.
...
llvm-svn: 63706
2009-02-04 01:51:53 +00:00
Sanjiv Gupta
c47a19b23e
Made the common case of default address space directive as non-virtual for performance reasons. Provide a single virtual interface for directives of all sizes in non-default address spaces.
...
llvm-svn: 63521
2009-02-02 16:53:06 +00:00
Sanjiv Gupta
e442452ade
Enable emitting of constant values in non-default address space as well. The APIs emitting constants now take an additional parameter signifying the address space in which to emit. The APIs like getData8BitsDirective() etc are made virtual enabling targets to be able to define appropirate directivers for various sizes and address spaces.
...
llvm-svn: 63377
2009-01-30 04:25:10 +00:00
Scott Michel
56fa9ba0b6
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.
llvm-svn: 63058
2009-01-26 22:32:51 +00:00
Bill Wendling
891f9abdbb
Revert r61415 and r61484. Duncan was correct that these weren't needed.
...
llvm-svn: 61765
2009-01-05 22:53:45 +00:00
Bill Wendling
067c48f7a6
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
044248aad1
Darwin likes for the EH frame to be non-local.
...
llvm-svn: 61420
2008-12-24 08:05:17 +00:00
Bill Wendling
6add893a14
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
7593f0004f
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
0c800cf35e
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
155df8a79e
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
7367de00cf
Reapply 56585:56589 with proper fix for some gcc versions
...
llvm-svn: 56621
2008-09-25 21:00:33 +00:00
Evan Cheng
12a67b5226
Temporarily backing out 56585:56589 to unbreak the build.
...
llvm-svn: 56607
2008-09-25 07:38:08 +00:00
Anton Korobeynikov
9e5cbcc134
Use crazy template-based inheritance instead of virtual one.
...
llvm-svn: 56585
2008-09-24 22:21:39 +00:00
Anton Korobeynikov
b9294473f0
Get rid of ReadOnlySection duplicate
...
llvm-svn: 56582
2008-09-24 22:20:27 +00:00
Anton Korobeynikov
9b9c3a38ad
Get rid of now unused {Four,Eight,Sixteen}ByteConstantSection
...
llvm-svn: 56580
2008-09-24 22:18:54 +00:00
Anton Korobeynikov
1b3c67c5cf
Get rid of duplicate char*/Section* stuff for TLS sections
...
llvm-svn: 56577
2008-09-24 22:17:06 +00:00
Anton Korobeynikov
dca16f3acf
Get rid of duplicate char*/Section* DataSection
...
llvm-svn: 56575
2008-09-24 22:16:16 +00:00
Anton Korobeynikov
83fa257f55
Get rid of duplicate char*/Section* TextSection
...
llvm-svn: 56574
2008-09-24 22:15:21 +00:00
Anton Korobeynikov
c7ac49c632
Move actual section printing stuff to AsmPrinter from TAI reducing heap traffic.
...
llvm-svn: 56573
2008-09-24 22:14:23 +00:00
Anton Korobeynikov
ff79214785
Provide direct function to switch to Section
...
llvm-svn: 56571
2008-09-24 22:12:10 +00:00
Dale Johannesen
ba2bbe0c55
Move the uglier parts of deciding not to emit a
...
UsedDirective for some symbols in llvm.used into
Darwin-specific code. I've decided LessPrivateGlobal
is potentially a useful abstraction and left it in
the target-independent area, with improved comment.
llvm-svn: 56024
2008-09-09 22:29:13 +00:00
Dale Johannesen
1ed08a58d1
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).
llvm-svn: 55973
2008-09-09 01:21:22 +00:00
Anton Korobeynikov
d51454bfa6
Add interface for section override. Use this for Sparc, since it should use named BSS section.
...
llvm-svn: 54844
2008-08-16 12:58:12 +00:00
Anton Korobeynikov
436f708112
Move SLEB/ULEB size calculation routines from AsmPrinter to TargetAsmInfo. This makes JIT asmprinter-free.
...
llvm-svn: 54843
2008-08-16 12:57:46 +00:00
Anton Korobeynikov
767865a3d1
Reduce heap trashing due to std::string construction / concatenation via caching of section flags string representations
...
llvm-svn: 54842
2008-08-16 12:57:07 +00:00
Evan Cheng
804e157031
Undo most of r54519.
...
llvm-svn: 54534
2008-08-08 17:56:50 +00:00
Evan Cheng
4708df4776
It's not legal to output a GV in a coalesced section if it's used in an ARM PIC relative constantpool.
...
llvm-svn: 54519
2008-08-08 06:56:16 +00:00
Anton Korobeynikov
d3009663dd
Provide convenient helpers
...
llvm-svn: 54451
2008-08-07 09:51:54 +00:00
Anton Korobeynikov
d37daa2aeb
Select section for constant pool entries
...
llvm-svn: 54448
2008-08-07 09:50:34 +00:00
Anton Korobeynikov
090eca95ab
Tie small stuff to non-small by default on ELF platforms
...
llvm-svn: 53919
2008-07-22 17:09:41 +00:00
Bruno Cardoso Lopes
96ab649026
Basic support for small sections
...
llvm-svn: 53907
2008-07-22 15:26:53 +00:00
Anton Korobeynikov
80f0406385
Silence a warning
...
llvm-svn: 53326
2008-07-09 13:56:43 +00:00
Anton Korobeynikov
7b144cc108
Drop enum and use constants for SectionFlags
...
llvm-svn: 53325
2008-07-09 13:41:07 +00:00
Anton Korobeynikov
03614f247c
First sketch of special section objects
...
llvm-svn: 53320
2008-07-09 13:28:49 +00:00
Anton Korobeynikov
3399dc61e5
Unbreak
...
llvm-svn: 53317
2008-07-09 13:27:37 +00:00
Anton Korobeynikov
1f697cd97b
Another bunch of hacks for named sections support
...
llvm-svn: 53315
2008-07-09 13:26:52 +00:00
Anton Korobeynikov
933bf0ecc4
Add hacky way to distinguish named and named sections. This will be generalized in the future.
...
llvm-svn: 53311
2008-07-09 13:25:26 +00:00
Anton Korobeynikov
751cfda7dd
Handle ELF mergeable sections
...
llvm-svn: 53306
2008-07-09 13:23:37 +00:00
Anton Korobeynikov
f42d75201a
Provide general hook for section name calculation
...
llvm-svn: 53304
2008-07-09 13:22:46 +00:00
Anton Korobeynikov
c421fcddb4
Print entity size for mergeable sections
...
llvm-svn: 53303
2008-07-09 13:22:17 +00:00
Anton Korobeynikov
059999d321
Move flag decoding stuff into special hook
...
llvm-svn: 53297
2008-07-09 13:20:07 +00:00
Anton Korobeynikov
ca271dd426
Properly handle linkonce stuff
...
llvm-svn: 53296
2008-07-09 13:19:38 +00:00
Anton Korobeynikov
782a69505d
Provide skeletone code for calculation of section, where global should be emitted into
...
llvm-svn: 53295
2008-07-09 13:19:08 +00:00
Anton Korobeynikov
c150d11dbd
Make hooks virtual
...
llvm-svn: 53293
2008-07-09 13:18:21 +00:00
Anton Korobeynikov
5bc572ad96
Add default section name resolution routine
...
llvm-svn: 53292
2008-07-09 13:18:02 +00:00
Anton Korobeynikov
552675bb0f
Constify
...
llvm-svn: 53291
2008-07-09 13:17:36 +00:00
Anton Korobeynikov
651865851c
Add code for default section falgs computation
...
llvm-svn: 53290
2008-07-09 13:16:59 +00:00
Duncan Sands
aac5c915ed
Linux also does not require exception handling
...
moves in order to get correct debug info. Since
I can't imagine how any target could possibly
be any different, I've just stripped out the
option: now all the world's like Darwin!
llvm-svn: 53134
2008-07-04 09:55:48 +00:00
Bill Wendling
27c38cee90
Darwin doesn't need exception handling information for the "move" info when
...
debug information is being output, because it's leet!
llvm-svn: 52994
2008-07-01 23:34:48 +00:00
Dan Gohman
83c1b4cede
Prune a few dependencies on MachineFunction.h.
...
llvm-svn: 52976
2008-07-01 18:15:35 +00:00
Anton Korobeynikov
9e8c154272
Start refactoring of asmprinters: provide a TAI hook, which will select a 'section kind' for a global.
...
llvm-svn: 52868
2008-06-28 13:45:57 +00:00
Dale Johannesen
5b060922a3
Expand documentation of StringConstantPrefix.
...
llvm-svn: 51911
2008-06-03 18:15:03 +00:00
Dale Johannesen
c0cd6cd4d4
Add StringConstantPrefix to control what the
...
assembler names of string constants look like.
llvm-svn: 51909
2008-06-03 18:09:06 +00:00
Duncan Sands
6f4e916c6a
Output correct exception handling and frame info
...
on x86-64 linux. This causes no regressions on
32 bit linux and 32 bit ppc. More tests pass
on 64 bit ppc with no regressions. I didn't
turn on eh on 64 bit linux because the intrinsics
needed to compile the eh runtime aren't done
yet. But if you turn it on and link with the
mainline runtime then eh seems to work fine
on x86-64 linux with this patch. Thanks to
Dale for testing. The main point of the patch
is that if you output that some object is
encoded using 4 bytes you had better not output
8 bytes for it: the patch makes everything
consistent.
llvm-svn: 50825
2008-05-07 19:11:09 +00:00
Dan Gohman
c860d9c77c
Add AsmPrinter support for emitting a directive to declare that
...
the code being generated does not require an executable stack.
Also, add target-specific code to make use of this on Linux
on x86.
llvm-svn: 50634
2008-05-05 00:28:39 +00:00
Dale Johannesen
4524d3a1d1
Fix a bug in Darwin EH: FDE->CIE pointer must
...
be relocatable. Describe why .set is needed better.
llvm-svn: 48848
2008-03-26 23:31:39 +00:00
Dan Gohman
22002efa15
A quick nm audit turned up several fixed tables and objects that were
...
marked read-write. Use const so that they can be allocated in a
read-only segment.
llvm-svn: 48800
2008-03-25 21:45:14 +00:00
Anton Korobeynikov
875da2420a
Use enumeration for preffered EH dwarf encoding reason
...
llvm-svn: 47770
2008-02-29 22:09:08 +00:00
Evan Cheng
f8b1257d2e
Add a quick and dirty "loop aligner pass". x86 uses it to align its loops to 16-byte boundaries.
...
llvm-svn: 47703
2008-02-28 00:43:03 +00:00
Anton Korobeynikov
7bd4b77e30
Preparation step for some cleanup/generalization in EH information emission:
...
provide TAI hook for selection of EH data emission format. Currently unused.
llvm-svn: 47699
2008-02-27 23:33:50 +00:00
Dale Johannesen
319c7bb405
Fix and enable EH for x86-64 Darwin. Adds
...
ShortenEHDataFor64Bits as a not-very-accurate
abstraction to cover all the changes in DwarfWriter.
Some cosmetic changes to Darwin assembly code for
gcc testsuite compatibility.
llvm-svn: 46029
2008-01-15 23:24:56 +00:00
Dale Johannesen
fdd4b3846f
Emit unused EH frames for weak definitions on Darwin,
...
because assembler/linker can't cope with weak absolutes.
PR 1880.
llvm-svn: 45811
2008-01-10 02:03:30 +00:00
Chris Lattner
e0b1ee937a
Don't attribute in file headers anymore. See llvmdev for the
...
discussion of this change. Boy are my fingers tired. ;-)
llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Dale Johannesen
3f01467781
File missing from previous patch.
...
llvm-svn: 44259
2007-11-20 23:25:17 +00:00
Dan Gohman
50747737a5
TargetAsmInfo::getAddressSize() was incorrect for x86-64 and 64-bit targets
...
other than PPC64. Instead of fixing it, just remove it and fix all the
places that use it to use TargetData::getPointerSize() instead, as there
aren't very many. Most of the references were in DwarfWriter.cpp.
llvm-svn: 42419
2007-09-27 23:12:31 +00:00
Dan Gohman
b642a1ddf8
Merge hasDotLoc and hasDotFile into hasDotLocAndDotFile since .loc and .file
...
aren't really usable without each other.
llvm-svn: 42274
2007-09-24 21:09:53 +00:00
Bill Wendling
bde1aacffa
Add accessor method.
...
llvm-svn: 41854
2007-09-11 17:24:38 +00:00
Bill Wendling
74888e63e7
Add a bool to indicate if we should set the "indirect encoding" bit in the Dwarf
...
information for EH.
llvm-svn: 41852
2007-09-11 17:20:55 +00:00
Bill Wendling
3c6a8b2814
The personality function on Darwin needs a global stub. We then refer to
...
that global stub instead of doing the ".set" thingy we were doing before.
llvm-svn: 41838
2007-09-11 08:27:17 +00:00
Reid Spencer
3e54e72ef1
Fix minor doxygen nits.
...
llvm-svn: 40854
2007-08-05 20:06:04 +00:00
Dan Gohman
74c92798d8
Eliminate some redundant newlines in asm output.
...
llvm-svn: 37574
2007-06-14 15:00:27 +00:00
Anton Korobeynikov
ce48606d7a
Emit sections/directives in the proper order. This fixes PR1376. Also,
...
some small cleanup was made.
llvm-svn: 36780
2007-05-05 09:04:50 +00:00
Anton Korobeynikov
6e6bfcaf4d
Fix couple of bugs connected with eh info:
...
1. Correct output offsets on Linux
2. Fix "style" of personality function. It shouldn't be indirect.
llvm-svn: 36633
2007-05-01 22:23:12 +00:00
Dale Johannesen
1ee5f128f6
Make ARM-specific version of getInlineAsmLength
...
llvm-svn: 36572
2007-04-29 19:17:45 +00:00
Anton Korobeynikov
3d95e52ea2
Implement protected visibility. This partly implements PR1363. Linker
...
should be taught to deal with protected symbols.
llvm-svn: 36565
2007-04-29 18:35:00 +00:00
Lauro Ramos Venancio
bc32d90b46
Implement "general dynamic", "initial exec" and "local exec" TLS models for
...
X86 32 bits.
llvm-svn: 36283
2007-04-20 21:38:10 +00:00
Evan Cheng
6bf2f3665e
Add ReadOnlySection directive.
...
llvm-svn: 35015
2007-03-08 01:00:38 +00:00
Anton Korobeynikov
090c2d50ea
Fix DWARF debugging information on x86/Linux and (hopefully)
...
Mingw32/Cygwin targets. This fixes PR978
llvm-svn: 35000
2007-03-07 02:47:57 +00:00
Jim Laskey
d1e09aa74a
Add TAI field for exception table section.
...
llvm-svn: 34477
2007-02-21 22:43:40 +00:00
Jim Laskey
52a12383a4
Support for non-landing pad exception handling.
...
llvm-svn: 33755
2007-02-01 16:31:34 +00:00
Jim Laskey
eba0cf04e5
Landing pad-less eh for PPC.
...
llvm-svn: 33622
2007-01-29 18:51:14 +00:00
Chris Lattner
e0c1ba6269
add new JumpTableSpecialLabelPrefix hook to asmprinter for jumptable emission.
...
llvm-svn: 33314
2007-01-18 01:12:56 +00:00