summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ELFTargetAsmInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
* remove the dead ELFTargetAsmInfo.h/cpp file. TargetAsmInfoChris Lattner2009-08-021-17/+0
| | | | | | defaults to being ELF. llvm-svn: 77866
* remove TargetAsmInfo::TM, which is now dead. The basic TAI class now Chris Lattner2009-08-021-4/+0
| | | | | | no longer depends on TM! llvm-svn: 77863
* Rip all of the global variable lowering logic out of TargetAsmInfo. SinceChris Lattner2009-07-281-213/+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. llvm-svn: 77294
* Sink getSectionPrefixForUniqueGlobal down into the TAI Chris Lattner2009-07-271-93/+106
| | | | | | implementations that need it, rearrange ELFTAI. llvm-svn: 77236
* inline a method.Chris Lattner2009-07-271-28/+24
| | | | llvm-svn: 77198
* sink text/data section creation down into the target-specific places that Chris Lattner2009-07-271-0/+3
| | | | | | | should know about them. PECoff doesn't share these, and I want all sections to be created by object-file-specific code. llvm-svn: 77196
* Eliminate getNamed/getUnnamedSection, adding a new and unified ↵Chris Lattner2009-07-271-19/+23
| | | | | | | | getOrCreateSection instead. llvm-svn: 77186
* Eliminate SectionFlags, just embed a SectionKind into SectionChris Lattner2009-07-271-47/+55
| | | | | | instead and drive things based off of that. llvm-svn: 77184
* untangle a TargetAsmInfo hack where ELFTargetAsmInfo would create aChris Lattner2009-07-261-3/+2
| | | | | | | | | '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
* remove a densemap from TargetAsmInfo that was uniquing the targetflags strings,Chris Lattner2009-07-261-27/+33
| | | | | | just use a smallstring instead. llvm-svn: 77144
* rename Mergable -> Mergeable and Writable -> WriteableChris Lattner2009-07-261-13/+13
| | | | llvm-svn: 77138
* simplify getSectionForMergableConstant to take a SectionKind.Chris Lattner2009-07-261-15/+2
| | | | llvm-svn: 77134
* precreate 4/8/16 byte mergable sections to simplify code.Chris Lattner2009-07-261-16/+19
| | | | llvm-svn: 77133
* introduce specialized mergable const sectionkinds for elements of size 4/8/16 toChris Lattner2009-07-261-2/+1
| | | | | | simplify targets. llvm-svn: 77132
* make elf targets correctly handle constant pool entries that require ↵Chris Lattner2009-07-261-2/+7
| | | | | | relocations. llvm-svn: 77130
* Rearrange all the SectionKinds and structure them into a hierarchicalChris Lattner2009-07-261-32/+33
| | | | | | | | | | | | | 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
* put normal data into .data instead of .data.rel on elf systems.Chris Lattner2009-07-261-21/+11
| | | | llvm-svn: 77116
* eliminate a pointless switch stmt.Chris Lattner2009-07-261-11/+2
| | | | llvm-svn: 77110
* make SectionKind be a first-class pod struct instead of justChris Lattner2009-07-251-4/+4
| | | | | | an enum. llvm-svn: 77096
* this is (unfortunately) several changes mixed together:Chris Lattner2009-07-251-8/+30
| | | | | | | | | | | | | | 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
* make SectionKindForGlobal target independent, and therefore non-virtual.Chris Lattner2009-07-241-29/+2
| | | | | | | | 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
* we already know the sectionkind when invoking SelectSectionForGlobal,Chris Lattner2009-07-241-3/+2
| | | | | | pass it in instead of recomputing it. llvm-svn: 76990
* move ELF-specific code into ELFTargetAsmInfo.Chris Lattner2009-07-241-0/+27
| | | | llvm-svn: 76976
* hoist section name uniquing logic up to the top-level SectionForGlobalChris Lattner2009-07-241-9/+0
| | | | | | implementation, eliminating a dupe. llvm-svn: 76953
* reduce indentationChris Lattner2009-07-241-35/+37
| | | | llvm-svn: 76951
* the 'isWeakForLinker' code is common between functions and globals, hoist itChris Lattner2009-07-241-55/+44
| | | | | | and simplify some other code. llvm-svn: 76949
* Replace UniqueSectionForGlobal with getSectionPrefixForUniqueGlobal.Chris Lattner2009-07-241-2/+4
| | | | | | | | 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
* fix indentation.Chris Lattner2009-07-241-14/+14
| | | | llvm-svn: 76945
* make Constant::getRelocationInfo return an enum, as suggested by Duncan.Chris Lattner2009-07-241-2/+2
| | | | llvm-svn: 76938
* Remove SectionKind::Small*. This was only used on mips, and is apparentlyChris Lattner2009-07-241-5/+0
| | | | | | a sad mistake that is regretted. :) llvm-svn: 76935
* remove SectionFlags::Small: it is only used on Xcore, and we'll findChris Lattner2009-07-221-2/+0
| | | | | | a better solution for it in the future. llvm-svn: 76818
* Revert commit 76707, it was breaking the llvm-gcc buildDuncan Sands2009-07-221-2/+1
| | | | | | | | on linux platforms. The binutils assembler does not recognize the "s" flag, see for example http://sourceware.org/binutils/docs/as/Section.html llvm-svn: 76733
* inline the two MergeableConstSection implementations into theirChris Lattner2009-07-221-8/+5
| | | | | | only caller. llvm-svn: 76710
* set the ELF "small" flag on objects that end up in .rodata.cst4 consistently,Chris Lattner2009-07-221-1/+2
| | | | | | updating a mips testcase to expect it. llvm-svn: 76707
* don't set the small flag yet.Chris Lattner2009-07-221-2/+1
| | | | llvm-svn: 76706
* remove the SelectSectionForMachineConst hook, replacing it withChris Lattner2009-07-221-18/+26
| | | | | | | | a new getSectionForMergableConstant hook. This removes one dependence of TAI on Type, and provides the hook with enough info to make the right decision based on whether the global has relocations etc. llvm-svn: 76705
* reimplement Constant::ContainsRelocations as Chris Lattner2009-07-221-9/+9
| | | | | | | | | Constant::getRelocationInfo(), which has a much simpler to use API. It still should not be part of libvmcore, but is better than it was. Also teach it to be smart about hidden visibility. llvm-svn: 76700
* simplify code now that it is inlined.Chris Lattner2009-07-211-4/+2
| | | | llvm-svn: 76689
* Now that RelocBehaviour() is never overloaded, it doesn't need to beChris Lattner2009-07-211-1/+7
| | | | | | | virtual. Just inline it into its two current call sites in preparation for simplifying the code. llvm-svn: 76686
* inline a trivial method into its only call site and fix indentation of casesChris Lattner2009-07-211-21/+16
| | | | llvm-svn: 76654
* Remove some overridden functions in XCoreTargetAsmInfo that areChris Lattner2009-07-211-3/+2
| | | | | | | implemented exactly the same way as its ELFTargetAsmInfo subclass has them. llvm-svn: 76653
* Add plumbing for the `linker_private' linkage type. This type is meant forBill Wendling2009-07-201-0/+1
| | | | | | | | | "private" symbols which the assember shouldn't strip, but which the linker may remove after evaluation. This is mostly useful for Objective-C metadata. This is plumbing, so we don't have a use of it yet. More to come, etc. llvm-svn: 76385
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-141-3/+3
| | | | | | | | | 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
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-111-3/+4
| | | | | | | | | 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
* Rename PaddedSize to AllocSize, in the hope that thisDuncan Sands2009-05-091-2/+2
| | | | | | | will make it more obvious what it represents, and stop it being confused with the StoreSize. llvm-svn: 71349
* Fix thinko: put stuff with both global and local relocations into ↵Anton Korobeynikov2009-03-301-3/+3
| | | | | | data.rel{.ro}, not .local llvm-svn: 68036
* Do not propagate ELF-specific stuff (data.rel) into other targets. This ↵Anton Korobeynikov2009-03-301-0/+24
| | | | | | simplifies code and also ensures correctness. llvm-svn: 68032
* Add data.rel stuffAnton Korobeynikov2009-03-301-0/+15
| | | | llvm-svn: 68031
* Introduce new linkage types linkonce_odr, weak_odr, common_odrDuncan Sands2009-03-071-3/+5
| | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 66339
* Treat [1 x i8] zeroinitializer as a C string, placing such stuff intoAnton Korobeynikov2009-01-271-2/+1
| | | | | | | | | | | | 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 :) llvm-svn: 63142
OpenPOWER on IntegriCloud