summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCDwarf.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Refactor how passes get a symbol at the end of a section.Rafael Espindola2015-03-231-15/+6
| | | | | | | | | | There is now a canonical symbol at the end of a section that different passes can request. This also allows us to assert that we don't switch back to a section whose end symbol has already been printed. llvm-svn: 233026
* Update variable name and reuse existing variable. NFC.Rafael Espindola2015-03-231-5/+5
| | | | llvm-svn: 233014
* Remove many superfluous SmallString::str() calls.Yaron Keren2015-03-181-1/+1
| | | | | | | | | | | | | | | Now that SmallString is a first-class citizen, most SmallString::str() calls are not required. This patch removes a whole bunch of them, yet there are lots more. There are two use cases where str() is really needed: 1) To use one of StringRef member functions which is not available in SmallString. 2) To convert to std::string, as StringRef implicitly converts while SmallString do not. We may wish to change this, but it may introduce ambiguity. llvm-svn: 232622
* Fix build failure on MSVC compilers.Gabor Horvath2015-03-161-3/+2
| | | | llvm-svn: 232368
* [llvm] Replacing asserts with static_asserts where appropriateGabor Horvath2015-03-161-1/+3
| | | | | | | | | | | | | | | | Summary: This patch consists of the suggestions of clang-tidy/misc-static-assert check. Reviewers: alexfh Reviewed By: alexfh Subscribers: xazax.hun, llvm-commits Differential Revision: http://reviews.llvm.org/D8343 llvm-svn: 232366
* [MCDwarf] Do not emit useless line table opcode.Frederic Riss2015-03-151-1/+1
| | | | | | | | | | | | | No need to emit a DW_LNS_advance_pc with a 0 increment. Found out while comparing dsymutil's and LLVM's line table encoding. Not a correctenss fix, just a small encoding size optimization. I'm not sure how to generate a sequence that triggers this, and moreover llvm-dwardump doesn't dump the line table program, thus the effort involved in creating a testcase for this trivial patch seemed out of proportion. llvm-svn: 232332
* [MC] Use the non-EH register mapping in the debug_frame section.Frederic Riss2015-02-261-4/+20
| | | | | | | | | | | | | | | | | | | | On 32bits x86 Darwin, the register mappings for the eh_frane and debug_frame sections are different. Thus the same CFI instructions should result in different registers in the object file. The problem isn't target specific though, but it requires that the mappings for EH register numbers be different from the standard Dwarf one. The patch looks a bit clumsy. LLVM uses the EH mapping as canonical for everything frame related. Thus we need to do a double conversion EH -> LLVM -> Non-EH, when emitting the debug_frame section. Fixes PR22363. Differential Revision: http://reviews.llvm.org/D7593 llvm-svn: 230670
* Remove StringMap::GetOrCreateValue in favor of StringMap::insertDavid Blaikie2014-11-191-4/+4
| | | | | | | | | | | | | | Having two ways to do this doesn't seem terribly helpful and consistently using the insert version (which we already has) seems like it'll make the code easier to understand to anyone working with standard data structures. (I also updated many references to the Entry's key and value to use first() and second instead of getKey{Data,Length,} and get/setValue - for similar consistency) Also removes the GetOrCreateValue functions so there's less surface area to StringMap to fix/improve/change/accommodate move semantics, etc. llvm-svn: 222319
* Drop support for an old version of ld64 (from darwin 9).Rafael Espindola2014-10-211-12/+0
| | | | llvm-svn: 220310
* Downgrade DWARF2 section limit error to a warningOliver Stannard2014-09-221-4/+6
| | | | | | | | | We currently emit an error when trying to assemble a file with more than one section using DWARF2 debug info. This should be a warning instead, as the resulting file will still be usable, but with a degraded debug illusion. llvm-svn: 218241
* MC: correct DWARF line info for PE/COFFSaleem Abdulrasool2014-09-061-1/+2
| | | | | | | | | DWARF address ranges contain a reference to the debug_info section. This offset is an absolute relocation except on non-PE/COFF targets where it is section relative. We would emit this incorrectly, and trying to map the debug info from the address would fail. llvm-svn: 217317
* MC: correct DWARF header for PE/COFF assembly inputSaleem Abdulrasool2014-09-051-4/+4
| | | | | | | | | | | The header contains an offset to the DWARF line table for the CU. The offset must be section relative for COFF and absolute for others. The non-assembly code path for the DWARF header generation already has the correct emission for the headers. This corrects the assembly input path. This was identified by BFD objecting to the LLVM generated DWARF information. llvm-svn: 217222
* Remove unused field.Rafael Espindola2014-08-201-3/+1
| | | | llvm-svn: 216086
* Make EmitAbsValue an static helper.Rafael Espindola2014-08-151-14/+31
| | | | llvm-svn: 215721
* Don't print comments to an object streamer :-)Rafael Espindola2014-08-151-128/+13
| | | | llvm-svn: 215689
* MC: permit emitting a symbol value as section relativeSaleem Abdulrasool2014-07-191-3/+3
| | | | | | | | | | | This adds an optional parameter to the EmitSymbolValue method in MCStreamer to permit emitting a symbol value as a section relative value. This is to cover the use in MCDwarf which should not really know about how to emit a section relative value for a given target. This addresses post-review comments from Eric Christopher in SVN r213275. llvm-svn: 213463
* MC: correct DWARF header for PE/COFF assembly inputSaleem Abdulrasool2014-07-171-4/+5
| | | | | | | | | | | | | | The header contains an offset to the DWARF abbreviations for the CU. The offset must be section relative for COFF and absolute for others. The non-assembly code path for the DWARF header generation already had the correct emission for the headers. This corrects just the assembly path. Due to the invalid relocation, processing of the debug information would halt previously on the first assembly input as the associated abbreviations would be out of range as they would have the location increased by image base and the section offset. This address PR20332. llvm-svn: 213275
* MC: collapse emission of producerSaleem Abdulrasool2014-07-171-7/+3
| | | | | | | | Rather than use three EmitBytes, concatenate the string at compile time, constructing a single StringRef and emitting the data in one shot. This also creates nicer assembly output. NFC. llvm-svn: 213273
* MC: make DWARF and Windows unwinding handling more similarSaleem Abdulrasool2014-07-131-1/+1
| | | | | | | | Rename member variables and functions for the MCStreamer for DWARF-like unwinding management. Rename the Windows ones as well and make the naming and handling similar across the two. No functional change intended. llvm-svn: 212912
* SourceMgr: make valid buffer IDs start from oneAlp Toker2014-07-061-1/+1
| | | | | | | | | | Use 0 for the invalid buffer instead of -1/~0 and switch to unsigned representation to enable more idiomatic usage. Also introduce a trivial SourceMgr::getMainFileID() instead of hard-coding 0/1 to identify the main file. llvm-svn: 212398
* Revert "Introduce a string_ostream string builder facilty"Alp Toker2014-06-261-2/+4
| | | | | | Temporarily back out commits r211749, r211752 and r211754. llvm-svn: 211814
* Introduce a string_ostream string builder faciltyAlp Toker2014-06-261-4/+2
| | | | | | | | | | | | | | | | | | | | string_ostream is a safe and efficient string builder that combines opaque stack storage with a built-in ostream interface. small_string_ostream<bytes> additionally permits an explicit stack storage size other than the default 128 bytes to be provided. Beyond that, storage is transferred to the heap. This convenient class can be used in most places an std::string+raw_string_ostream pair or SmallString<>+raw_svector_ostream pair would previously have been used, in order to guarantee consistent access without byte truncation. The patch also converts much of LLVM to use the new facility. These changes include several probable bug fixes for truncated output, a programming error that's no longer possible with the new interface. llvm-svn: 211749
* Allow using .cfi_startproc without a leading symbol.Rafael Espindola2014-06-231-1/+1
| | | | | | This is possible now that we don't produce .eh symbols. This fixes pr19430. llvm-svn: 211502
* Stop producing func.eh symbols on Darwin.Rafael Espindola2014-06-231-7/+0
| | | | | | | | | | According Nick Kledzik (http://llvm.org/bugs/show_bug.cgi?id=19430#c2): "... mach-o no longer needs names in the __eh_frame section (and has not for years)." Iain Sandoe confirms it is also unnecessary for their old darwin support. llvm-svn: 211500
* Always use a temp symbol for CIE.Rafael Espindola2014-06-201-6/+1
| | | | | | Fixes pr19185. llvm-svn: 211423
* Fix up a few formatting issues.Eric Christopher2014-06-191-14/+13
| | | | llvm-svn: 211307
* Emit DWARF info for all code section in an assembly fileOliver Stannard2014-06-191-40/+134
| | | | | | | | Currently, when using llvm as an assembler, DWARF debug information is only generated for the .text section. This patch modifies this so that DWARF info is emitted for all executable sections. llvm-svn: 211273
* Emit DWARF3 call frame information when DWARF3+ debug info is requestedOliver Stannard2014-06-191-2/+12
| | | | | | | | | | | | | | | | Currently, llvm always emits a DWARF CIE with a version of 1, even when emitting DWARF 3 or 4, which both support CIE version 3. This patch makes it emit the newer CIE version when we are emitting DWARF 3 or 4. This will not reduce compatibility, as we already emit other DWARF3/4 features, and is worth doing as the DWARF3 spec removed some ambiguities in the interpretation of call frame information. It also fixes a minor bug where the "return address" field of the CIE was encoded as a ULEB128, which is only valid when the CIE version is 3. There are no test changes for this, because (as far as I can tell) none of the platforms that we test have a return address register with a DWARF register number >127. llvm-svn: 211272
* Fix hardcoded slash to native path seperator which was exposed from ↵Yaron Keren2014-05-161-1/+1
| | | | | | | | llvm::sys::path. http://reviews.llvm.org/D3687 llvm-svn: 208980
* Pass a MCObjectStreamer instead of a MCStreamer when possible.Rafael Espindola2014-05-121-9/+9
| | | | | | No functionality change. llvm-svn: 208569
* Pass a MCObjectStreamer instead of a MCStreamer when possible.Rafael Espindola2014-05-121-6/+6
| | | | | | No functionality change. llvm-svn: 208567
* Remove always true argument and unused field.Rafael Espindola2014-05-121-3/+3
| | | | llvm-svn: 208561
* Remove always true argument and field.Rafael Espindola2014-05-121-10/+7
| | | | llvm-svn: 208559
* Remove always true argument.Rafael Espindola2014-05-121-2/+2
| | | | llvm-svn: 208558
* Record the DWARF version in MCContextOliver Stannard2014-05-011-2/+2
| | | | | | | Record the DWARF version in MCContext, and use it when emitting the dwarf version into the debug info. llvm-svn: 207739
* [C++11] More 'nullptr' conversion or in some cases just using a boolean ↵Craig Topper2014-04-131-11/+15
| | | | | | check instead of comparing to nullptr. llvm-svn: 206129
* Retire llvm::array_endof in favor of non-member std::end.Benjamin Kramer2014-04-121-0/+1
| | | | | | While there make array_lengthof constexpr if we have support for it. llvm-svn: 206112
* Use value types instead of 'new'd objects to store dwarf labels for asm filesDavid Blaikie2014-04-111-22/+9
| | | | llvm-svn: 206009
* DebugInfo: Avoid creating unnecessary/empty line tables and remove the ↵David Blaikie2014-04-011-4/+2
| | | | | | | | | | | | special case of '0' in DwarfCompileUnit::initStmtList by just always using a label difference This moves one case of raw text checking down into the MCStreamer interfaces in the form of a virtual function, even if we ultimately end up consolidating on the one-or-many line tables issue one day, this is nicer in the interim. This just generally streamlines a bunch of use cases into a common code path. llvm-svn: 205287
* DebugInfo: Emit relocation to debug_line section when emitting asm for asmDavid Blaikie2014-04-011-20/+17
| | | | | | | | | | | | | | I don't think this is reachable by any frontend (why would you transform asm to asm+debug info?) but it helps tidy up some of this code, avoid the weird special case of "emit the first CU, store the label, then emit the rest" in MCDwarfLineTable::Emit by instead having the DWARF-for-assembly case use the same codepath as DwarfDebug.cpp, by registering the label of the debug_line section, thus causing it to be emitted. (with a special case in asm output to just emit the label since asm output uses the .loc directives, etc, rather than the debug_loc directly) llvm-svn: 205286
* MC-exceptions: add support for compact-unwind without .eh_frameTim Northover2014-03-291-3/+21
| | | | | | | | | | | | ARM64 has compact-unwind information, but doesn't necessarily want to emit .eh_frame directives as well. This teaches MC about such a situation so that it will skip .eh_frame info when compact unwind has been successfully produced. For functions incompatible with compact unwind, the normal information is still written. llvm-svn: 205087
* Don't use EmitAbsValue with symbol references.Rafael Espindola2014-03-201-4/+4
| | | | | | | | | | | | | | | The function exists to force an expression to be absolute, but there it is not possible to force a symbol reference since a = b .long a means something else. This is an alternative fix for pr9951 that uses an assert. It then deletes the old pr9951 test that was testing nothing already. llvm-svn: 204399
* DebugInfo: Avoid emitting standard opcode lengths in debug_line.dwo headers ↵David Blaikie2014-03-181-13/+29
| | | | | | | | | where opcodes are never used anyway Introduce a slightly tighter wrapper around the header structure that handles this use case. (MCDwarfDwoLineTable) llvm-svn: 204101
* DebugInfo: Move line table zero-directory-index (compilation dir) handling ↵David Blaikie2014-03-171-0/+2
| | | | | | | | | | | | into MCDwarf Our handling of compilation directory in DwarfDebug was broken (incorrectly using the 'last' compilation directory (that of the last CU in the metadata list) for all function emission in any CU). By moving this handling down into MCDwarf the issue is fixed as the compilation dir is tracked correctly per line table. llvm-svn: 204089
* DebugInfo: Use MC line table file entry uniquing for non-asm input as well.David Blaikie2014-03-171-3/+9
| | | | | | | | | | | | | 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
* DebugInfo: Improve reuse of file table entries in asm debug infoDavid Blaikie2014-03-171-1/+12
| | | | | | | | | | | | | | | | | The previous deduping strategy was woefully inadequate - it only considered the most recent file used and avoided emitting a duplicate in that case - never considering the a/b/a scenario. It was also lacking when it came to directory paths as the previous filename would never match the current if the filename had been split into file and directory components. This change builds caching functionality into the line table at the lowest level in an optional form (a file number of 0 indicates that one should be chosen and returned) and will eventually be reused by the normal source level debugging DWARF emission. llvm-svn: 204027
* MCDwarf: Rename MCDwarfFileTable to MCDwarfLineTableDavid Blaikie2014-03-131-6/+7
| | | | | | | This type now represents all the data for the DWARF line table: directory names, file names, and the line table proper. llvm-svn: 203858
* MCDwarf: Extract the DWARF line table header handling into its own typeDavid Blaikie2014-03-131-3/+13
| | | | llvm-svn: 203856
* MCDwarf: Sink file/directory creation down into MCDwarfFileTable form MCContextDavid Blaikie2014-03-131-0/+49
| | | | llvm-svn: 203836
* MCDwarf: Oh, and move the directory string over to std::string as wellDavid Blaikie2014-03-131-2/+1
| | | | | | (see r203831 for similar stuff) llvm-svn: 203833
OpenPOWER on IntegriCloud