aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/TargetLoweringObjectFile.cpp
AgeCommit message (Collapse)AuthorFilesLines
2015-01-06Revert r224935 "Refactor duplicated code. No intended functionality change."Lang Hames1-0/+6
This is affecting the behavior of some ObjC++ / AArch64 test cases on Darwin. Reverting to get the bots green while I track down the source of the changed behavior. llvm-svn: 225311
2014-12-29Refactor duplicated code.Rafael Espindola1-6/+0
No intended functionality change. llvm-svn: 224935
2014-11-12Remove a bit of dead code.Rafael Espindola1-19/+0
Every "real" object file implements this an ptx doesn't use it. llvm-svn: 221746
2014-08-04Remove the TargetMachine forwards for TargetSubtargetInfo basedEric Christopher1-2/+4
information and update all callers. No functional change. llvm-svn: 214781
2014-07-14CodeGen: Stick constant pool entries in COMDAT sections for WinCOFFDavid Majnemer1-1/+2
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
2014-05-17Target: Replace getSection().empty() with hasSection()David Majnemer1-1/+1
No functional change, just a small cleanup. llvm-svn: 209064
2014-04-25[C++] Use 'nullptr'. Target edition.Craig Topper1-4/+4
llvm-svn: 207197
2014-04-16Target: whitespaceSaleem Abdulrasool1-1/+1
llvm-svn: 206353
2014-03-04[cleanup] Re-sort all the includes with utils/sort_includes.py.Chandler Carruth1-1/+1
llvm-svn: 202811
2014-02-19move getNameWithPrefix and getSymbol to TargetMachine.Rafael Espindola1-4/+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
2014-02-19Add back r201608, r201622, r201624 and r201625Rafael Espindola1-17/+16
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
2014-02-19Revert r201622 and r201608.Daniel Jasper1-16/+17
This causes the LLVMgold plugin to segfault. More information on the replies to r201608. llvm-svn: 201669
2014-02-18Fix PR18743.Rafael Espindola1-17/+16
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
2014-02-09Use a consistent argument order in TargetLoweringObjectFile.Rafael Espindola1-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
2014-02-08Pass the Mangler by reference.Rafael Espindola1-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
2014-01-28Revert r199871 and replace it with a simple check in the debug infoEric Christopher1-4/+6
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
2014-01-23Add a variable to track whether or not we've used a unique section,Eric Christopher1-6/+4
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
2014-01-07Move the llvm mangler to lib/IR.Rafael Espindola1-1/+1
This makes it available to tools that don't link with target (like llvm-ar). llvm-svn: 198708
2014-01-07Don't assert with private type info variables.Rafael Espindola1-3/+0
With the gnu objc runtime private strings are used. Since we only need to produce a unique label, the fix is to just drop the asserts. llvm-svn: 198701
2014-01-03Make the llvm mangler depend only on DataLayout.Rafael Espindola1-2/+2
Before this patch any program that wanted to know the final symbol name of a GlobalValue had to link with Target. This patch implements a compromise solution where the mangler uses DataLayout. This way, any tool that already links with Target (llc, clang) gets the exact behavior as before and new IR files can be mangled without linking with Target. With this patch the mangler is constructed with just a DataLayout and DataLayout is extended to include the information the Mangler needs. llvm-svn: 198438
2013-12-05Remove the isImplicitlyPrivate argument of getNameWithPrefix.Rafael Espindola1-2/+10
getSymbolWithGlobalValueBase use is to create a name of a new symbol based on the name of an existing GV. Assert that and then remove the last call to pass true to isImplicitlyPrivate. This gives the mangler API a 1:1 mapping from GV to names, which is what we need to drop the mangler dependency on the target (and use an extended datalayout instead). llvm-svn: 196472
2013-12-02Move getSymbolWithGlobalValueBase to TargetLoweringObjectFile.Rafael Espindola1-0/+7
This allows it to be used in TargetLoweringObjectFileImpl.cpp. llvm-svn: 196117
2013-10-29Move getSymbol to TargetLoweringObjectFile.Rafael Espindola1-2/+12
This allows constructing a Mangler with just a TargetMachine. llvm-svn: 193630
2013-07-02[DebugInfo] Allow getDebugThreadLocalSymbol to return MCExprUlrich Weigand1-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
2013-06-28DebugInfo: PR14728: TLS supportDavid Blaikie1-0/+6
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. llvm-svn: 185203
2013-01-02Move all of the header files which are involved in modelling the LLVM IRChandler Carruth1-5/+5
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. llvm-svn: 171366
2012-12-03Use the new script to sort the includes of every file under lib.Chandler Carruth1-4/+4
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
2012-11-14Use TARGET2 relocation for TType references on ARM.Anton Korobeynikov1-12/+12
Do some cleanup of the code while here. Inspired by patch by Logan Chien! llvm-svn: 167904
2012-10-08Move TargetData to DataLayout.Micah Villmow1-2/+2
llvm-svn: 165402
2012-05-05Typo.Eric Christopher1-1/+1
llvm-svn: 156226
2012-03-27Prune some includesCraig Topper1-1/+0
llvm-svn: 153502
2012-02-06Remove some dead code and tidy things up now that vectors use ConstantDataVectorChris Lattner1-17/+0
instead of always using ConstantVector. llvm-svn: 149912
2012-01-24C++, CBE, and TLOF support for ConstantDataSequentialChris Lattner1-5/+18
llvm-svn: 148805
2012-01-10Add 'llvm_unreachable' to passify GCC's understanding of the constraintsChandler Carruth1-0/+1
of several newly un-defaulted switches. This also helps optimizers (including LLVM's) recognize that every case is covered, and we should assume as much. llvm-svn: 147861
2012-01-10Remove unnecessary default cases in switches that cover all enum values.David Blaikie1-2/+0
llvm-svn: 147855
2011-12-02Move global variables in TargetMachine into new TargetOptions class. As an APINick Lewycky1-3/+3
change, now you need a TargetOptions object to create a TargetMachine. Clang patch to follow. One small functionality change in PTX. PTX had commented out the machine verifier parts in their copy of printAndVerify. That now calls the version in LLVMTargetMachine. Users of PTX who need verification disabled should rely on not passing the command-line flag to enable it. llvm-svn: 145714
2011-07-20Goodbye TargetAsmInfo. This eliminate last bit of CodeGen and Target in llvm-mc.Evan Cheng1-18/+2
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
2011-07-20Add MCObjectFileInfo and sink the MCSections initialization code fromEvan Cheng1-27/+8
TargetLoweringObjectFileImpl down to MCObjectFileInfo. TargetAsmInfo is done to one last method. It's *almost* gone! llvm-svn: 135569
2011-07-18land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner1-3/+3
llvm-svn: 135375
2011-07-13Fix up TargetLoweringObjectFile ctors to properly initialize fields.Evan Cheng1-26/+26
llvm-svn: 135068
2011-06-23Use the presence of the __compact_unwind section to indicate that a targetBill Wendling1-1/+0
supports compact unwind info instead of having a separate flag indicating this. llvm-svn: 133685
2011-06-22Add a flag that indicates whether a target supports compact unwind info or not.Bill Wendling1-0/+1
llvm-svn: 133662
2011-06-22Add a __LD,__compact_unwind section.Bill Wendling1-0/+1
If the linker supports it, this will hold the CIE and FDE information in a compact format. The implementation of the compact unwinding emission is coming soon. llvm-svn: 133658
2011-06-19Fix a FIXME by making GlobalVariable::getInitializer() return aJay Foad1-2/+2
const Constant *. llvm-svn: 133400
2011-05-05Remove a flag that would set the ".eh" symbol as .globl. MachO was the only oneBill Wendling1-1/+0
who used this flag, and it now emits CFI and doesn't emit this anymore. All other targets left this flag "false". <rdar://problem/8486371> llvm-svn: 130918
2011-05-01GCC uses a different encoding of pointers in the FDE when usingRafael Espindola1-1/+1
-fno-dwarf2-cfi-asm. Implement the same behavior. llvm-svn: 130637
2011-04-27Remove unnecessary argument.Rafael Espindola1-1/+1
llvm-svn: 130343
2011-04-27Rename getPersonalityPICSymbol to getCFIPersonalitySymbol, document it, andRafael Espindola1-5/+4
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
2011-04-20Remove unused arguments.Rafael Espindola1-3/+2
llvm-svn: 129844
2011-04-16MSVC needs the return 0 to compile.Francois Pichet1-0/+1
llvm-svn: 129640