1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

186 Commits

Author SHA1 Message Date
Anton Korobeynikov
cf5967630b Rename TargetFrameInfo into TargetFrameLowering. Also, put couple of FIXMEs and fixes here and there.
llvm-svn: 123170
2011-01-10 12:39:04 +00:00
Rafael Espindola
0e665e502d Fixed version of 121434 with no new memory leaks.
llvm-svn: 121471
2010-12-10 07:39:47 +00:00
Rafael Espindola
011e168728 Revert my previous patch to make the valgrind bots happy.
llvm-svn: 121461
2010-12-10 04:01:09 +00:00
Rafael Espindola
03ad1e8f1f Initial support for the cfi directives. This is just enough to get
f:
        .cfi_startproc
        nop
        .cfi_endproc

assembled (on ELF).

llvm-svn: 121434
2010-12-09 23:48:29 +00:00
Chris Lattner
9f2ba3294f move the MCAsmInfo .cpp/.h files into the right
directories and rename them.

llvm-svn: 79768
2009-08-22 20:58:17 +00:00
Chris Lattner
5d8af49626 Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.
llvm-svn: 79763
2009-08-22 20:48:53 +00:00
Bruno Cardoso Lopes
98ffbd5041 Remove HasCrazyBSS and add a flag in TAI to indicate that '.section'
must be emitted for PowerPC-Linux '.bss' section

llvm-svn: 78958
2009-08-13 23:30:21 +00:00
Chris Lattner
a74023896f Change the asmprinter to print the comment character before the
"inlineasmstart/end" strings so that the contents of the directive
are separate from the comment character.  This lets elf targets
get #APP/#NOAPP for free even if they don't use "#" as the comment
character.  This also allows hoisting the darwin stuff up to the
shared TAI class.

llvm-svn: 78737
2009-08-11 22:39:40 +00:00
Chris Lattner
45bdc96988 split "JumpTableDirective" (an existing hack) into a PIC and nonPIC
version.  This allows TAI implementations to specify the directive to use
based on the mode being codegen'd for.

The real fix for this is to remove JumpTableDirective, but I don't feel
like diving into the jumptable snarl just now.

llvm-svn: 78709
2009-08-11 20:30:58 +00:00
Jim Grosbach
c9a1dd9291 SjLj based exception handling unwinding support. This patch is nasty, brutish
and short. Well, it's kinda short. Definitely nasty and brutish.

The front-end generates the register/unregister calls into the SjLj runtime,
call-site indices and landing pad dispatch. The back end fills in the LSDA
with the call-site information provided by the front end. Catch blocks are
not yet implemented.

Built on Darwin and verified no llvm-core "make check" regressions.

llvm-svn: 78625
2009-08-11 00:09:57 +00:00
Chris Lattner
2849883bd5 1. Make MCSection an abstract class.
2. Move section switch printing to MCSection virtual method which takes a
   TAI.  This eliminates textual formatting stuff from TLOF.
3. Eliminate SwitchToSectionDirective, getSectionFlagsAsString, and 
   TLOFELF::AtIsCommentChar.

llvm-svn: 78510
2009-08-08 22:41:53 +00:00
Chris Lattner
1c704ad33e eliminate TargetLoweringObjectFileSparc in favor of a TAI hook.
A TAI hook is appropriate in this case because this is just an
asm syntax issue, not a semantic difference. TLOF should model
the semantics of the section.

llvm-svn: 78498
2009-08-08 20:43:12 +00:00
Chris Lattner
bdb5a03875 remove a bunch of now-dead crud from the asmprinter and TAI interfaces.
llvm-svn: 78428
2009-08-07 23:16:27 +00:00
Chris Lattner
8a74485e06 remove the 'DataSectionStartSuffix' and 'TextSectionStartSuffix' knobs.
llvm-svn: 78242
2009-08-05 20:49:52 +00:00
Chris Lattner
87372c0978 rip out SectionEndDirectiveSuffix support, only uses by
the masm backend.  If anyone cares about masm in the future,
we'll have semantic sections it can hang off of.

llvm-svn: 78096
2009-08-04 20:09:41 +00:00
Chris Lattner
738a9ba448 move dwarf debug info section selection stuff from TAI to
TLOF, unifying all the dwarf targets at the same time.

llvm-svn: 77889
2009-08-02 07:24:22 +00:00
Chris Lattner
6f4a366e35 convert EHFrameSection to be managed by TLOF instead of TAI.
llvm-svn: 77888
2009-08-02 06:52:36 +00:00
Chris Lattner
c388490738 Move the getInlineAsmLength virtual method from TAI to TII, where
the only real caller (GetFunctionSizeInBytes) uses it.

The custom ARM implementation of this is basically reimplementing
an assembler poorly for negligible gain.  It should be removed 
IMNSHO, but I'll leave that to ARMish folks to decide.

llvm-svn: 77877
2009-08-02 05:20:37 +00:00
Chris Lattner
b5ceb50677 remove TargetAsmInfo::TM, which is now dead. The basic TAI class now
no longer depends on TM!

llvm-svn: 77863
2009-08-02 04:27:24 +00:00
Chris Lattner
fc452eb48b clean up #includes of TargetAsmInfo.cpp
llvm-svn: 77858
2009-08-02 04:09:22 +00:00
Chris Lattner
d2477587b9 remove the dead PreferredEHDataFormat TAI hook: its now dead
even considering #if 0 code.

llvm-svn: 77856
2009-08-02 04:02:52 +00:00
Chris Lattner
1c44a63eba move getDwarfExceptionSection from TAI to TLOF and rename it to
getLSDASection() to be more specific.  This makes it pretty obvious
that the ELF LSDA section is being specified wrong in PIC mode.  We're
probably getting a lot of startup-time relocations to a readonly page,
which is expensive and bad.

Someone who cares about ELF C++ should investigate this.

llvm-svn: 77847
2009-08-02 01:34:32 +00:00
Chris Lattner
06d8ca1f56 convert ctors/dtors section to be in TLOF instead of
TAI.

llvm-svn: 77842
2009-08-02 00:34:36 +00:00
Chris Lattner
81229d1bed Remove "JumpTableDataSection" from TAI, instead, have AsmPrinter
compute it based on what it knows.  As part of this, rename getSectionForMergeableConstant
to getSectionForConstant because it works for non-mergable constants also.

The only functionality change from this is that Xcore will start dropping
its jump tables into readonly section instead of data section in -static mode.
This should be fine as the linker resolves the relocations.  If this is a
problem, let me know and we'll come up with another solution.

llvm-svn: 77833
2009-08-01 23:46:12 +00:00
Chris Lattner
4cbb1c0c3f REmove dead fields of TAI.
llvm-svn: 77820
2009-08-01 22:40:22 +00:00
Chris Lattner
882b1208e1 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
Chris Lattner
55461787cc 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
674e5fa434 Sink getSectionPrefixForUniqueGlobal down into the TAI
implementations that need it, rearrange ELFTAI.

llvm-svn: 77236
2009-07-27 19:14:14 +00:00
Chris Lattner
60c53ef86b add an explanatory comment about why we drop these in readonly and
not in mergable

llvm-svn: 77210
2009-07-27 17:39:40 +00:00
Chris Lattner
90a2885055 don't create default text/data sections for all targets.
llvm-svn: 77203
2009-07-27 16:44:04 +00:00
Chris Lattner
cd7d963b75 Eliminate getNamed/getUnnamedSection, adding a new and unified getOrCreateSection
instead.

llvm-svn: 77186
2009-07-27 06:17:14 +00:00
Chris Lattner
a2b00bdd7a 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
0f4d60ca90 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
9104e8d808 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
090aa4b8f4 simplify SectionFlagsForGlobal, even though I want to kill it.
llvm-svn: 77143
2009-07-26 07:17:39 +00:00
Chris Lattner
b508741de0 make SectionKind keep track of whether a global had an explicit
section specified for it or not.

llvm-svn: 77142
2009-07-26 07:14:28 +00:00
Chris Lattner
41570cf306 make SectionKind know whether a symbol is weak or not in addition
to its classification.

llvm-svn: 77140
2009-07-26 07:00:12 +00:00
Chris Lattner
61e4445f5a rename Mergable -> Mergeable and Writable -> Writeable
llvm-svn: 77138
2009-07-26 06:48:26 +00:00
Chris Lattner
e2a16438a6 remove a bunch of helper functions, just use SectionKind::get instead.
llvm-svn: 77135
2009-07-26 06:34:33 +00:00
Chris Lattner
1f709a74f6 simplify getSectionForMergableConstant to take a SectionKind.
llvm-svn: 77134
2009-07-26 06:26:55 +00:00
Chris Lattner
e8b2f94ce2 introduce specialized mergable const sectionkinds for elements of size 4/8/16 to
simplify targets.

llvm-svn: 77132
2009-07-26 06:11:33 +00:00
Chris Lattner
736f3d6eb5 improve the default impl of getSectionForMergableConstant by
putting readonly constants in the readonly section if we have one.

llvm-svn: 77131
2009-07-26 05:57:07 +00:00
Chris Lattner
b3d6d59c10 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
fda0ca90c1 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
15b3d2039f 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
edbf2e64cb document some invariants.
llvm-svn: 77084
2009-07-25 18:11:58 +00:00
Chris Lattner
cf7cc0ed7d add the most expedient hack to fix PR4619, along with a testcase.
Thanks to Rafael for the great example.

llvm-svn: 77083
2009-07-25 17:57:37 +00:00
Chris Lattner
50d9b68935 fix some predicates
llvm-svn: 76999
2009-07-24 20:27:11 +00:00
Chris Lattner
89b6f54999 change SectionKindForGlobal from being a public (and
previously virtual) function to being a static function
in the .cpp file.

llvm-svn: 76997
2009-07-24 20:14:10 +00:00
Chris Lattner
3d63455016 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