summaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter
Commit message (Collapse)AuthorAge
* Merging r196970:Tom Stellard2014-04-11
| | | | | | | | | | | | ------------------------------------------------------------------------ r196970 | fang | 2013-12-10 16:37:41 -0500 (Tue, 10 Dec 2013) | 3 lines on darwin<10, fallback to .weak_definition (PPC,X86) .weak_def_can_be_hidden was not yet supported by the system assembler ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@206050 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r196168:Tom Stellard2014-04-08
| | | | | | | | | | | ------------------------------------------------------------------------ r196168 | rafael.espindola | 2013-12-02 18:04:51 -0500 (Mon, 02 Dec 2013) | 2 lines Convert two char* that are only ever used as booleans to bool. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@205764 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfDebug: Move trailing else to the same line as prior closing braceDavid Blaikie2013-11-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195060 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfDebug: Remove some more redundant explicit constructions.David Blaikie2013-11-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195059 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Simplify a few more explicit constructions, underconstrained ↵David Blaikie2013-11-18
| | | | | | types, and make DIType(MDNode*) explicit like all the other DI* node ctors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195055 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary temporary construction.David Blaikie2013-11-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194981 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove redundant explicit default initialization.David Blaikie2013-11-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194980 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfCompileUnit: Add type safety to createGlobalVariableDIEDavid Blaikie2013-11-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194979 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfCompileUnit: Push type safety of DIDescriptor through ↵David Blaikie2013-11-16
| | | | | | CompileUnit::createAndAddDIE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194902 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfCompileUnit: Remove unnecessary OwningPtr<T>::get() callDavid Blaikie2013-11-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194901 91177308-0d34-0410-b5e6-96231b3b80d8
* For dwarf4 use the correct form for referencing debug_loc locations,Eric Christopher2013-11-16
| | | | | | | | | and update test cases accordingly. This doesn't affect the output dumped using llvm-dwarfdump, but readelf does now dump the debug_loc section. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194898 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfCompileUnit: Add type safety to CompileUnit::getNode by returning ↵David Blaikie2013-11-15
| | | | | | DICompileUnit instead of a raw MDNode*. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194895 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfCompileUnit: Add type safety by using DICompileUnit rather than raw ↵David Blaikie2013-11-15
| | | | | | MDNode* for the CU metadata node git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194893 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfCompileUnit: Simplify getLanguage() calls to use existing member functionDavid Blaikie2013-11-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194892 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace the dangling context hotfix with an assertion.Adrian Prantl2013-11-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194883 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfDebug: Push DISubprogram through updateSubprogramScopeDIEDavid Blaikie2013-11-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194879 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfCompileUnit: Push DIDescriptors through a getDIE/insertDIEDavid Blaikie2013-11-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194875 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfCompileUnit: Push DIDescriptor usage out from isShareableAcrossCUsDavid Blaikie2013-11-15
| | | | | | | This is the first of a few similar patches. We'll see how far it goes/makes sense. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194871 91177308-0d34-0410-b5e6-96231b3b80d8
* Reimplement r194843 in a slightly less broken way.Adrian Prantl2013-11-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194848 91177308-0d34-0410-b5e6-96231b3b80d8
* Restore the behaviour from before r194728.Adrian Prantl2013-11-15
| | | | | | If getDIE() fails, getOrCreateContextDIE() should also return the CUDie. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194843 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a reference rather than a pointer as we don't expect a NULLEric Christopher2013-11-15
| | | | | | | | DbgVariable. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194761 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Simplify/narrow null-check for getOrCreateTypeDavid Blaikie2013-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194737 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfCompileUnit::getOrCreateContext: Return the compile unit DIE rather ↵David Blaikie2013-11-14
| | | | | | than null. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194728 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary 'else' after return.David Blaikie2013-11-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194724 91177308-0d34-0410-b5e6-96231b3b80d8
* Error if we see an alias to a declaration.Rafael Espindola2013-11-14
| | | | | | | | | | | | | | | In ELF and COFF an alias is just another offset in a section. There is no way to represent an alias to something in another file. In MachO, the spec has the N_INDR type which should allow for exactly that, but is not currently implemented. Given that it is specified but not implemented, we error in codegen to avoid miscompiling but don't reject aliases to declarations in the verifier to leave the option open of implementing it. In the past we have used alias to declarations as a way of implementing weakref, which is why it exists in some old tests which this patch updates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194705 91177308-0d34-0410-b5e6-96231b3b80d8
* DIEHash: Move header include to be first in the implementation file to flush ↵David Blaikie2013-11-13
| | | | | | out header inclusion ordering issues git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194588 91177308-0d34-0410-b5e6-96231b3b80d8
* Unify the adding of enumerators with the construction of the enumeration.Eric Christopher2013-11-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194401 91177308-0d34-0410-b5e6-96231b3b80d8
* Formatting.Eric Christopher2013-11-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194400 91177308-0d34-0410-b5e6-96231b3b80d8
* 80-col.Eric Christopher2013-11-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194399 91177308-0d34-0410-b5e6-96231b3b80d8
* Just pass the DIComposite type by value instead of by pointer.Eric Christopher2013-11-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194398 91177308-0d34-0410-b5e6-96231b3b80d8
* Use type form of getIntPtrType.Matt Arsenault2013-11-10
| | | | | | | | This should be inconsequential and is work towards removing the default address space arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194347 91177308-0d34-0410-b5e6-96231b3b80d8
* Comment some and reformat for clarity beginFunction.Eric Christopher2013-11-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193894 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove linkonce_odr_auto_hide.Rafael Espindola2013-11-01
| | | | | | | | | | | | | | | linkonce_odr_auto_hide was in incomplete attempt to implement a way for the linker to hide symbols that are known to be available in every TU and whose addresses are not relevant for a particular DSO. It was redundant in that it all its uses are equivalent to linkonce_odr+unnamed_addr. Unlike those, it has never been connected to clang or llvm's optimizers, so it was effectively dead. Given that nothing produces it, this patch just nukes it (other than the llvm-c enum value). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193865 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Emit member variable locations as data instead of expressions in ↵David Blaikie2013-11-01
| | | | | | | | | blocks Drive by space optimization. Also makes the DIEs more regular which might speed up DWARF parsing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193835 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: remove duplication of DIEs when a DIE can be shared across CUs.Manman Ren2013-10-31
| | | | | | | | | | | | | | | | | | | | We add a map in DwarfDebug to map MDNodes that are shareable across CUs to the corresponding DIEs: MDTypeNodeToDieMap. These DIEs can be shared across CUs, that is why we keep the maps in DwarfDebug instead of CompileUnit. We make the assumption that if a DIE is not added to an owner yet, we assume it belongs to the current CU. Since DIEs for the type system are added to their owners immediately after creation, and other DIEs belong to the current CU, the assumption should be true. A testing case is added to show that we only create a single DIE for a type MDNode and we use ref_addr to refer to the type DIE. We also add a testing case to show ref_addr relocations for non-darwin platforms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193779 91177308-0d34-0410-b5e6-96231b3b80d8
* Produce .weak_def_can_be_hidden for some linkonce_odr valuesRafael Espindola2013-10-30
| | | | | | | | | | | | | | With this patch llvm produces a weak_def_can_be_hidden for linkonce_odr if they are also unnamed_addr or don't have their address taken. There is not a lot of documentation about .weak_def_can_be_hidden, but from the old discussion about linkonce_odr_auto_hide and the name of the directive this looks correct: these symbols can be hidden. Testing this with the ld64 in Xcode 5 linking clang reduces the number of exported symbols from 21053 to 19049. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193718 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Push header handling down into CompileUnitDavid Blaikie2013-10-30
| | | | | | | This is a preliminary step to handling type units by abstracting over all (type or compile) units. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193714 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfDebug: Change Abbreviations member from pointer to referenceDavid Blaikie2013-10-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193699 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: code clean up.Manman Ren2013-10-29
| | | | | | | | | | | Use EmitLabelOffsetDifference for handling on darwin platform when non-darwin platforms use EmitLabelPlusOffset. Also fix a bug in EmitLabelOffsetDifference where the size is hard-coded to 4 even though Size is passed in as an argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193660 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: support for DW_FORM_ref_addr.Manman Ren2013-10-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To support ref_addr, we calculate the section offset of a DIE (i.e. offset of a DIE from beginning of the debug info section). The Offset field in DIE is currently CU-relative. To calculate the section offset, we add a DebugInfoOffset field in CompileUnit to store the offset of a CU from beginning of the debug info section. We set the value in DwarfUnits::computeSizeAndOffset for each CompileUnit. A helper function DIE::getCompileUnit is added to return the CU DIE that the input DIE belongs to. We also add a map CUDieMap in DwarfDebug to help finding the CU for a given CU DIE. For a cross-referenced DIE, we first find the CU DIE it belongs to with getCompileUnit, then we use CUDieMap to get the corresponding CU for the CU DIE. Adding the section offset of the CU with the CU-relative offset of a DIE gives us the seciton offset of the DIE. We correctly emit ref_addr with relocation using EmitLabelPlusOffset when doesDwarfUseRelocationsAcrossSections is true. This commit handles the emission of DW_FORM_ref_addr when we have an attribute with FORM_ref_addr. A follow-on patch will start using ref_addr when adding a DIEEntry. This commit will be tested and verified in the follow-on patch. Reviewed off-list by Eric, Thanks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193658 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: instead of calling addToContextOwner which constructs the contextManman Ren2013-10-29
| | | | | | | | | | | | | | | | after the DIE creation, we construct the context first. Ensure that we create the context before we create a type so that we can add the newly created type to the parent. Remove last use of addToContextOwner now that it's not needed. We use createAndAddDIE to wrap around "new DIE(". Now all shareable DIEs should be added to their parents right after the creation. Reviewed off-list by Eric, Thanks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193657 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
* Add a helper getSymbol to AsmPrinter.Rafael Espindola2013-10-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193627 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: instead of calling addToContextOwner which constructs the contextManman Ren2013-10-29
| | | | | | | | | | | | | after the DIE creation, we construct the context first. This touches creation of namespaces and global variables. The purpose is to handle all DIE creations similarly: constructs the context first, then creates the DIE and immediately adds the DIE to its parent. We use createAndAddDIE to wrap around "new DIE(". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193589 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: use createAndAddDIE to wrap around "new DIE" in DwarfDebug.Manman Ren2013-10-29
| | | | | | | | | | This commit ensures DIEs are constructed within a compile unit and immediately added to their parents. Reviewed off-list by Eric. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193568 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: use createAndAddDIE for newly-created Subprogram DIEs.Manman Ren2013-10-29
| | | | | | | | | | | | More patches will be submitted to convert "new DIE(" to use createAddAndDIE in DwarfCompileUnit.cpp. This will simplify implementation of addDIEEntry where we have to decide between ref4 and ref_addr, because DIEs that can be shared across CU will be added to a CU already. Reviewed off-list by Eric. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193567 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: add a helper function createAndAddDIE.Manman Ren2013-10-29
| | | | | | | | | | | | | | | It wraps around "new DIE(" and handles the bookkeeping part of the newly-created DIE. It adds the DIE to its parent, and calls insertDIE if necessary. It makes sure that bookkeeping is done at the earliest time and we should not see parentless DIEs if all constructions of DIEs go through this helper function. Later on, we can use an allocator for DIE allocation, and will only need to change createAndAddDIE instead of modifying all the "new DIE(". Reviewed off-list by Eric. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193566 91177308-0d34-0410-b5e6-96231b3b80d8
* DIEHash: Summary hashing of member functionsDavid Blaikie2013-10-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193432 91177308-0d34-0410-b5e6-96231b3b80d8
* DIEHash: Summary hashing of nested typesDavid Blaikie2013-10-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193427 91177308-0d34-0410-b5e6-96231b3b80d8
* MCStreamer: Reimplement the virtual EmitRawText as a protected member, ↵David Blaikie2013-10-24
| | | | | | | | | | EmitRawTextImpl, to avoid string literal ambiguities Also improve the implementation of EmitRawText(Twine) so it doesn't bother using the SmallString buffer if the Twine is a simple StringRef anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193378 91177308-0d34-0410-b5e6-96231b3b80d8