summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
Commit message (Collapse)AuthorAgeFilesLines
* DebugInfo: Use MC line table file entry uniquing for non-asm input as well.David Blaikie2014-03-172-35/+2
| | | | | | | | | | | | | See r204027 for the precursor to this that applied to asm debug info. This required some non-obvious API changes to handle the case of asm output (we never go asm->asm so this didn't come up in r204027): the modification of the file/directory name by MCDwarfLineTableHeader needed to be reflected in the MCAsmStreamer caller so it could print the appropriate .file directive, so those StringRef parameters are now non-const ref (in/out) parameters rather than just const. llvm-svn: 204069
* Debug info: Unique types before emitting them to DWARF, where applicable.Adrian Prantl2014-03-141-0/+3
| | | | llvm-svn: 203983
* Debug Info: Fix LTO type uniquing for C++ member declarationsAdrian Prantl2014-03-144-1/+53
| | | | | | | | | | | | | | | | based on the ODR. This adds an OdrMemberMap to DwarfDebug which is used to unique C++ member function declarations based on the unique identifier of their containing class and their mangled name. We can't use the usual DIRef mechanism here because DIScopes are indexed using their entire MDNode, including decl_file and decl_line, which need not be unique (see testcase). Prior to this change multiple redundant member function declarations would end up in the same uniqued DW_TAG_class_type. llvm-svn: 203982
* typoAdrian Prantl2014-03-141-1/+1
| | | | llvm-svn: 203980
* Remove command line option for CU hashing. This is on by default now.Eric Christopher2014-03-141-10/+2
| | | | | | Fix up testcases and use of flag. llvm-svn: 203973
* If we see that we're emitting code for a function that doesn't haveEric Christopher2014-03-141-1/+3
| | | | | | | | any lexical scopes then go ahead and turn on DW_AT_ranges for the compile unit since we would be claiming to describe in the CU a range for which we don't have information in the CU otherwise. llvm-svn: 203969
* Remove the -generate-dwarf-cu-ranges flag.Eric Christopher2014-03-141-12/+6
| | | | | | | Rewrite a couple of testcases to cover areas that would be normally by turning it on into testcases that will follow the logic. llvm-svn: 203968
* DwarfDebug: Remove some needless recursion.David Blaikie2014-03-141-2/+4
| | | | llvm-svn: 203946
* Use DW_AT_linkage_name when we're emitting DWARF4 or above.Eric Christopher2014-03-131-1/+2
| | | | llvm-svn: 203867
* Remove the linker_private and linker_private_weak linkages.Rafael Espindola2014-03-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These linkages were introduced some time ago, but it was never very clear what exactly their semantics were or what they should be used for. Some investigation found these uses: * utf-16 strings in clang. * non-unnamed_addr strings produced by the sanitizers. It turns out they were just working around a more fundamental problem. For some sections a MachO linker needs a symbol in order to split the section into atoms, and llvm had no idea that was the case. I fixed that in r201700 and it is now safe to use the private linkage. When the object ends up in a section that requires symbols, llvm will use a 'l' prefix instead of a 'L' prefix and things just work. With that, these linkages were already dead, but there was a potential future user in the objc metadata information. I am still looking at CGObjcMac.cpp, but at this point I am convinced that linker_private and linker_private_weak are not what they need. The objc uses are currently split in * Regular symbols (no '\01' prefix). LLVM already directly provides whatever semantics they need. * Uses of a private name (start with "\01L" or "\01l") and private linkage. We can drop the "\01L" and "\01l" prefixes as soon as llvm agrees with clang on L being ok or not for a given section. I have two patches in code review for this. * Uses of private name and weak linkage. The last case is the one that one could think would fit one of these linkages. That is not the case. The semantics are * the linker will merge these symbol by *name*. * the linker will hide them in the final DSO. Given that the merging is done by name, any of the private (or internal) linkages would be a bad match. They allow llvm to rename the symbols, and that is really not what we want. From the llvm point of view, these objects should really be (linkonce|weak)(_odr)?. For now, just keeping the "\01l" prefix is probably the best for these symbols. If we one day want to have a more direct support in llvm, IMHO what we should add is not a linkage, it is just a hidden_symbol attribute. It would be applicable to multiple linkages. For example, on weak it would produce the current behavior we have for objc metadata. On internal, it would be equivalent to private (and we should then remove private). llvm-svn: 203866
* Reject alias to undefined symbols in the verifier.Rafael Espindola2014-03-121-5/+1
| | | | | | | | | | | | | | | On ELF and COFF an alias is just another name for a position in the file. There is no way to refer to a position in another file, so an alias to undefined is meaningless. MachO currently doesn't support aliases. The spec has a N_INDR, which when implemented will have a different set of restrictions. Adding support for it shouldn't be harder than any other IR extension. For now, having the IR represent what is actually possible with current tools makes it easier to fix the design of GlobalAlias. llvm-svn: 203705
* When computing the size of a base type be conservative if the typeEric Christopher2014-03-121-2/+3
| | | | | | is a declaration and return the size of the type. llvm-svn: 203690
* Use values we've already computed, update comment.Eric Christopher2014-03-121-4/+3
| | | | | | No functional change. llvm-svn: 203681
* Turn on hashing by default for split dwarf compile units.Eric Christopher2014-03-121-1/+1
| | | | llvm-svn: 203680
* DebugInfo: Use common line/file attribute construction codeDavid Blaikie2014-03-121-5/+3
| | | | llvm-svn: 203676
* DebugInfo: Omit pubnames/pubtypes when compiling with -gmltDavid Blaikie2014-03-121-2/+5
| | | | llvm-svn: 203634
* DebugInfo: Do not emit pubnames/pubtypes sections if they are emptyDavid Blaikie2014-03-111-0/+3
| | | | llvm-svn: 203622
* DebugInfo: Avoid re-looking up the DwarfUnit when emitting pubnames/pubtypesDavid Blaikie2014-03-111-1/+4
| | | | llvm-svn: 203620
* DebugInfo: Refactor emitDebugPubNames/Types into a common implementationDavid Blaikie2014-03-112-56/+16
| | | | | | | | | | I could fold the callers into their one call site, but the indirection (given how verbose choosing the section is) seemed helpful. The use of a member function pointer's a bit "tricky", but seems limited enough, the call sites are simple/clean/clear, and there's only one use. llvm-svn: 203619
* Accept Twine's to AsmPrinter::getTempSymbol (refactoring for an incoming change)David Blaikie2014-03-111-2/+2
| | | | llvm-svn: 203617
* DebugInfo: Remove unused labels now that we just emit DW_AT_gnu_pubnames as ↵David Blaikie2014-03-111-8/+0
| | | | | | a flag (as of r203082) llvm-svn: 203612
* MachineModuleInfo: Turn nested std::pairs into a proper struct.Benjamin Kramer2014-03-091-10/+7
| | | | llvm-svn: 203414
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-087-68/+68
| | | | | | class. llvm-svn: 203339
* DebugInfo: Use DW_FORM_data4 for DW_AT_high_pc in DW_TAG_lexical_blocksDavid Blaikie2014-03-081-2/+1
| | | | | | Suggested by Adrian Prantl in code review for r203187 llvm-svn: 203323
* Add support for hashing location information for CU level hashes.Eric Christopher2014-03-083-6/+43
| | | | | | | Add a testcase based on sret.cpp where we can now hash the entire compile unit. llvm-svn: 203319
* Remove unnecessary test for Darwin and update testcase to be a little lessAdrian Prantl2014-03-071-1/+1
| | | | | | | horrible/fragile. rdar://problem/16264854 llvm-svn: 203309
* Add a virtual destructor to quiet a warning.Eric Christopher2014-03-071-0/+2
| | | | llvm-svn: 203307
* Actually add the header file.Eric Christopher2014-03-071-0/+69
| | | | llvm-svn: 203305
* Two part patch:Eric Christopher2014-03-073-102/+104
| | | | | | | | | | | | | | | First: refactor out the emission of entries into the .debug_loc section into its own routine. Second: add a new class ByteStreamer that can be used to either emit using an AsmPrinter or hash using DIEHash the series of bytes that would be emitted. Use this in all of the location emission routines for the .debug_loc section. No functional change intended outside of a few additional comments in verbose assembly. llvm-svn: 203304
* Add include guards and make public a few routines that add valuesEric Christopher2014-03-071-1/+11
| | | | | | to the hash. llvm-svn: 203303
* Revert "Remove unnecessary check for Darwin. rdar://problem/16264854"Adrian Prantl2014-03-071-1/+1
| | | | | | This breaks linux buildbots. Go figure. llvm-svn: 203300
* Remove unnecessary check for Darwin. rdar://problem/16264854Adrian Prantl2014-03-071-1/+1
| | | | llvm-svn: 203297
* DebugInfo: Use DW_FORM_data4 for DW_AT_high_pc in inlined functionsDavid Blaikie2014-03-071-2/+1
| | | | | | Suggested by Adrian Prantl in code review for r203187. llvm-svn: 203296
* [C++11] Convert sort predicates into lambdas.Benjamin Kramer2014-03-072-17/+4
| | | | | | No functionality change. llvm-svn: 203288
* Fix up formatting.Eric Christopher2014-03-071-9/+8
| | | | llvm-svn: 203286
* [C++11] DwarfDebug: Turn single-use functors into lambdas.Benjamin Kramer2014-03-071-25/+16
| | | | | | No functionality change. llvm-svn: 203276
* [C++11] DwarfDebug: Use range-based for loops.Benjamin Kramer2014-03-071-245/+116
| | | | | | It has a lot of them with complex types. C++11 really shines here. llvm-svn: 203270
* DebugInfo: Refactor high_pc/low_pc construction into reusable functionDavid Blaikie2014-03-072-6/+13
| | | | | | | For incoming improvements to inlined functions and lexical blocks suggested by Adrian Prantl in review of r203187. llvm-svn: 203263
* DebugInfo: Restrict DW_AT_high_pc encoding as data4 offset to DWARF 4 as per ↵David Blaikie2014-03-071-1/+1
| | | | | | | | spec Code review feedback to r203187 from Oliver Stannard. Thanks! llvm-svn: 203256
* Replace PROLOG_LABEL with a new CFI_INSTRUCTION.Rafael Espindola2014-03-072-18/+9
| | | | | | | | | | | | | | | | | | | | | | | The old system was fairly convoluted: * A temporary label was created. * A single PROLOG_LABEL was created with it. * A few MCCFIInstructions were created with the same label. The semantics were that the cfi instructions were mapped to the PROLOG_LABEL via the temporary label. The output position was that of the PROLOG_LABEL. The temporary label itself was used only for doing the mapping. The new CFI_INSTRUCTION has a 1:1 mapping to MCCFIInstructions and points to one by holding an index into the CFI instructions of this function. I did consider removing MMI.getFrameInstructions completelly and having CFI_INSTRUCTION own a MCCFIInstruction, but MCCFIInstructions have non trivial constructors and destructors and are somewhat big, so the this setup is probably better. The net result is that we don't create temporary labels that are never used. llvm-svn: 203204
* DebugInfo: Limit r203187 to non-darwin as lldb can't handle this yetDavid Blaikie2014-03-071-2/+5
| | | | llvm-svn: 203192
* Move some dwarf emission routines to AsmPrinterDwarf.cpp.Eric Christopher2014-03-072-156/+157
| | | | llvm-svn: 203191
* 80-column fixups.Eric Christopher2014-03-071-6/+8
| | | | llvm-svn: 203190
* DebugInfo: Emit DW_TAG_subprogram's DW_AT_high_pc as an offset from the low_pcDavid Blaikie2014-03-073-1/+12
| | | | | | | This removes a relocation from each subprogram, reducing link times, etc. llvm-svn: 203187
* Remove shouldEmitUsedDirectiveFor.Rafael Espindola2014-03-061-1/+1
| | | | | | Clang now uses llvm.compiler.used for these cases. llvm-svn: 203174
* Constify a few things with DotDebugLocEntry.Eric Christopher2014-03-062-4/+4
| | | | llvm-svn: 203150
* Move DIEEntry handling inside the main switch statement.Eric Christopher2014-03-061-10/+6
| | | | | | No functional change. llvm-svn: 203142
* Micro optimization: this code only needs to look at eh labels.Rafael Espindola2014-03-061-1/+1
| | | | llvm-svn: 203127
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-062-9/+6
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* DebugInfo: Tag units as having been indexed in GNU pubnames by using a ↵David Blaikie2014-03-061-7/+1
| | | | | | | | | | DW_AT_GNU_pubnames of DW_FORM_flag(_present) rather than sec_offsets to the pubnames/types sections This is consistent with GDB ToT and reduces the number of relocations in (type and compile) units, substantially reducing relocations and debug size in fission + type units builds. llvm-svn: 203082
OpenPOWER on IntegriCloud