aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/TargetAsmInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename TargetFrameInfo into TargetFrameLowering. Also, put couple of FIXMEs ↵Anton Korobeynikov2011-01-101-1/+1
| | | | | | and fixes here and there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123170 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed version of 121434 with no new memory leaks.Rafael Espindola2010-12-101-0/+27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121471 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert my previous patch to make the valgrind bots happy.Rafael Espindola2010-12-101-27/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121461 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial support for the cfi directives. This is just enough to getRafael Espindola2010-12-091-0/+27
| | | | | | | | | | | f: .cfi_startproc nop .cfi_endproc assembled (on ELF). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121434 91177308-0d34-0410-b5e6-96231b3b80d8
* move the MCAsmInfo .cpp/.h files into the right Chris Lattner2009-08-221-113/+0
| | | | | | | | directories and rename them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79768 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.Chris Lattner2009-08-221-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79763 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove HasCrazyBSS and add a flag in TAI to indicate that '.section' Bruno Cardoso Lopes2009-08-131-0/+1
| | | | | | | must be emitted for PowerPC-Linux '.bss' section git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78958 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the asmprinter to print the comment character before theChris Lattner2009-08-111-2/+2
| | | | | | | | | | | "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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78737 91177308-0d34-0410-b5e6-96231b3b80d8
* split "JumpTableDirective" (an existing hack) into a PIC and nonPICChris Lattner2009-08-111-0/+1
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78709 91177308-0d34-0410-b5e6-96231b3b80d8
* SjLj based exception handling unwinding support. This patch is nasty, brutishJim Grosbach2009-08-111-1/+1
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78625 91177308-0d34-0410-b5e6-96231b3b80d8
* 1. Make MCSection an abstract class.Chris Lattner2009-08-081-1/+0
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78510 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate TargetLoweringObjectFileSparc in favor of a TAI hook.Chris Lattner2009-08-081-0/+1
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78498 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a bunch of now-dead crud from the asmprinter and TAI interfaces.Chris Lattner2009-08-071-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78428 91177308-0d34-0410-b5e6-96231b3b80d8
* remove the 'DataSectionStartSuffix' and 'TextSectionStartSuffix' knobs.Chris Lattner2009-08-051-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78242 91177308-0d34-0410-b5e6-96231b3b80d8
* rip out SectionEndDirectiveSuffix support, only uses byChris Lattner2009-08-041-1/+0
| | | | | | | | the masm backend. If anyone cares about masm in the future, we'll have semantic sections it can hang off of. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78096 91177308-0d34-0410-b5e6-96231b3b80d8
* move dwarf debug info section selection stuff from TAI toChris Lattner2009-08-021-12/+1
| | | | | | | TLOF, unifying all the dwarf targets at the same time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77889 91177308-0d34-0410-b5e6-96231b3b80d8
* convert EHFrameSection to be managed by TLOF instead of TAI.Chris Lattner2009-08-021-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77888 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the getInlineAsmLength virtual method from TAI to TII, whereChris Lattner2009-08-021-25/+0
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77877 91177308-0d34-0410-b5e6-96231b3b80d8
* remove TargetAsmInfo::TM, which is now dead. The basic TAI class now Chris Lattner2009-08-021-1/+1
| | | | | | | no longer depends on TM! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77863 91177308-0d34-0410-b5e6-96231b3b80d8
* clean up #includes of TargetAsmInfo.cppChris Lattner2009-08-021-11/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77858 91177308-0d34-0410-b5e6-96231b3b80d8
* remove the dead PreferredEHDataFormat TAI hook: its now deadChris Lattner2009-08-021-4/+0
| | | | | | | even considering #if 0 code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77856 91177308-0d34-0410-b5e6-96231b3b80d8
* move getDwarfExceptionSection from TAI to TLOF and rename it to Chris Lattner2009-08-021-1/+0
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77847 91177308-0d34-0410-b5e6-96231b3b80d8
* convert ctors/dtors section to be in TLOF instead ofChris Lattner2009-08-021-3/+0
| | | | | | | TAI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77842 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove "JumpTableDataSection" from TAI, instead, have AsmPrinterChris Lattner2009-08-011-1/+0
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77833 91177308-0d34-0410-b5e6-96231b3b80d8
* REmove dead fields of TAI.Chris Lattner2009-08-011-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77820 91177308-0d34-0410-b5e6-96231b3b80d8
* PreferredEHDataFormat is always call with data and global, but this wholeChris Lattner2009-07-311-2/+1
| | | | | | | | thing is #if0'd out anyway. Just simplify the code by reducing the interface. Not deleting this is essential for Bill's continuing happiness. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77736 91177308-0d34-0410-b5e6-96231b3b80d8
* Rip all of the global variable lowering logic out of TargetAsmInfo. SinceChris Lattner2009-07-281-218/+0
| | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77294 91177308-0d34-0410-b5e6-96231b3b80d8
* Sink getSectionPrefixForUniqueGlobal down into the TAI Chris Lattner2009-07-271-9/+0
| | | | | | | implementations that need it, rearrange ELFTAI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77236 91177308-0d34-0410-b5e6-96231b3b80d8
* add an explanatory comment about why we drop these in readonly andChris Lattner2009-07-271-2/+6
| | | | | | | not in mergable git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77210 91177308-0d34-0410-b5e6-96231b3b80d8
* don't create default text/data sections for all targets.Chris Lattner2009-07-271-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77203 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate getNamed/getUnnamedSection, adding a new and unified ↵Chris Lattner2009-07-271-21/+8
| | | | | | | | | getOrCreateSection instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77186 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate SectionFlags, just embed a SectionKind into SectionChris Lattner2009-07-271-34/+10
| | | | | | | instead and drive things based off of that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77184 91177308-0d34-0410-b5e6-96231b3b80d8
* untangle a TargetAsmInfo hack where ELFTargetAsmInfo would create aChris Lattner2009-07-261-6/+5
| | | | | | | | | | | '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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77165 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a densemap from TargetAsmInfo that was uniquing the targetflags strings,Chris Lattner2009-07-261-13/+0
| | | | | | | just use a smallstring instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77144 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify SectionFlagsForGlobal, even though I want to kill it.Chris Lattner2009-07-261-6/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77143 91177308-0d34-0410-b5e6-96231b3b80d8
* make SectionKind keep track of whether a global had an explicitChris Lattner2009-07-261-21/+24
| | | | | | | section specified for it or not. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77142 91177308-0d34-0410-b5e6-96231b3b80d8
* make SectionKind know whether a symbol is weak or not in additionChris Lattner2009-07-261-17/+18
| | | | | | | to its classification. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77140 91177308-0d34-0410-b5e6-96231b3b80d8
* rename Mergable -> Mergeable and Writable -> WriteableChris Lattner2009-07-261-7/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77138 91177308-0d34-0410-b5e6-96231b3b80d8
* remove a bunch of helper functions, just use SectionKind::get instead.Chris Lattner2009-07-261-20/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77135 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify getSectionForMergableConstant to take a SectionKind.Chris Lattner2009-07-261-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77134 91177308-0d34-0410-b5e6-96231b3b80d8
* introduce specialized mergable const sectionkinds for elements of size 4/8/16 toChris Lattner2009-07-261-4/+14
| | | | | | | simplify targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77132 91177308-0d34-0410-b5e6-96231b3b80d8
* improve the default impl of getSectionForMergableConstant byChris Lattner2009-07-261-2/+4
| | | | | | | putting readonly constants in the readonly section if we have one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77131 91177308-0d34-0410-b5e6-96231b3b80d8
* Rearrange all the SectionKinds and structure them into a hierarchicalChris Lattner2009-07-261-12/+14
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77129 91177308-0d34-0410-b5e6-96231b3b80d8
* make SectionKind be a first-class pod struct instead of justChris Lattner2009-07-251-27/+31
| | | | | | | an enum. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77096 91177308-0d34-0410-b5e6-96231b3b80d8
* this is (unfortunately) several changes mixed together:Chris Lattner2009-07-251-58/+27
| | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77085 91177308-0d34-0410-b5e6-96231b3b80d8
* document some invariants.Chris Lattner2009-07-251-1/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77084 91177308-0d34-0410-b5e6-96231b3b80d8
* add the most expedient hack to fix PR4619, along with a testcase.Chris Lattner2009-07-251-0/+5
| | | | | | | Thanks to Rafael for the great example. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77083 91177308-0d34-0410-b5e6-96231b3b80d8
* fix some predicatesChris Lattner2009-07-241-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76999 91177308-0d34-0410-b5e6-96231b3b80d8
* change SectionKindForGlobal from being a public (andChris Lattner2009-07-241-17/+9
| | | | | | | | previously virtual) function to being a static function in the .cpp file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76997 91177308-0d34-0410-b5e6-96231b3b80d8
* make SectionKindForGlobal target independent, and therefore non-virtual.Chris Lattner2009-07-241-20/+59
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76993 91177308-0d34-0410-b5e6-96231b3b80d8