summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetLoweringObjectFile.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* If ELF subtargets don't want to support 4/8/16-byte mergable sections, allow Chris Lattner2009-08-151-3/+3
| | | | | | them to null out the default section pointers. llvm-svn: 79078
* Make these matching rules more strict so that they don'tDan Gohman2009-08-141-3/+3
| | | | | | accidentally match unrelated things. llvm-svn: 78966
* Remove HasCrazyBSS and add a flag in TAI to indicate that '.section' Bruno Cardoso Lopes2009-08-131-2/+2
| | | | | | must be emitted for PowerPC-Linux '.bss' section llvm-svn: 78958
* Change MCSectionELF to represent a section semantically instead ofBruno Cardoso Lopes2009-08-131-58/+162
| | | | | | | syntactically as a string, very similiar to what Chris did with MachO. The parsing support and validation is not introduced yet. llvm-svn: 78890
* sink uniquing of sections out of MCContext into the ELF and PECOFF TLOF ↵Chris Lattner2009-08-131-6/+32
| | | | | | | | implementations. MCContext no longer maintains a string -> section map. llvm-svn: 78874
* add some comments: MCContext owns the MCSections, but it bump pointer allocatesChris Lattner2009-08-131-2/+0
| | | | | | them, so it doesn't have to explicitly free them. llvm-svn: 78870
* reject invalid code like:Chris Lattner2009-08-131-27/+34
| | | | | | | int x __attribute__((section("_foo, _bar"))) = 4; int y __attribute__((section("_foo, _bar, 4byte_literals"))) = 1; llvm-svn: 78867
* implement support for uniquing MachO sections.Chris Lattner2009-08-121-8/+31
| | | | llvm-svn: 78866
* reduce #includageChris Lattner2009-08-121-1/+1
| | | | llvm-svn: 78860
* Tidy #includes.Dan Gohman2009-08-111-0/+1
| | | | llvm-svn: 78677
* split MachO section handling stuff out to its out .h/.cpp file.Chris Lattner2009-08-101-1/+1
| | | | llvm-svn: 78576
* Make the big switch: Change MCSectionMachO to represent a section *semantically*Chris Lattner2009-08-101-61/+119
| | | | | | | | | | | | | | | | instead of syntactically as a string. This means that it keeps track of the segment, section, flags, etc directly and asmprints them in the right format. This also includes parsing and validation support for llvm-mc and "attribute(section)", so we should now start getting errors about invalid section attributes from the compiler instead of the assembler on darwin. Still todo: 1) Uniquing of darwin mcsections 2) Move all the Darwin stuff out to MCSectionMachO.[cpp|h] 3) there are a few FIXMEs, for example what is the syntax to get the S_GB_ZEROFILL segment type? llvm-svn: 78547
* 1. Make MCSection an abstract class.Chris Lattner2009-08-081-100/+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. llvm-svn: 78510
* make target-specific TLOF impls (except PIC16) create target-specificChris Lattner2009-08-081-3/+3
| | | | | | MCSection instances. llvm-svn: 78500
* eliminate TargetLoweringObjectFileSparc in favor of a TAI hook.Chris Lattner2009-08-081-3/+23
| | | | | | | | 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
* now that getOrCreateSection is all object-file specific,Chris Lattner2009-08-081-138/+122
| | | | | | | give the impls an object-file-specific name. In the future they can take different arguments etc. llvm-svn: 78495
* sink getOrCreateSection down into all the object file implementations,Chris Lattner2009-08-081-8/+21
| | | | | | now that they create *all* the sections. llvm-svn: 78494
* Fix several fixmes and clean up code by sinking *all* sectionChris Lattner2009-08-061-16/+29
| | | | | | | | | | | | | | | | | creation activity into the target-specific subclasses of TLOF. Before this, globals with explicit sections could be created by the base class. 1. make getOrCreateSection protected, add a new getExplicitSectionGlobal pure virtual method to assign sections to globals with a specified section. 2. eliminate getSpecialCasedSectionGlobals, which is now PIC specific. 3. eliminate the getKindForNamedSection virtual method, which is now just a static method for ELF. 4. Add implementions of getExplicitSectionGlobal for ELF/PECOFF/Darwin/PIC16. They are now all detangled and understandable, woo! :) llvm-svn: 78319
* expose SectionKindForGlobal to curious clients, named asChris Lattner2009-08-051-9/+8
| | | | | | getKindForGlobal. llvm-svn: 78156
* enhance codegen to put 16-bit character strings into the Chris Lattner2009-08-041-17/+15
| | | | | | __TEXT,__ustring section on darwin. llvm-svn: 78068
* fix a fixme: don't create an explicit "CStringSection" for ELF,Chris Lattner2009-08-041-9/+4
| | | | | | it is just being used as a prefix, so forward substitute it directly. llvm-svn: 78067
* Add support emiting for 2/4 byte mergable strings to the ".rodata.str*"Chris Lattner2009-08-041-12/+39
| | | | | | section on ELF targets. llvm-svn: 78066
* make MergeableCString be a SectionKind "abstract class", andChris Lattner2009-08-041-13/+35
| | | | | | | | add new concrete versions for 1/2/4-byte mergable strings. These are not actually created yet. llvm-svn: 78055
* Eliminate textual section switching from the x86 backend, oneChris Lattner2009-08-031-0/+13
| | | | | | more step towards "semantics sections" llvm-svn: 78002
* move dwarf debug info section selection stuff from TAI toChris Lattner2009-08-021-0/+116
| | | | | | TLOF, unifying all the dwarf targets at the same time. llvm-svn: 77889
* convert EHFrameSection to be managed by TLOF instead of TAI.Chris Lattner2009-08-021-0/+6
| | | | llvm-svn: 77888
* move getDwarfExceptionSection from TAI to TLOF and rename it to Chris Lattner2009-08-021-0/+11
| | | | | | | | | | | 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
* convert ctors/dtors section to be in TLOF instead ofChris Lattner2009-08-021-0/+24
| | | | | | TAI. llvm-svn: 77842
* (re)introduce new simpler apis for creation sectionkinds.Chris Lattner2009-08-011-56/+50
| | | | llvm-svn: 77834
* Remove "JumpTableDataSection" from TAI, instead, have AsmPrinterChris Lattner2009-08-011-7/+5
| | | | | | | | | | | | 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
* fix a fixme by sinking various target-specific directives down into Chris Lattner2009-08-011-16/+13
| | | | | | the appropriate subclasses. llvm-svn: 77815
* coff also doesn't have a ReadOnlySection yet, (!)Chris Lattner2009-08-011-3/+0
| | | | llvm-svn: 77814
* coff doesn't set a .bss seciton, so this is dead.Chris Lattner2009-08-011-3/+0
| | | | llvm-svn: 77813
* it turns out that isWeak() was basically dead anyway. Kill off SectionInfo :-/Chris Lattner2009-08-011-44/+43
| | | | llvm-svn: 77812
* don't use isWeak anymore.Chris Lattner2009-08-011-4/+4
| | | | llvm-svn: 77810
* Change SectionKind to be a property that is true of a *section*, itChris Lattner2009-08-011-114/+132
| | | | | | | | | | | | | | | | | | should have no state that is specific to particular globals in the section. In this case, it means the removal of the "isWeak" and "ExplicitSection" bits. MCSection uses the new form of SectionKind. To handle isWeak, I introduced a new SectionInfo class, which is SectionKind + isWeak, and it is used by the part of the code generator that does classification of a specific global. The ExplicitSection disappears. It is moved onto MCSection as a new "IsDirective" bit. Since the Name of a section is either a section or directive, it makes sense to keep this bit in MCSection. Ultimately the creator of MCSection should canonicalize (e.g.) .text to whatever the actual section is. llvm-svn: 77803
* All MCSections are now required to have a SectionKind.Chris Lattner2009-08-011-1/+1
| | | | llvm-svn: 77787
* move emitUsedDirectiveFor to TargetLoweringObjectFile and rename it toChris Lattner2009-07-311-0/+23
| | | | | | | indicate that it is a predicate, not an emitter. This eliminates TAI dependencies on Mangler and GlobalValue. llvm-svn: 77726
* switch off of 'Section' onto MCSection. We're not properly usingChris Lattner2009-07-311-24/+23
| | | | | | MCSection subclasses yet, but this is a step in the right direction. llvm-svn: 77708
* refactor section construction in TLOF to be through an explicitChris Lattner2009-07-311-7/+6
| | | | | | initialize method, which can be called when an MCContext is available. llvm-svn: 77687
* fix PR4650: we only track sizes for certain objects, so only put somethingChris Lattner2009-07-311-1/+4
| | | | | | | | into the mergable section if it is one of our special cases. This could obviously be improved, but this is the minimal fix and restores us to the previous behavior. llvm-svn: 77679
* mingw uses .data and .text, not _data and _text.Chris Lattner2009-07-291-2/+2
| | | | llvm-svn: 77435
* fix PR4584 with a trivial patch now that the pieces are in place.Chris Lattner2009-07-291-3/+3
| | | | llvm-svn: 77434
* pass the mangler down into the various SectionForGlobal methods.Chris Lattner2009-07-291-9/+11
| | | | | | No functionality change. llvm-svn: 77432
* constant prop a utostr.Chris Lattner2009-07-291-2/+1
| | | | llvm-svn: 77430
* remove some completely wrong code. 1 is never < 16. It turns out that GCC ↵Chris Lattner2009-07-291-20/+10
| | | | | | appears to put strings of any length into the ELF cstring equivalent, so just rip out the code. llvm-svn: 77429
* Fix PR4639, a ELF-TLS regression from some of my refactoring.Chris Lattner2009-07-281-1/+1
| | | | llvm-svn: 77336
* the apple "ld_classic" linker doesn't support .literal16 in 32-bitChris Lattner2009-07-281-5/+12
| | | | | | | mode, and "ld64" (the default linker) falls back to it in -static mode. llvm-svn: 77334
* fix unused variable warningChris Lattner2009-07-281-1/+1
| | | | llvm-svn: 77326
* Rip all of the global variable lowering logic out of TargetAsmInfo. SinceChris Lattner2009-07-281-0/+647
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
OpenPOWER on IntegriCloud