summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCDwarf.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move get[S|U]LEB128Size() to LEB128.h.Logan Chien2014-02-221-2/+1
| | | | | | | | | | This commit moves getSLEB128Size() and getULEB128Size() from MCAsmInfo to LEB128.h and removes some copy-and-paste code. Besides, this commit also adds some unit tests for the LEB128 functions. llvm-svn: 201937
* Support DWARF discriminators in object streamer.Diego Novillo2014-02-141-0/+10
| | | | | | | | | | | | | | | Summary: This adds support for emitting DWARF path discriminator values in the object streamer. It also changes the DWARF dumper to show discriminator values in the line table output. Reviewers: echristo CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2794 llvm-svn: 201427
* MC: Add support for .cfi_startproc simpleDavid Majnemer2014-01-271-13/+22
| | | | | | | | | | | | | This commit allows LLVM MC to process .cfi_startproc directives when they are followed by an additional `simple' identifier. This signals to elide the emission of target specific CFI instructions that would normally occur initially. This fixes PR16587. Differential Revision: http://llvm-reviews.chandlerc.com/D2624 llvm-svn: 200227
* [patch] Adjust behavior of FDE cross-section relocs for targets that don't ↵Iain Sandoe2014-01-081-6/+10
| | | | | | | | | | | | support abs-differences. Modern versions of OSX/Darwin's ld (ld64 > 97.17) have an optimisation present that allows the back end to omit relocations (and replace them with an absolute difference) for FDE some text section refs. This patch allows a backend to opt-in to this behaviour by setting "DwarfFDESymbolsUseAbsDiff". At present, this is only enabled for modern x86 OSX ports. test changes by David Fang. llvm-svn: 198744
* Fix a crash that occurs when PWD is invalid.Andrew Trick2013-12-101-3/+6
| | | | | | | | | | | | | | | | | | | | MCJIT needs to be able to run in hostile environments, even when PWD is invalid. There's no need to crash MCJIT in this case. The obvious fix is to simply leave MCContext's CompilationDir empty when PWD can't be determined. This way, MCJIT clients, and other clients that link with LLVM don’t need a valid working directory. If we do want to guarantee valid CompilationDir, that should be done only for clients of getCompilationDir(). This is as simple as checking for an empty string. The only current use of getCompilationDir is EmitGenDwarfInfo, which won’t conceivably run with an invalid working dir. However, in the purely hypothetically and untestable case that this happens, the AT_comp_dir will be omitted from the compilation_unit DIE. llvm-svn: 196874
* Implements parsing and emitting of .cfi_window_save in MC.Venkatraman Govindaraju2013-09-261-0/+4
| | | | llvm-svn: 191431
* Call generateCompactUnwindEncodings() right before we need to output the ↵Bill Wendling2013-09-091-3/+4
| | | | | | | | | | | | | frame information. There are more than one paths to where the frame information is emitted. Place the call to generateCompactUnwindEncodings() into the method which outputs the frame information, thus ensuring that the encoding is there for every path. This involved threading the MCAsmBackend object through to this method. <rdar://problem/13623355> llvm-svn: 190335
* Fix comments to reflect reality.Bill Wendling2013-09-051-6/+2
| | | | llvm-svn: 190021
* Use ArrayRef instead of explicit container.Bill Wendling2013-09-041-2/+2
| | | | llvm-svn: 190003
* Remove address spaces from MC.Rafael Espindola2013-07-021-1/+1
| | | | | | | | This is dead code since PIC16 was removed in 2010. The result was an odd mix, where some parts would carefully pass it along and others would assert it was zero (most of the object streamer for example). llvm-svn: 185436
* Use pointers to the MCAsmInfo and MCRegInfo.Bill Wendling2013-06-181-36/+35
| | | | | | | | | Someone may want to do something crazy, like replace these objects if they change or something. No functionality change intended. llvm-svn: 184175
* [MC/DWARF] Support .debug_frame / .debug_line code alignment factorsUlrich Weigand2013-06-121-29/+19
| | | | | | | | | | | | | | | | | | | | | | | | | I've been comparing the object file output of LLVM's integrated assembler against the external assembler on PowerPC, and one area where differences still remain are in DWARF sections. In particular, the GNU assembler generates .debug_frame and .debug_line sections using a code alignment factor of 4, since all PowerPC instructions have size 4 and must be aligned to a multiple of 4. However, current MC code hard-codes a code alignment factor of 1. This patch changes this by adding a "minimum instruction alignment" data element to MCAsmInfo and using this as code alignment factor. This requires passing a MCContext into MCDwarfLineAddr::Encode and MCDwarfLineAddr::EncodeAdvanceLoc. Note that one caller, MCDwarfLineAddr::Write, didn't actually have that information available. However, it turns out that this routine is in fact never used in the whole code base, so the patch simply removes it. If it turns out to be needed again at a later time, it could be re-added with an updated interface. llvm-svn: 183834
* Use the const_cast only where necessary.Bill Wendling2013-05-301-4/+4
| | | | llvm-svn: 182950
* Remove the MachineMove class.Rafael Espindola2013-05-131-37/+2
| | | | | | | | | | | | It was just a less powerful and more confusing version of MCCFIInstruction. A side effect is that, since MCCFIInstruction uses dwarf register numbers, calls to getDwarfRegNum are pushed out, which should allow further simplifications. I left the MachineModuleInfo::addFrameMove interface unchanged since this patch was already fairly big. llvm-svn: 181680
* Remove redundant check and use cached FrameArray values.Bob Wilson2013-05-071-12/+8
| | | | | | No functional change. llvm-svn: 181355
* Align the __LD,__compact_unwind section.Bill Wendling2013-04-241-7/+16
| | | | | | | | I know what would be cool! We should align the compact unwind section because aligned data access is faster. <rdar://problem/13723271> llvm-svn: 180171
* Relax this assert. It may not hold in all cases.Bill Wendling2013-04-181-1/+1
| | | | llvm-svn: 179814
* Assert if we're trying to generate a null compact unwind entry.Bill Wendling2013-04-181-4/+2
| | | | llvm-svn: 179809
* Add support for subsections to the ELF assembler. Fixes PR8717.Peter Collingbourne2013-04-171-1/+3
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D598 llvm-svn: 179725
* No need to have this return a bool.Bill Wendling2013-04-101-4/+4
| | | | llvm-svn: 179226
* Track the compact unwind encoding for when we are unable to generate compact ↵Bill Wendling2013-04-101-5/+4
| | | | | | | | | | unwind information. Compact unwind has an encoding for when we're not able to generate compact unwind and must generate an EH frame instead. Track that, but still emit that CU encoding. llvm-svn: 179220
* Debug Info: use SmallVector instead of std::vector in MCDwarfDirsCUMap and ↵Manman Ren2013-03-121-4/+4
| | | | | | MCDwarfFilesCUMap llvm-svn: 176893
* Debug Info: store the files and directories for each compile unit.Manman Ren2013-03-071-2/+2
| | | | | | | | | | | | | | We now emit a line table for each compile unit. To reduce the prologue size of each line table, the files and directories used by each compile unit are stored in std::map<unsigned, std::vector< > > instead of std::vector< >. The prologue for a lto'ed image can be as big as 93K. Duplicating 93K for each compile unit causes a huge increase of debug info. With this patch, each prologue will only emit the files required by the compile unit. rdar://problem/13342023 llvm-svn: 176605
* Formatting.Eric Christopher2013-02-071-2/+1
| | | | llvm-svn: 174664
* Dwarf: support for LTO where a single object file can have multiple line tablesManman Ren2013-02-051-12/+41
| | | | | | | | | We generate one line table for each compilation unit in the object file. Reviewed by Eric and Kevin. rdar://problem/13067005 llvm-svn: 174445
* Initial patch for x32 ABI support.Eli Bendersky2013-01-221-1/+1
| | | | | | | | Add the x32 environment kind to the triple, and separate the concept of pointer size and callee save stack slot size, since they're not equal on x32. llvm-svn: 173175
* We want the dwarf AT_producer for assembly source files to match clang'sKevin Enderby2013-01-161-3/+9
| | | | | | | | | | | | | | | AT_producer. Which includes clang's version information so we can tell which version of the compiler was used. This is the first of two steps to allow us to do that. This is the llvm-mc change to provide a method to set the AT_producer string. The second step, coming soon to a clang near you, will have the clang driver pass the value of getClangFullVersion() via an flag when invoking the integrated assembler on assembly source files. rdar://12955296 llvm-svn: 172630
* These functions have default arguments of 0 for the last arg. UseEric Christopher2013-01-091-17/+17
| | | | | | them. llvm-svn: 171933
* Prepare LLVM to fix PR14625, exposing a hook in MCContext to manage theChandler Carruth2012-12-171-2/+1
| | | | | | | | | | compilation directory. This defaults to the current working directory, just as it always has, but now an assembler can choose to override it with a custom directory. I've taught llvm-mc about this option and added a test case. llvm-svn: 170371
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-6/+6
| | | | | | | | | | | | | | | | | 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
* Add support for .cfi_register now that it is easy to extent the representationRafael Espindola2012-11-251-0/+13
| | | | | | | to support it. Original patch with the parsing and plumbing by the PaX team and Roman Divacky. I added the bits in MCDwarf.cpp and the test. llvm-svn: 168565
* Change the representation of MCCFIInstruction.Rafael Espindola2012-11-241-20/+12
| | | | | | | We now store the Register and Offset directly. MachineLocation is gone (from this file)! llvm-svn: 168536
* Give each MCCFIInstruction its own opcode.Rafael Espindola2012-11-241-40/+65
| | | | | | | This untangles the switch cases of the old Move and RelMove opcodes a bit and makes it clear how to add new instructions. llvm-svn: 168534
* Refactor how MCCFIInstructions are created.Rafael Espindola2012-11-241-2/+15
| | | | | | | | | | Give MCCFIInstruction a single, private constructor and add helper static methods that create each type of cfi instruction. This is is preparation for changing its representation. The representation with a pair MachineLocations older than MC and has been abused quiet a bit to support more cfi instructions. llvm-svn: 168532
* Implement .cfi_undefined. Based on a patch from PaX team, updated byRafael Espindola2012-11-231-0/+10
| | | | | | Roman Divacky. I just added the testcase. llvm-svn: 168520
* Emit relocations from .debug_aranges to .debug_info for asm filesAlexey Samsonov2012-11-141-9/+19
| | | | llvm-svn: 167926
* Release build: guard dump functions withManman Ren2012-09-121-1/+1
| | | | | | | | "#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)" No functional change. Update r163344. llvm-svn: 163679
* Release build: guard dump functions with "ifndef NDEBUG"Manman Ren2012-09-061-0/+2
| | | | | | No functional change. llvm-svn: 163344
* When emitting the PC range in an FDE, use the same data encoding for both endsNick Lewycky2012-08-121-9/+6
| | | | | | of the range. Fixes PR13581! llvm-svn: 161739
* Move [SU]LEB128 encoding to a utility header.Jim Grosbach2012-08-081-3/+4
| | | | | | | These functions are very generic. There's no reason for them to be tied to MCObjectWriter. llvm-svn: 161545
* Fix a typo (the the => the)Sylvestre Ledru2012-07-231-1/+1
| | | | llvm-svn: 160621
* Fix a FIXME: DwarfRequiresRelocationForSectionOffset is the same asRafael Espindola2012-06-221-2/+2
| | | | | | DwarfUsesRelocationsAcrossSections. llvm-svn: 158992
* Tidy up. Trailing whitespace.Jim Grosbach2012-05-111-6/+6
| | | | llvm-svn: 156602
* Compute hashes directly with hash_combine instead of taking a detour through ↵Benjamin Kramer2012-04-111-7/+5
| | | | | | FoldingSetNodeID. llvm-svn: 154495
* On ELF, create relocations to the abbreviation and line sections when producingRafael Espindola2012-02-281-6/+27
| | | | | | | | | | debug info for assembly files. We were already doing the right thing when producing debug info for C/C++. ELF linkers don't know dwarf, so they depend on these relocations to produce valid dwarf output. llvm-svn: 151655
* Grammar-o.Eric Christopher2012-02-251-1/+1
| | | | llvm-svn: 151418
* Convert assert(0) to llvm_unreachableCraig Topper2012-02-071-2/+1
| | | | llvm-svn: 149967
* Add support for .cfi_signal_frame. Fixes pr11762.Rafael Espindola2012-01-231-7/+15
| | | | llvm-svn: 148733
* Add missing breaks to switch.Benjamin Kramer2012-01-201-13/+25
| | | | | | Found by the clang static analyzer. llvm-svn: 148543
* This is the matching change for the data structure name changes for theKevin Enderby2012-01-101-18/+18
| | | | | | | functional change in r147860 to use DW_TAG_label's instead TAG_subprogram's. This only changes names and updates comments. No functional change. llvm-svn: 147877
OpenPOWER on IntegriCloud