summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Move Object format code to lib/BinaryFormat.Zachary Turner2017-06-071-1/+1
| | | | | | | | | | | | This creates a new library called BinaryFormat that has all of the headers from llvm/Support containing structure and layout definitions for various types of binary formats like dwarf, coff, elf, etc as well as the code for identifying a file from its magic. Differential Revision: https://reviews.llvm.org/D33843 llvm-svn: 304864
* Target: Change various section classifiers in TargetLoweringObjectFile to ↵Peter Collingbourne2016-10-241-6/+6
| | | | | | | | | | | | | | | | take a GlobalObject. These functions are about classifying a global which will actually be emitted, so it does not make sense for them to take a GlobalValue which may for example be an alias. Change the Mach-O object writer and the Hexagon, Lanai and MIPS backends to look through aliases before using TargetLoweringObjectFile interfaces. These are functional changes but all appear to be bug fixes. Differential Revision: https://reviews.llvm.org/D25917 llvm-svn: 285006
* Move the Mangler from the AsmPrinter down to TLOF and clean up theEric Christopher2016-09-161-8/+4
| | | | | | TLOF API accordingly. llvm-svn: 281708
* Unbreak non-X86 targets from fallout caused by r261462David Majnemer2016-02-211-2/+4
| | | | llvm-svn: 261463
* GlobalValue: use getValueType() instead of getType()->getPointerElementType().Manuel Jacob2016-01-161-1/+1
| | | | | | | | | | | | Reviewers: mjacob Subscribers: jholewinski, arsenm, dsanders, dblaikie Patch by Eduard Burtescu. Differential Revision: http://reviews.llvm.org/D16260 llvm-svn: 257999
* Stop producing .data.rel sections.Rafael Espindola2015-11-181-2/+4
| | | | | | | | | | | | | | | | | If a section is rw, it is irrelevant if the dynamic linker will write to it or not. It looks like llvm implemented this because gcc was doing it. It looks like gcc implemented this in the hope that it would put all the relocated items close together and speed up the dynamic linker. There are two problem with this: * It doesn't work. Both bfd and gold will map .data.rel to .data and concatenate the input sections in the order they are seen. * If we want a feature like that, it can be implemented directly in the linker since it knowns where the dynamic relocations are. llvm-svn: 253436
* Move most user of TargetMachine::getDataLayout to the Module oneMehdi Amini2015-07-161-1/+2
| | | | | | | | | | | | | | | | | | | | | Summary: This change is part of a series of commits dedicated to have a single DataLayout during compilation by using always the one owned by the module. This patch is quite boring overall, except for some uglyness in ASMPrinter which has a getDataLayout function but has some clients that use it without a Module (llmv-dsymutil, llvm-dwarfdump), so some methods are taking a DataLayout as parameter. Reviewers: echristo Subscribers: yaron.keren, rafael, llvm-commits, jholewinski Differential Revision: http://reviews.llvm.org/D11090 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 242386
* Remove DataLayout from TargetLoweringObjectFile, redirect to ModuleMehdi Amini2015-07-161-3/+2
| | | | | | | | | | | | | | | | Summary: This change is part of a series of commits dedicated to have a single DataLayout during compilation by using always the one owned by the module. Reviewers: echristo Subscribers: yaron.keren, rafael, llvm-commits, jholewinski Differential Revision: http://reviews.llvm.org/D11079 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 242385
* Move alignment from MCSectionData to MCSection.Rafael Espindola2015-05-211-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | This starts merging MCSection and MCSectionData. There are a few issues with the current split between MCSection and MCSectionData. * It optimizes the the not as important case. We want the production of .o files to be really fast, but the split puts the information used for .o emission in a separate data structure. * The ELF/COFF/MachO hierarchy is not represented in MCSectionData, leading to some ad-hoc ways to represent the various flags. * It makes it harder to remember where each item is. The attached patch starts merging the two by moving the alignment from MCSectionData to MCSection. Most of the patch is actually just dropping 'const', since MCSectionData is mutable, but MCSection was not. llvm-svn: 237936
* Compute the ELF SectionKind from the flags.Rafael Espindola2015-01-291-58/+35
| | | | | | | | | | | | Any code creating an MCSectionELF knows ELF and already provides the flags. SectionKind is an abstraction used by common code that uses a plain MCSection. Use the flags to compute the SectionKind. This removes a lot of guessing and boilerplate from the MCSectionELF construction. llvm-svn: 227476
* Move DataLayout back to the TargetMachine from TargetSubtargetInfoEric Christopher2015-01-261-2/+1
| | | | | | | | | | | | | | | | | | | derived classes. Since global data alignment, layout, and mangling is often based on the DataLayout, move it to the TargetMachine. This ensures that global data is going to be layed out and mangled consistently if the subtarget changes on a per function basis. Prior to this all targets(*) have had subtarget dependent code moved out and onto the TargetMachine. *One target hasn't been migrated as part of this change: R600. The R600 port has, as a subtarget feature, the size of pointers and this affects global data layout. I've currently hacked in a FIXME to enable progress, but the port needs to be updated to either pass the 64-bitness to the TargetMachine, or fix the DataLayout to avoid subtarget dependent features. llvm-svn: 227113
* Remove the TargetMachine forwards for TargetSubtargetInfo basedEric Christopher2014-08-041-3/+3
| | | | | | information and update all callers. No functional change. llvm-svn: 214781
* CodeGen: Stick constant pool entries in COMDAT sections for WinCOFFDavid Majnemer2014-07-141-2/+3
| | | | | | | | | | | | | | | | COFF lacks a feature that other object file formats support: mergeable sections. To work around this, MSVC sticks constant pool entries in special COMDAT sections so that each constant is in it's own section. This permits unused constants to be dropped and it also allows duplicate constants in different translation units to get merged together. This fixes PR20262. Differential Revision: http://reviews.llvm.org/D4482 llvm-svn: 213006
* Add back r201608, r201622, r201624 and r201625Rafael Espindola2014-02-191-3/+4
| | | | | | | | | | | | | | r201608 made llvm corretly handle private globals with MachO. r201622 fixed a bug in it and r201624 and r201625 were changes for using private linkage, assuming that llvm would do the right thing. They all got reverted because r201608 introduced a crash in LTO. This patch includes a fix for that. The issue was that TargetLoweringObjectFile now has to be initialized before we can mangle names of private globals. This is trivially true during the normal codegen pipeline (the asm printer does it), but LTO has to do it manually. llvm-svn: 201700
* Revert r201622 and r201608.Daniel Jasper2014-02-191-4/+3
| | | | | | | This causes the LLVMgold plugin to segfault. More information on the replies to r201608. llvm-svn: 201669
* Fix PR18743.Rafael Espindola2014-02-181-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | The IR @foo = private constant i32 42 is valid, but before this patch we would produce an invalid MachO from it. It was invalid because it would use an L label in a section where the liker needs the labels in order to atomize it. One way of fixing it would be to just reject this IR in the backend, but that would not be very front end friendly. What this patch does is use an 'l' prefix in sections that we know the linker requires symbols for atomizing them. This allows frontends to just use private and not worry about which sections they go to or how the linker handles them. One small issue with this strategy is that now a symbol name depends on the section, which is not available before codegen. This is not a problem in practice. The reason is that it only happens with private linkage, which will be ignored by the non codegen users (llvm-nm and llvm-ar). llvm-svn: 201608
* XCore target: Handle common linkageRobert Lytton2014-02-181-2/+2
| | | | llvm-svn: 201563
* XCore target: fix const section handlingRobert Lytton2014-02-111-27/+35
| | | | | | | | | | | | Xcore target ABI requires const data that is externally visible to be handled differently if it has C-language linkage rather than C++ language linkage. Clang now emits ".cp.rodata" section information. All other externally visible constant data will be placed in the DP section. llvm-svn: 201144
* Pass the Mangler by reference.Rafael Espindola2014-02-081-2/+2
| | | | | | | It is never null and it is not used in casts, so there is no reason to use a pointer. This matches how we pass TM. llvm-svn: 201025
* Revert r199871 and replace it with a simple check in the debug infoEric Christopher2014-01-281-1/+1
| | | | | | | | | code to see if we're emitting a function into a non-default text section. This is still a less-than-ideal solution, but more contained than r199871 to determine whether or not we're emitting code into an array of comdat sections. llvm-svn: 200269
* Add a variable to track whether or not we've used a unique section,Eric Christopher2014-01-231-1/+1
| | | | | | | | | | | | e.g. linkonce, to TargetMachine and set it when we've done so for ELF targets currently. This involved making TargetMachine non-const in a TLOF use and propagating that change around - I'm open to other ideas. This will be used in a future commit to handle emitting debug information with ranges. llvm-svn: 199871
* XCore target: Add large code modelRobert Lytton2013-12-021-15/+124
| | | | | | | | | | | | | | | | When using large code model: Global objects larger than 'CodeModelLargeSize' bytes are placed in sections named with a trailing ".large" The folded global address of such objects are lowered into the const pool. During inspection it was noted that LowerConstantPool() was using a default offset of zero. A fix was made, but due to only offsets of zero being generated, testing only verifies the change is not detrimental. Correct the flags emitted for explicitly specified sections. We assume the size of the object queried by getSectionForConstant() is never greater than CodeModelLargeSize. To handle greater than CodeModelLargeSize, changes to AsmPrinter would be required. llvm-svn: 196087
* [XCore] Use static relocation model by default.Richard Osborne2013-05-041-5/+0
| | | | | | | This allows us to get get rid of a hack in XCoreTargetObjectFile where the the DataRel* sections were overridden. llvm-svn: 181116
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-1/+1
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Remove more duplicated code.Rafael Espindola2011-01-231-12/+12
| | | | llvm-svn: 124056
* Remove duplicated code.Rafael Espindola2011-01-231-6/+7
| | | | llvm-svn: 124054
* Remove some explicit arguments to getELFSection. This isRafael Espindola2010-11-111-6/+6
| | | | | | a leftover from the removal of isExplicit. llvm-svn: 118774
* move elf section uniquing to MCContext. Along the wayChris Lattner2010-04-081-29/+26
| | | | | | merge XCore's section into MCSectionELF llvm-svn: 100812
* Remove xs1a subtarget. xs1a is a preproduction device used inRichard Osborne2009-10-061-14/+7
| | | | | | | early development boards which is no longer supported in the XMOS toolchain. llvm-svn: 83381
* Add support for mergeable sections back into the XCore backend.Richard Osborne2009-08-181-5/+18
| | | | llvm-svn: 79368
* Put data with relocations in the same sections as data without relocations.Richard Osborne2009-08-181-1/+7
| | | | llvm-svn: 79351
* use XCore-specific section with xcore specific cp/dp flags to restore Chris Lattner2009-08-151-14/+26
| | | | | | | | support for globals going into the appropriate sections with the flags. This hopefully finishes unbreaking the previous behavior that I broke before. llvm-svn: 79079
* Change MCSectionELF to represent a section semantically instead ofBruno Cardoso Lopes2009-08-131-7/+14
| | | | | | | syntactically as a string, very similiar to what Chris did with MachO. The parsing support and validation is not introduced yet. llvm-svn: 78890
* now that getOrCreateSection is all object-file specific,Chris Lattner2009-08-081-10/+7
| | | | | | | give the impls an object-file-specific name. In the future they can take different arguments etc. llvm-svn: 78495
* Make SectionKind::get() private.Chris Lattner2009-08-021-5/+5
| | | | llvm-svn: 77835
* update for renameChris Lattner2009-08-011-3/+3
| | | | llvm-svn: 77817
* Change SectionKind to be a property that is true of a *section*, itChris Lattner2009-08-011-5/+8
| | | | | | | | | | | | | | | | | | 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
* Add newline at end of file to remove gcc warning.Nick Lewycky2009-08-011-1/+1
| | | | llvm-svn: 77791
* switch off of 'Section' onto MCSection. We're not properly usingChris Lattner2009-07-311-3/+7
| | | | | | MCSection subclasses yet, but this is a step in the right direction. llvm-svn: 77708
* Change ConstantArray to 2.5 API.Owen Anderson2009-07-281-1/+1
| | | | llvm-svn: 77347
* Rip all of the global variable lowering logic out of TargetAsmInfo. SinceChris Lattner2009-07-281-0/+32
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