summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86TargetObjectFile.cpp
Commit message (Collapse)AuthorAgeFilesLines
* X86: Simplify X86WindowsTargetObjectFile::getSectionForConstantDavid Majnemer2014-07-151-9/+3
| | | | | | | | | There exists a helper function to abstract away the various differences between ConstantVector, ConstantDataVector, ConstantAggregateZero, etc. Use it to simplify X86WindowsTargetObjectFile::getSectionForConstant. llvm-svn: 213104
* CodeGen: Handle ConstantVector and undef in WinCOFF constant poolsDavid Majnemer2014-07-151-13/+21
| | | | | | | | | | | | The constant pool entry code for WinCOFF assumed that vector constants would be formed using ConstantDataVector, it did not expect to see a ConstantVector. Furthermore, it did not expect undef as one of the elements of the vector. ConstantVectors should be handled like ConstantDataVectors, treat Undef as zero. llvm-svn: 213038
* CodeGen: Stick constant pool entries in COMDAT sections for WinCOFFDavid Majnemer2014-07-141-0/+61
| | | | | | | | | | | | | | | | 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
* Restore condition incorrectly changed in r96289 to the older state.Joerg Sonnenberger2014-04-301-1/+1
| | | | llvm-svn: 207716
* [C++] Use 'nullptr'. Target edition.Craig Topper2014-04-251-6/+6
| | | | llvm-svn: 207197
* move getNameWithPrefix and getSymbol to TargetMachine.Rafael Espindola2014-02-191-3/+3
| | | | | | | | | | TargetLoweringBase is implemented in CodeGen, so before this patch we had a dependency fom Target to CodeGen. This would show up as a link failure of llvm-stress when building with -DBUILD_SHARED_LIBS=ON. This fixes pr18900. llvm-svn: 201711
* Add back r201608, r201622, r201624 and r201625Rafael Espindola2014-02-191-12/+14
| | | | | | | | | | | | | | 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-14/+12
| | | | | | | This causes the LLVMgold plugin to segfault. More information on the replies to r201608. llvm-svn: 201669
* Fix PR18743.Rafael Espindola2014-02-181-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Use a consistent argument order in TargetLoweringObjectFile.Rafael Espindola2014-02-091-9/+8
| | | | | | | | | These methods normally call each other and it is really annoying if the arguments are in different order. The more common rule was that the arguments specific to call are first (GV, Encoding, Suffix) and the auxiliary objects (Mang, TM) come after. This patch changes the exceptions. llvm-svn: 201044
* Pass the Mangler by reference.Rafael Espindola2014-02-081-6/+6
| | | | | | | 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
* WinCOFF: Transform IR expressions featuring __ImageBase into image relative ↵David Majnemer2014-01-151-0/+52
| | | | | | | | | | | | | relocations MSVC on x64 requires that we create image relative symbol references to refer to RTTI data. Seeing as how there is no way to explicitly make reference to a given relocation type in LLVM IR, pattern match expressions of the form &foo - &__ImageBase. Differential Revision: http://llvm-reviews.chandlerc.com/D2523 llvm-svn: 199312
* Re-sort #include lines again, prior to moving headers around.Chandler Carruth2014-01-131-1/+1
| | | | llvm-svn: 199080
* Move the llvm mangler to lib/IR.Rafael Espindola2014-01-071-1/+1
| | | | | | This makes it available to tools that don't link with target (like llvm-ar). llvm-svn: 198708
* Move getSymbol to TargetLoweringObjectFile.Rafael Espindola2013-10-291-2/+2
| | | | | | This allows constructing a Mangler with just a TargetMachine. llvm-svn: 193630
* [DebugInfo] Allow getDebugThreadLocalSymbol to return MCExprUlrich Weigand2013-07-021-1/+1
| | | | | | | | | | | This allows getDebugThreadLocalSymbol to return a generic MCExpr instead of just a MCSymbolRefExpr. This is in preparation for supporting debug info for TLS variables on PowerPC, where we need to describe the variable location using a more complex expression than just MCSymbolRefExpr. llvm-svn: 185460
* PR16493: DebugInfo with TLS on PPC crashing due to invalid relocationDavid Blaikie2013-07-011-0/+6
| | | | | | | | 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. llvm-svn: 185389
* Remove heavy and unused #inclues from X86TargetObjectFile.cpp.Jakub Staszak2013-01-101-5/+1
| | | | llvm-svn: 172151
* 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
* Use TARGET2 relocation for TType references on ARM.Anton Korobeynikov2012-11-141-4/+4
| | | | | | | | Do some cleanup of the code while here. Inspired by patch by Logan Chien! llvm-svn: 167904
* Rename to match other X86_64* names.Bill Wendling2012-06-261-2/+2
| | | | llvm-svn: 159196
* Move the support for using .init_array from ARM to the genericRafael Espindola2012-06-191-0/+9
| | | | | | | | | | 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. llvm-svn: 158692
* Prune some includesCraig Topper2012-03-271-1/+0
| | | | llvm-svn: 153502
* Emacs-tag and some comment fix for all ARM, CellSPU, Hexagon, MBlaze, ↵Jia Liu2012-02-181-1/+1
| | | | | | MSP430, PPC, PTX, Sparc, X86, XCore. llvm-svn: 150878
* Goodbye TargetAsmInfo. This eliminate last bit of CodeGen and Target in llvm-mc.Evan Cheng2011-07-201-76/+0
| | | | | | | 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. llvm-svn: 135611
* Remove an unused variable from this function introduced in r130637,Chandler Carruth2011-05-011-1/+0
| | | | | | likely a result of copy/paste. llvm-svn: 130640
* GCC uses a different encoding of pointers in the FDE when usingRafael Espindola2011-05-011-3/+10
| | | | | | -fno-dwarf2-cfi-asm. Implement the same behavior. llvm-svn: 130637
* Remove unnecessary argument.Rafael Espindola2011-04-271-1/+1
| | | | llvm-svn: 130343
* Rename getPersonalityPICSymbol to getCFIPersonalitySymbol, document it, andRafael Espindola2011-04-271-0/+6
| | | | | | | | | | | | | | | | | | give it a bit more responsibility. Also implement it for MachO. If hacked to use cfi, 32 bit MachO will produce .cfi_personality 155, L___gxx_personality_v0$non_lazy_ptr and 64 bit will produce .cfi_presonality ___gxx_personality_v0 The general idea is that .cfi_personality gets passed the final symbol. It is up to codegen to produce it if using indirect representation (like 32 bit MachO), but it is up to MC to decide which relocations to create. llvm-svn: 130341
* Compute the size of the FDE encoding instead of hard coding it. UpdateRafael Espindola2011-04-221-10/+1
| | | | | | X8664_ELFTargetObjectFile::getFDEEncoding to match reality. llvm-svn: 129959
* MC: Allow modifiers in MCSymbolRefExpr, and eliminate X86MCTargetExpr.Daniel Dunbar2010-03-151-2/+2
| | | | | | | - Although it would be nice to allow this decoupling, the assembler needs to be able to reason about MCSymbolRefExprs in too many places to make this viable. We can use a target specific encoding of the variant if this becomes an issue. - This patch also extends llvm-mc to support parsing of the modifiers, as opposed to lumping them in with the symbol. llvm-svn: 98592
* Now that the default for Darwin platforms is to place the LSDA into the TEXTBill Wendling2010-03-151-13/+0
| | | | | | section, remove the target-specific code that performs this. llvm-svn: 98580
* use Mang->getSymbol() Chris Lattner2010-03-151-7/+1
| | | | llvm-svn: 98578
* Place the LSDA into the TEXT section for x86 Darwin. If the global it's pointingBill Wendling2010-03-151-0/+14
| | | | | | | | | | | to is local to the translation unit, we need to place fill the value of that symbol into the non-lazy pointer. This should conclude all Darwin changes for placing the LSDA into the TEXT section. There is some cleanup to do. I.e., there's no longer a special need for target-specific code here. But that can come later. llvm-svn: 98564
* rename getSymbolForDwarf* to getExprForDwarf* since it returnsChris Lattner2010-03-111-4/+4
| | | | | | | | | an MCExpr and not an MCSymbol. Change it to take an MCStreamer, which is currently unused. No functionality change. llvm-svn: 98278
* set the temporary bit on MCSymbols correctly.Chris Lattner2010-03-101-2/+7
| | | | llvm-svn: 98124
* It turned out that we failed to emit proper symbol stubs on non-x86/darwin ↵Anton Korobeynikov2010-02-211-64/+0
| | | | | | | | | for ages (we emitted a reference to a stub, but no stub was emitted). The code inside x86-32/macho target objfile lowering should actually be the generic one - move it there. This (I really, really hope) should fix EH issues on ppc/darwin and arm/darwin. llvm-svn: 96755
* Revert Anton's most recent EH patch (r96637), since it breaks a lot ofBob Wilson2010-02-191-0/+32
| | | | | | ARM and Thumb tests. llvm-svn: 96680
* Use the same encoding for EH stuff uniformly on all MachO targets.Anton Korobeynikov2010-02-191-32/+0
| | | | | | This hopefulyl should unbreak EH on PPC/Darwin. llvm-svn: 96637
* Use pointer-wide encoding for LSDA and FDE on Darwin.Anton Korobeynikov2010-02-171-4/+4
| | | | | | Hopefully, this will fix the remaining issues seen there. llvm-svn: 96454
* Fix a silly darwin-only typo introduced during merge.Anton Korobeynikov2010-02-151-7/+6
| | | | llvm-svn: 96289
* Preliminary patch to improve dwarf EH generation - Hooks to return ↵Anton Korobeynikov2010-02-151-34/+150
| | | | | | Personality / FDE / LSDA / TType encoding depending on target / options (e.g. code model / relocation model) - MCIzation of Dwarf EH printer to use encoding information - Stub generation for ELF target (needed for indirect references) - Some other small changes here and there llvm-svn: 96285
* switch ELF @GOTOFF references to use X86MCTargetExpr.Chris Lattner2010-02-081-0/+1
| | | | llvm-svn: 95593
* add an x86 implementation of MCTargetExpr forChris Lattner2010-02-081-3/+3
| | | | | | | representing @GOT and friends. Use it for personality references as a first use. llvm-svn: 95588
* make MachineModuleInfoMachO hold non-const MCSymbol*'s insteadChris Lattner2010-02-031-1/+1
| | | | | | | of const ones. non-const ones aren't very useful, because you can't even, say, emit them. llvm-svn: 95205
* move the mangler into libtarget from vmcore.Chris Lattner2010-01-161-3/+4
| | | | llvm-svn: 93664
* Make a new X8632_MachoTargetObjectFile TLOF implementation whose Chris Lattner2009-09-181-0/+31
| | | | | | | | | | | | | | | | | | | | | | getSymbolForDwarfGlobalReference is smart enough to know that it needs to register the stub it references with MachineModuleInfoMachO, so that it gets emitted at the end of the file. Move stub emission from X86ATTAsmPrinter::doFinalization to the new X86ATTAsmPrinter::EmitEndOfAsmFile asmprinter hook. The important thing here is that EmitEndOfAsmFile is called *after* the ehframes are emitted, so we get all the stubs. This allows us to remove a gross hack from the asmprinter where it would "just know" that it needed to output stubs for personality functions. Now this is all driven from a consistent interface. The testcase change is just reordering the expected output now that the stubs come out after the ehframe instead of before. This also unblocks other changes that Bill wants to make. llvm-svn: 82269
* pass machinemoduleinfo down into getSymbolForDwarfGlobalReference, Chris Lattner2009-09-171-0/+1
| | | | | | currently unused. llvm-svn: 82157
* Big change #1 for personality function references:Chris Lattner2009-09-161-0/+33
Eliminate the PersonalityPrefix/Suffix & NeedsIndirectEncoding fields from MAI: they aren't part of the asm syntax, they are related to the structure of the object file. To replace their functionality, add a new TLOF::getSymbolForDwarfGlobalReference method which asks targets to decide how to reference a global from EH in a pc-relative way. The default implementation just returns the symbol. The default darwin implementation references the symbol through an indirect $non_lazy_ptr stub. The bizarro x86-64 darwin specialization handles the weird "foo@GOTPCREL+4" hack. DwarfException.cpp now uses this to emit the reference to the symbol in the right way, and this also eliminates another horrible hack from DwarfException.cpp: - if (strcmp(MAI->getPersonalitySuffix(), "+4@GOTPCREL")) - O << "-" << MAI->getPCSymbol(); llvm-svn: 81991
OpenPOWER on IntegriCloud