summaryrefslogtreecommitdiff
path: root/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
Commit message (Collapse)AuthorAge
* --- Reverse-merging r195823 into '.':Bill Wendling2013-12-01
| | | | | | | | | | | | | | U lib/MC/MCSectionCOFF.cpp U lib/CodeGen/TargetLoweringObjectFileImpl.cpp U test/MC/COFF/weak-symbol.ll U test/MC/COFF/tricky-names.ll G . --- Recording mergeinfo for reverse merge of r195823 into '.': G . git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@196036 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r195798:Bill Wendling2013-11-27
| | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r195798 | rafael | 2013-11-26 17:18:37 -0800 (Tue, 26 Nov 2013) | 9 lines Use simple section names for COMDAT sections on COFF. With this patch we use simple names for COMDAT sections (like .text or .bss). This matches the MSVC behavior. When merging it is the COMDAT symbol that is used to decide if two sections should be merged, so there is no point in building a fancy name. This survived a bootstrap on mingw32. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@195823 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r195148:Bill Wendling2013-11-27
| | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r195148 | rafael | 2013-11-19 11:52:52 -0800 (Tue, 19 Nov 2013) | 15 lines Support multiple COFF sections with the same name but different COMDAT. This is the first step to fix pr17918. It extends the .section directive a bit, inspired by what the ELF one looks like. The problem with using linkonce is that given .section foo .linkonce.... .section foo .linkonce we would already have switched sections when getting to .linkonce. The cleanest solution seems to be to add the comdat information in the .section itself. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@195822 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Micro-optimization"Bill Wendling2013-11-17
| | | | | | | | This reverts commit f1d9fe9d04ce93f6d5dcebbd2cb6a07414d7a029. This was causing PR17964. We need to use thread data before regular data. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194960 91177308-0d34-0410-b5e6-96231b3b80d8
* Move getSymbol to TargetLoweringObjectFile.Rafael Espindola2013-10-29
| | | | | | This allows constructing a Mangler with just a TargetMachine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193630 91177308-0d34-0410-b5e6-96231b3b80d8
* [-cxx-abi microsoft] Stick zero initialized symbols into the .bss section ↵David Majnemer2013-08-13
| | | | | | | | | | | | | | | | | | | | | | | for COFF Summary: We need to do two things: - Initialize BSSSection in MCObjectFileInfo::InitCOFFMCObjectFileInfo - Teach TargetLoweringObjectFileCOFF::SelectSectionForGlobal what to do with it This fixes PR16861. Reviewers: rnk Reviewed By: rnk CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1361 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188244 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Reapply r185872 now that the address sanitizer has been changed to ↵Arnold Schwaighofer2013-08-08
| | | | | | | | support this." This reverts commit r187939. It broke an O0 build of a spec benchmark. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188012 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "coff also doesn't have a ReadOnlySection yet, (!)"David Majnemer2013-08-08
| | | | | | | | | | | | This reverts commit r77814. We were sticking global constants in the .data section instead of in the .rdata section when emitting for COFF. This fixes PR16831. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187956 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r185872 now that the address sanitizer has been changed to support this.Bill Wendling2013-08-07
| | | | | | | | | | | | | | | | | | | | | | Original commit message: Stop emitting weak symbols into the "coal" sections. The Mach-O linker has been able to support the weak-def bit on any symbol for quite a while now. The compiler however continued to place these symbols into a "coal" section, which required the linker to map them back to the base section name. Replace the sections like this: __TEXT/__textcoal_nt instead use __TEXT/__text __TEXT/__const_coal instead use __TEXT/__const __DATA/__datacoal_nt instead use __DATA/__data <rdar://problem/14265330> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187939 91177308-0d34-0410-b5e6-96231b3b80d8
* Use proper section suffix for COFF weak symbolsNico Rieck2013-07-29
| | | | | | | | | 32-bit symbols have "_" as global prefix, but when forming the name of COMDAT sections this prefix is ignored. The current behavior assumes that this prefix is always present which is not the case for 64-bit and names are truncated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187356 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r185872 - "Stop emitting weak symbols into the "coal" sections"Alexander Potapenko2013-07-09
| | | | | | | | | | | | | | This patch broke `make check-asan` on Mac, causing ld warnings like the following one: ld: warning: direct access in __GLOBAL__I_a to global weak symbol ___asan_mapping_scale means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings. The resulting test binaries crashed with incorrect ASan warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185923 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop emitting weak symbols into the "coal" sections.Bill Wendling2013-07-08
| | | | | | | | | | | | | | | | | | The Mach-O linker has been able to support the weak-def bit on any symbol for quite a while now. The compiler however continued to place these symbols into a "coal" section, which required the linker to map them back to the base section name. Replace the sections like this: __TEXT/__textcoal_nt instead use __TEXT/__text __TEXT/__const_coal instead use __TEXT/__const __DATA/__datacoal_nt instead use __DATA/__data <rdar://problem/14265330> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185872 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Implement COFF .linkonce directiveNico Rieck2013-07-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185753 91177308-0d34-0410-b5e6-96231b3b80d8
* PR16493: DebugInfo with TLS on PPC crashing due to invalid relocationDavid Blaikie2013-07-01
| | | | | | | | Restrict the current TLS support to X86 ELF for now. Test that we don't produce it on PPC & we can flesh that test case out with the right thing once someone implements it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185389 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: PR14728: TLS supportDavid Blaikie2013-06-28
| | | | | | | | | | | | | | Based on GCC's output for TLS variables (OP_constNu, x@dtpoff, OP_lo_user), this implements debug info support for TLS in ELF. Verified that this output is correct/sufficient on Linux (using gold - if you're using binutils-ld, you'll need something with the fix for http://sourceware.org/bugzilla/show_bug.cgi?id=15685 in it). Support on non-ELF is sort of "arbitrary" at the moment - if Apple folks want to discuss (or just go ahead & implement) how this should work in MachO, etc, I'm open. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185203 91177308-0d34-0410-b5e6-96231b3b80d8
* Micro-optimizationBill Wendling2013-04-26
| | | | | | | | TLVs probably won't be as common as the other types of variables. Check for them last before defaulting to "DATA". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180631 91177308-0d34-0410-b5e6-96231b3b80d8
* [mc-coff] Forward Linker Option flags into the .drectve sectionReid Kleckner2013-04-25
| | | | | | | | | | | | | | Summary: This is modelled on the Mach-O linker options implementation and should support a Clang implementation of #pragma comment(lib/linker). Reviewers: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D724 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180569 91177308-0d34-0410-b5e6-96231b3b80d8
* Windows TLS: Section name prefix to ensure correct orderAnton Korobeynikov2013-03-18
| | | | | | | | | | | | | The linker sorts the .tls$<xyz> sections by name, and we need to make sure any extra sections we produce (e.g. for weak globals) always end up between .tls$AAA and .tls$ZZZ, even if the name starts with e.g. an underscore. Patch by David Nadlinger! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177256 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused #includes.Bill Wendling2013-03-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176467 91177308-0d34-0410-b5e6-96231b3b80d8
* [MC/Mach-O] Implement integrated assembler support for linker options.Daniel Dunbar2013-01-18
| | | | | | - Also, fixup syntax errors in LangRef and missing newline in the MCAsmStreamer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172837 91177308-0d34-0410-b5e6-96231b3b80d8
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-02
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-03
| | | | | | | | | | | | | | | | | 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. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
* Use TARGET2 relocation for TType references on ARM.Anton Korobeynikov2012-11-14
| | | | | | | | | Do some cleanup of the code while here. Inspired by patch by Logan Chien! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167904 91177308-0d34-0410-b5e6-96231b3b80d8
* [MC][COFF] Emit weak symbols to the correct section. Patch by Dmitry Puzirev!Michael J. Spencer2012-11-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167877 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert the majority of the next patch in the address space series:Chandler Carruth2012-11-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r165941: Resubmit the changes to llvm core to update the functions to support different pointer sizes on a per address space basis. Despite this commit log, this change primarily changed stuff outside of VMCore, and those changes do not carry any tests for correctness (or even plausibility), and we have consistently found questionable or flat out incorrect cases in these changes. Most of them are probably correct, but we need to devise a system that makes it more clear when we have handled the address space concerns correctly, and ideally each pass that gets updated would receive an accompanying test case that exercises that pass specificaly w.r.t. alternate address spaces. However, from this commit, I have retained the new C API entry points. Those were an orthogonal change that probably should have been split apart, but they seem entirely good. In several places the changes were very obvious cleanups with no actual multiple address space code added; these I have not reverted when I spotted them. In a few other places there were merge conflicts due to a cleaner solution being implemented later, often not using address spaces at all. In those cases, I've preserved the new code which isn't address space dependent. This is part of my ongoing effort to clean out the partial address space code which carries high risk and low test coverage, and not likely to be finished before the 3.2 release looms closer. Duncan and I would both like to see the above issues addressed before we return to these changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167222 91177308-0d34-0410-b5e6-96231b3b80d8
* Resubmit the changes to llvm core to update the functions to support ↵Micah Villmow2012-10-15
| | | | | | different pointer sizes on a per address space basis. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165941 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 165732 for further review.Micah Villmow2012-10-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165747 91177308-0d34-0410-b5e6-96231b3b80d8
* Add in the first iteration of support for llvm/clang/lldb to allow variable ↵Micah Villmow2012-10-11
| | | | | | per address space pointer sizes to be optimized correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165726 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TargetData to DataLayout.Micah Villmow2012-10-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165402 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove tabs.Bill Wendling2012-07-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160475 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the support for using .init_array from ARM to the genericRafael Espindola2012-06-19
| | | | | | | | | | TargetLoweringObjectFileELF. Use this to support it on X86. Unlike ARM, on X86 it is not easy to find out if .init_array should be used or not, so the decision is made via TargetOptions and defaults to off. Add a command line option to llc that enables it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158692 91177308-0d34-0410-b5e6-96231b3b80d8
* Look for the 'Is Simulated' module flag. This indicates that the program is ↵Bill Wendling2012-04-24
| | | | | | compiled to run on a simulator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155435 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix to make sure that a comdat group gets generated correctly for a static ↵Anton Korobeynikov2012-02-23
| | | | | | | | | | | member of instantiated C++ templates. Patch by Kristof Beyls! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151250 91177308-0d34-0410-b5e6-96231b3b80d8
* ... and it's probably best to use the correct alignment, rather than just ↵David Chisnall2012-02-17
| | | | | | guessing that it's the same as the size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150813 91177308-0d34-0410-b5e6-96231b3b80d8
* It turns out that putting an 8-byte symbol in a 4-byte section makes Solaris ↵David Chisnall2012-02-17
| | | | | | | | | | | | ld sulk. GNU ld is perfectly happy with it, which is worrying for a whole other set of reasons... Thanks to Anton, Duncan and Rafael for helping me track this down. Pointy hat to Rafael for introducing the bug in the first place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150811 91177308-0d34-0410-b5e6-96231b3b80d8
* Use 'getDataNoRel' for the section kind.Bill Wendling2012-02-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150628 91177308-0d34-0410-b5e6-96231b3b80d8
* Modify the code that emits the module flags to use the new module flags accessorBill Wendling2012-02-15
| | | | | | | | | | method. This allows the target lowering code to not have to deal with MDNodes. Also, avoid leaking memory like a sieve by not creating a global variable for the image info section, but just emitting the code directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150624 91177308-0d34-0410-b5e6-96231b3b80d8
* Add code to the target lowering object file module to handle module flags.Bill Wendling2012-02-14
| | | | | | | | | The MachO back-end needs to emit the garbage collection flags specified in the module flags. This is a WIP, so the front-end hasn't been modified to emit these flags just yet. Documentation and front-end switching to occur soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150507 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for implicit TLS model used with MS VC runtime.Anton Korobeynikov2012-02-11
| | | | | | | Patch by Kai Nacke! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150307 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly emit ctors / dtors with priorities into desired sectionsAnton Korobeynikov2012-01-25
| | | | | | | | | | and let linker handle the rest. This finally fixes PR5329 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148990 91177308-0d34-0410-b5e6-96231b3b80d8
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148578 91177308-0d34-0410-b5e6-96231b3b80d8
* On MachO, the pointer to the personality function should always be in theBill Wendling2011-11-29
| | | | | | | | | non_lazy_symbol_pointers section (__IMPORT,__pointers). Ignore the 'hidden' part since that will place it in the wrong section. <rdar://problem/10443720> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145356 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove all remaining uses of Value::getNameStr().Benjamin Kramer2011-11-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144648 91177308-0d34-0410-b5e6-96231b3b80d8
* Check the visibility of the global variable before placing it into the stubsBill Wendling2011-10-24
| | | | | | | | table. A hidden variable could potentially end up in both lists. <rdar://problem/10336715> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142869 91177308-0d34-0410-b5e6-96231b3b80d8
* Goodbye TargetAsmInfo. This eliminate last bit of CodeGen and Target in llvm-mc.Evan Cheng2011-07-20
| | | | | | | | There is still a bit more refactoring left to do in Targets. But we are now very close to fixing all the layering issues in MC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135611 91177308-0d34-0410-b5e6-96231b3b80d8
* Add MCObjectFileInfo and sink the MCSections initialization code fromEvan Cheng2011-07-20
| | | | | | | | | TargetLoweringObjectFileImpl down to MCObjectFileInfo. TargetAsmInfo is done to one last method. It's *almost* gone! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135569 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an obvious typo that's preventing x86 (32-bit) from using .literal16.Evan Cheng2011-07-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135535 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix up TargetLoweringObjectFile ctors to properly initialize fields.Evan Cheng2011-07-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135068 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the presence of the __compact_unwind section to indicate that a targetBill Wendling2011-06-23
| | | | | | | supports compact unwind info instead of having a separate flag indicating this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133685 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a flag that indicates whether a target supports compact unwind info or not.Bill Wendling2011-06-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133662 91177308-0d34-0410-b5e6-96231b3b80d8