summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
Commit message (Collapse)AuthorAgeFilesLines
* Debug Info: static member DIE creation.Manman Ren2013-10-142-14/+24
| | | | | | | | | | | | | Clean up creation of static member DIEs. We can create static member DIEs from two places, so we call getOrCreateStaticMemberDIE from the two places. getOrCreateStaticMemberDIE will get or create the context DIE first, then it will check if the DIE already exists, if not, we create the static member DIE and add it to the context. Creation of static member DIEs are handled in a similar way as subprogram DIEs. llvm-svn: 192618
* Debug Info: remove form from function addDIEEntry.Manman Ren2013-10-113-26/+17
| | | | | | | | | The form must be a reference form in addDIEEntry. Which reference form to use will be decided by the callee. No functionality change. llvm-svn: 192517
* Make AsmPrinter::emitImplicitDef a virtual method so targets can emit custom ↵Justin Holewinski2013-10-111-5/+5
| | | | | | | | | | | | | comments for implicit defs For NVPTX, this fixes a crash where the emitImplicitDef implementation was expecting physical registers, while NVPTX uses virtual registers (with a couple of exceptions). Now, the implicit def comment will be emitted as a true PTX register name. Other targets can use this to customize the output of implicit def comments. Fixes PR17519 llvm-svn: 192444
* Debug Info: In DIBuilder, the context field of subprogram is updated to useManman Ren2013-10-102-4/+5
| | | | | | | | DIScopeRef. A paired commit at clang is required due to changes to DIBuilder. llvm-svn: 192378
* Debug Info: In DIBuilder, the context and type fields of template_type andManman Ren2013-10-091-3/+4
| | | | | | | | template_value are updated to use DIRef. A paired commit at clang is required due to changes to DIBuilder. llvm-svn: 192320
* Add DbgVariable::resolve per Eric's suggestion.Manman Ren2013-10-082-2/+14
| | | | llvm-svn: 192218
* Debug Info: rename getOriginalTypeSize to getBaseTypeSize.Manman Ren2013-10-081-4/+4
| | | | llvm-svn: 192216
* Debug Info: take advantage of the existing CU::resolve.Manman Ren2013-10-081-7/+7
| | | | llvm-svn: 192215
* Add a MCTargetStreamer interface.Rafael Espindola2013-10-082-5/+14
| | | | | | | | | | | | | This patch fixes an old FIXME by creating a MCTargetStreamer interface and moving the target specific functions for ARM, Mips and PPC to it. The ARM streamer is still declared in a common place because it is used from lib/CodeGen/ARMException.cpp, but the Mips and PPC are completely hidden in the corresponding Target directories. I will send an email to llvmdev with instructions on how to use this. llvm-svn: 192181
* Formally added an explicit enum for DWARF TLS support. No functionality change.Richard Mitton2013-10-071-3/+4
| | | | llvm-svn: 192118
* Add support for aliases with linkonce_odr.Rafael Espindola2013-10-061-1/+1
| | | | | | This will be used to extend constructor aliases in clang. llvm-svn: 192066
* Remove some really nasty uses of hasRawTextSupport.Rafael Espindola2013-10-051-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When MC was first added, targets could use hasRawTextSupport to keep features working before they were added to the MC interface. The design goal of MC is to provide an uniform api for printing assembly and object files. Short of relaxations and other corner cases, a object file is just another representation of the assembly. It was never the intention that targets would keep doing things like if (hasRawTextSupport()) Set flags in one way. else Set flags in another way. When they do that they create two code paths and the object file is no longer just another representation of the assembly. This also then requires testing with llc -filetype=obj, which is extremelly brittle. This patch removes some of these hacks by replacing them with smaller ones. The ARM flag setting is trivial, so I just moved it to the constructor. For Mips, the patch adds two temporary hack directives that allow the assembly to represent the same things as the object file was already able to. The hope is that the mips developers will replace the hack directives with the same ones that gas uses and drop the -print-hack-directives flag. I will also try to implement a target streamer interface, so that we can move this out of the common code. In summary, for any new work, two rules of the thumb are * Don't use "llc -filetype=obj" in tests. * Don't add calls to hasRawTextSupport. llvm-svn: 192035
* Debug Info: In DIBuilder, the derived-from field of a DW_TAG_pointer_typeManman Ren2013-10-053-26/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | is updated to use DITypeRef. Move isUnsignedDIType and getOriginalTypeSize from DebugInfo.h to be static helper functions in DwarfCompileUnit. We already have a static helper function "isTypeSigned" in DwarfCompileUnit, and a pointer to DwarfDebug is added to resolve the derived-from field. All three functions need to go across link for derived-from fields, so we need to get hold of a type identifier map. A pointer to DwarfDebug is also added to DbgVariable in order to resolve the derived-from field. Debug info verifier is updated to check a derived-from field is a TypeRef. Verifier will not go across link for derived-from fields, in debug info finder, we go across the link to add derived-from fields to types. Function getDICompositeType is only used by dragonegg and since dragonegg does not generate identifier for types, we use an empty map to resolve the derived-from field. When printing a derived-from field, we use DITypeRef::getName to either return the type identifier or getName of the DIType. A paired commit at clang is required due to changes to DIBuilder. llvm-svn: 192018
* Reorganize some member variables and update a comment.Eric Christopher2013-10-051-6/+6
| | | | llvm-svn: 192017
* Fix one comment and update another. Slightly reformat.Eric Christopher2013-10-052-4/+3
| | | | llvm-svn: 192016
* Add a resolve method on CompileUnit that forwards to DwarfDebug.Eric Christopher2013-10-052-8/+13
| | | | llvm-svn: 192014
* Make a bunch of CompileUnit member functions private.Eric Christopher2013-10-052-36/+38
| | | | llvm-svn: 192009
* Minor formatting/comment rewording/etc.David Blaikie2013-10-041-5/+3
| | | | llvm-svn: 192005
* Remove odd use of this.Eric Christopher2013-10-041-1/+1
| | | | llvm-svn: 192004
* Reformat some odd formattings.Eric Christopher2013-10-041-32/+19
| | | | llvm-svn: 192003
* Tighten up some type arguments to functions. Where we expect aEric Christopher2013-10-042-6/+6
| | | | | | scope, pass a scope. llvm-svn: 192002
* Remove some dead code.David Blaikie2013-10-042-7/+0
| | | | llvm-svn: 192000
* Simplify setting of DIE tag for type DIEs by setting it in one* place.David Blaikie2013-10-041-16/+8
| | | | | | * two actually due to some weird template thing... investigating that. llvm-svn: 191998
* Prune includes.Eric Christopher2013-10-041-2/+0
| | | | llvm-svn: 191994
* Use addFlag to add the enum class attribute.Eric Christopher2013-10-041-1/+1
| | | | | | This has the side effect of using DW_FORM_flag_present on dwarf4 and above. llvm-svn: 191991
* Use Die->addValue and DIEIntegerOne directly when we want to addEric Christopher2013-10-041-3/+2
| | | | | | a flag. No functional change. llvm-svn: 191990
* Temporarily revert r176882 as it needs to be implemented in a differentEric Christopher2013-10-046-60/+5
| | | | | | way for all platforms. llvm-svn: 191975
* Temporarily revert r191792 as it is causing some LTO debug failuresEric Christopher2013-10-045-187/+42
| | | | | | | on platforms with relocations in debug info and also temporarily revert r191800 due to conflicts with the revert of r191792. llvm-svn: 191967
* DebugInfo: Fix ordering of members after r191928David Blaikie2013-10-041-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the case (shown in the attached test) where a member function definition was emitted into debug info the following could occur: 1) build the debug info for the member function definition 2) in (1), build the debug info for the member function declaration 3) construct and add the member function declaration DIE 4) add it to its context 5) build its context (the type it is a member of) 6) construct the members and add them to the type 7) except don't add member functions because "getOrCreateSubprogram" adds the function to its parent anyway 8) except we're only partway through building this subprogram declaration so it hasn't been added yet - but we returned the partially constructed DIE (since it's already in the MDNode->DIE mapping to avoid infinitely recursing trying to create the member function DIE) 9) once the type is constructed, add the member function to it 10) now the members are out of order (the member function being defined is listed as the last member, even though it was declared as the first) To avoid this, construct the context of the subprogram DIE before we query to see if it exists. That way we never end up creating it before creating its context and ending up in this situation. Alternatively, the type construction that visits/builds all the members could call something like getOrCreateSubprogram, but that doesn't ever do the "add to context" step. Then the type building code would always be responsible for adding members (and the subprogram "addToContextDIE" would no-op because the context building would have added the subprogram declaration to the type/context DIE already). (the test cases updated were overly-sensitive to offsets or abbreviation numbers. We don't have a nice way to make these tests more robust as yet - multiline FileCheck matches would be required) llvm-svn: 191939
* Fixed a bug with section names containing special characters.Richard Mitton2013-10-031-8/+24
| | | | | | | | | | Changed the dwarf aranges code to not use getLabelEndName, as it turns out it's not reliable to call that given user-defined section names. Section names can have characters in that aren't representable as symbol names. The dwarf-aranges test case has been updated to include a special character, to check this. This fixes pr17416. llvm-svn: 191932
* DebugInfo: Avoid redundantly adding child DIEs to parents.David Blaikie2013-10-033-15/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DIE::addChild had a shortcircuit that silently no-op'd when a child was readded to the same parent. This hid some quirky/redundant code in DwarfDebug/CompileUnit. By removing that functionality and replacing it with an assert I was able to find and cleanup those cases, mostly centering around adding members to types in various circumstances. 1) The original oddity I noticed while working on type units (which actually was helping me in the short term, by accident) was the addToContextOwner call in constructTypeDIE. This call was completely bogus (why was it only done for non-virtual types? what relevance does that have at all) and redundant with the more uniform addToContextOwner made in getOrCreateTypeDIE. 2) If a member function definition was visited (createSubprogramDIE), it would attempt to build the member function declaration. The declaration DIE would then be added to its context, but in building the context (the type for which this function is a member) the members of the type would be added to the type automatically, so by the time the context was constructed, the member function was already associated with it. 3) The same as (2) but without the member function being constructed first. Whenever a type was constructed, the members would be created and member functions would be created by getOrCreateSubprogramDIE - this would lead to the subprogram being added to the (incomplete) type already, then the general member-construction code would add it again. llvm-svn: 191928
* Rename DataLayout variables TD -> DLMatt Arsenault2013-10-031-34/+34
| | | | llvm-svn: 191927
* Make sure we emit a section for pubnames even if that section isEric Christopher2013-10-031-3/+0
| | | | | | | going to be empty. This is particularly important for the gnu pubnames case since we're emitting a relocation to the section. llvm-svn: 191915
* Fix cut and paste typo.Eric Christopher2013-10-031-2/+2
| | | | llvm-svn: 191914
* Remove wild .debug_aranges entries generated from unimportant labelsAlexey Samsonov2013-10-033-22/+10
| | | | | | | | | | | | | | | | r191052 added emitting .debug_aranges to Clang, but this functionality is broken: it uses all MC labels added in DWARF Asm printer, including the labels for build relocations between different DWARF sections, like .Lsection_line or .Ldebug_loc0. As a result, if any DIE .debug_info would contain "DW_AT_location=0x123" attribute, .debug_aranges would also contain a range starting from 0x123, breaking tools that rely on this section. This patch fixes this by using only MC labels that corresponds to the addresses in the user program. llvm-svn: 191884
* Debug Info: In DIBuilder, the derived-from field of a DW_TAG_pointer_typeManman Ren2013-10-013-26/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | is updated to use DITypeRef. Move isUnsignedDIType and getOriginalTypeSize from DebugInfo.h to be static helper functions in DwarfCompileUnit. We already have a static helper function "isTypeSigned" in DwarfCompileUnit, and a pointer to DwarfDebug is added to resolve the derived-from field. All three functions need to go across link for derived-from fields, so we need to get hold of a type identifier map. A pointer to DwarfDebug is also added to DbgVariable in order to resolve the derived-from field. Debug info verifier is updated to check a derived-from field is a TypeRef. Verifier will not go across link for derived-from fields, in debug info finder, we go across the link to add derived-from fields to types. Function getDICompositeType is only used by dragonegg and since dragonegg does not generate identifier for types, we use an empty map to resolve the derived-from field. When printing a derived-from field, we use DITypeRef::getName to either return the type identifier or getName of the DIType. A paired commit at clang is required due to changes to DIBuilder. llvm-svn: 191800
* Debug Info: remove duplication of DIEs when a DIE is part of the type systemManman Ren2013-10-015-16/+112
| | | | | | | | | | | | | | | | | | | | | | | and it is shared across CUs. We add a few maps in DwarfDebug to map MDNodes for the type system to the corresponding DIEs: MDTypeNodeToDieMap, MDSPNodeToDieMap, and MDStaticMemberNodeToDieMap. These DIEs can be shared across CUs, that is why we keep the maps in DwarfDebug instead of CompileUnit. Sometimes, when we try to add an attribute to a DIE, the DIE is not yet added to its owner yet, so we don't know whether we should use ref_addr or ref4. We create a worklist that will be processed during finalization to add attributes with the correct form (ref_addr or ref4). We add addDIEEntry to DwarfDebug to be a wrapper around DIE->addValue. It checks whether we know the correct form, if not, we update the worklist (DIEEntryWorklist). 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. llvm-svn: 191792
* Add the DW_AT_GNU_ranges_base attribute if we've emitted any rangesEric Christopher2013-10-011-2/+11
| | | | | | into the debug_ranges section. llvm-svn: 191721
* Update comments.Eric Christopher2013-10-011-2/+2
| | | | llvm-svn: 191720
* The DW_AT_GNU_pubnames/pubtypes attributes are actually formEric Christopher2013-09-302-6/+58
| | | | | | | SEC_OFFSET from the beginning of the section so go ahead and emit a label at the beginning of each one. llvm-svn: 191710
* Unify conditionals and reformat.Eric Christopher2013-09-271-16/+16
| | | | llvm-svn: 191582
* [Sparc] Implements exception handling in SPARC with DwarfCFI.Venkatraman Govindaraju2013-09-261-0/+3
| | | | llvm-svn: 191432
* Implements parsing and emitting of .cfi_window_save in MC.Venkatraman Govindaraju2013-09-261-0/+3
| | | | llvm-svn: 191431
* Add namespaces to the list of items that we expose via pubnames.Eric Christopher2013-09-241-0/+1
| | | | llvm-svn: 191257
* Add more external types to the pubtypes table. Expand the asmEric Christopher2013-09-231-1/+1
| | | | | | checking patch until we get full dumping support. llvm-svn: 191239
* Rename IsStatic variable to Linkage in order to be a bit more descriptive.Eric Christopher2013-09-231-3/+3
| | | | llvm-svn: 191236
* Formatting.Eric Christopher2013-09-231-6/+6
| | | | llvm-svn: 191235
* Handle gnu pubtypes sections:Eric Christopher2013-09-231-5/+11
| | | | | | | | | | | a) Make sure we are emitting the correct section in our section labels when we begin the module. b) Make sure we are emitting the correct pubtypes section in the presence of gnu pubtypes. c) For C++ struct, union, class, and enumeration types are default external. llvm-svn: 191225
* Fixed debug_aranges handling for common symbols.Richard Mitton2013-09-233-5/+20
| | | | | | | | | | The size of common symbols is now tracked correctly, so they can be listed in the arange section without needing knowledge of other following symbols. .comm (and .lcomm) do not indicate to the system assembler any particular section to use, so we have to treat them as having no section. Test case update to account for this. llvm-svn: 191210
* Move emission of the debug string table to early in the debugEric Christopher2013-09-203-22/+46
| | | | | | | info finalization to greatly reduce the number of fixups that the assembler has to handle in order to improve compile time. llvm-svn: 191119
OpenPOWER on IntegriCloud