aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCDwarf.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-06-26Apply clang-tidy's modernize-loop-convert to lib/MC.Benjamin Kramer1-24/+19
Only minor manual fixes. No functionality change intended. llvm-svn: 273814
2016-06-22Prune some includes from headers and sink some inline functionsReid Kleckner1-0/+1
MCSymbol.h shouldn't pull in MCAssembler.h, just MCFragment.h. MCLinkerOptimizationHint.h shouldn't need MCMachObjectWriter.h. The rest is fixing the fallout. llvm-svn: 273507
2016-06-01[MC] Rename EmitFill to emitFillPetr Hosek1-1/+1
This is to match the overloaded variants as well as the new style. Differential Revision: http://reviews.llvm.org/D20690 llvm-svn: 271359
2016-04-28Read discriminators correctly from object file.Dehao Chen1-4/+1
Summary: This is the follow-up patch for http://reviews.llvm.org/D19436 * Update the discriminator reading algorithm to match the assignment algorithm. * Add test to cover the new algorithm. Reviewers: dnovillo, echristo, dblaikie Subscribers: danielcdh, dblaikie, echristo, llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D19522 llvm-svn: 267945
2016-04-22Update discriminator assignment algorithm in clang assembler.Dehao Chen1-1/+6
Summary: The clang assembler assumes that the discriminator remains the same when there is source line change. The correct behavior is that when there is line change, discriminator will automatically reset to 0. Reviewers: dnovillo, davidxl, echristo Subscribers: echristo, llvm-commits Differential Revision: http://reviews.llvm.org/D19436 llvm-svn: 267226
2016-03-09Don't crash when compiling inline assembler containing .file directives.Adrian Prantl1-3/+3
Removing the assertion is safe to do because any module level inline assembly is always emitted first via AsmPrinter::doInitialization(). http://reviews.llvm.org/D16101 rdar://22690666 llvm-svn: 263033
2016-01-31[MCDwarf] Fix encoding of line tables with weird custom parametersFrederic Riss1-2/+5
With poorly chosen custom parameters, the line table encoding logic would sometimes end up generating a special opcode bigger than 255, which is wrong. The set of default parameters that LLVM uses isn't subject to this bug. When carefully chosing the line table parameters, it's impossible to fall into the corner case that this patch fixes. The standard however doesn't require that these parameters be carefully chosen. And even if it did, we shouldn't generate broken encoding. Add a unittest for this specific encoding bug, and while at it, create some unit tests for the encoding logic using different sets of parameters. llvm-svn: 259334
2016-01-21Rename MCLineEntry to MCDwarfLineEntryDavid Majnemer1-5/+5
MCLineEntry gives the impression that it is generic MC machinery. However, it is specific to DWARF. llvm-svn: 258381
2016-01-04Clang-format my previous change (r256313)Paul Robinson1-5/+5
llvm-svn: 256764
2015-12-28Accept dwarf version 5 for CIE versions.Eric Christopher1-0/+1
llvm-svn: 256527
2015-12-23Form reform for MCDwarf.Paul Robinson1-4/+8
MCDwarf emits a canned abbreviation table, but was not emitting proper forms for DWARF version 4, which is the default after r249655. Differential Revision: http://reviews.llvm.org/D15732 llvm-svn: 256313
2015-11-06git clang-format and fix variable names. NFC.Rafael Espindola1-42/+34
llvm-svn: 252304
2015-11-06Pass SectionStart directly to the one function that uses it.Rafael Espindola1-8/+5
llvm-svn: 252299
2015-11-06Simplify the alignment handling in FDE emission.Rafael Espindola1-16/+15
llvm-svn: 252271
2015-11-06Delete dead store. NFC.Rafael Espindola1-1/+0
llvm-svn: 252270
2015-11-06Use a range loop.Rafael Espindola1-3/+1
llvm-svn: 252260
2015-11-06Pass the streamer to the constructor instead of every other method. NFC.Rafael Espindola1-76/+66
llvm-svn: 252246
2015-11-05Simplify the constructor. NFC.Rafael Espindola1-5/+4
llvm-svn: 252243
2015-11-05git-clang-format an area I am about to change.Rafael Espindola1-32/+29
llvm-svn: 252241
2015-11-05Small simplification by moving early continue earlier.Rafael Espindola1-6/+4
llvm-svn: 252237
2015-10-28ARM: add support for WatchOS's compact unwind information.Tim Northover1-1/+2
llvm-svn: 251573
2015-10-07[X86] Emit .cfi_escape GNU_ARGS_SIZE when adjusting the stack before callsMichael Kuperstein1-0/+5
When outgoing function arguments are passed using push instructions, and EH is enabled, we may need to indicate to the stack unwinder that the stack pointer was adjusted before the call. This should fix the exception handling issues in PR24792. Differential Revision: http://reviews.llvm.org/D13132 llvm-svn: 249522
2015-10-06Fix Clang-tidy modernize-use-nullptr warnings in source directories and ↵Hans Wennborg1-4/+4
generated files; other minor cleanups. Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13321 llvm-svn: 249482
2015-09-21Use makeArrayRef or None to avoid unnecessarily mentioning the ArrayRef type ↵Craig Topper1-2/+2
extra times. NFC llvm-svn: 248140
2015-08-10Silence a sign mismatch warning; NFC.Aaron Ballman1-1/+1
llvm-svn: 244452
2015-08-07[MC/Dwarf] Allow to specify custom parameters for linetable emission.Frederic Riss1-45/+42
NFC patch for current users, but llvm-dsymutil will use the new functionality to adapt to the input linetable. Based on a patch by Adrian Prantl. llvm-svn: 244318
2015-06-23Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko1-2/+2
Apparently, the style needs to be agreed upon first. llvm-svn: 240390
2015-06-19Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko1-2/+2
The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
2015-06-17[MC/Dwarf] Encode DW_CFA_advance_loc in target endianess.Benjamin Kramer1-9/+8
This matches GNU as output. llvm-svn: 239911
2015-05-30MC: Clean up MCExpr naming. NFC.Jim Grosbach1-11/+11
llvm-svn: 238634
2015-05-21Move alignment from MCSectionData to MCSection.Rafael Espindola1-9/+9
This starts merging MCSection and MCSectionData. There are a few issues with the current split between MCSection and MCSectionData. * It optimizes the the not as important case. We want the production of .o files to be really fast, but the split puts the information used for .o emission in a separate data structure. * The ELF/COFF/MachO hierarchy is not represented in MCSectionData, leading to some ad-hoc ways to represent the various flags. * It makes it harder to remember where each item is. The attached patch starts merging the two by moving the alignment from MCSectionData to MCSection. Most of the patch is actually just dropping 'const', since MCSectionData is mutable, but MCSection was not. llvm-svn: 237936
2015-05-21Remove yet another method of creating begin and end symbol for sections.Rafael Espindola1-9/+8
I missed this one when first unifying how we handle begin and end symbols. llvm-svn: 237912
2015-05-20Use a SmallString buffer instead of a std::string for debug info path ↵Pete Cooper1-1/+3
lookup. NFC. This code appends the filename to the directory then looks that up in a StringMap. We should be using the existing Twine::toStringRef method instead of Twine::str() as most times we'll succeed in the lookup. Its possible that we should also consider allowing StringMap to lookup a key using a Twine in addition to a StringRef but that would complicate the code with little known benefit above and beyond this change. This saves 170k temporary allocations when running llc on the verify_use_list_order bitcode with debug info for x86. llvm-svn: 237823
2015-05-18MC: Clean up method names in MCContext.Jim Grosbach1-17/+17
The naming was a mish-mash of old and new style. Update to be consistent with the new. NFC. llvm-svn: 237594
2015-05-12[DWARF] Add CIE header fields address_size and segment_size when generating ↵Keith Walker1-0/+8
dwarf-4 The DWARF-4 specification added 2 new fields in the CIE header called address_size and segment_size. Create these 2 new fields when generating dwarf-4 CIE entries, print out the new fields when dumping the CIE and update tests Differential Revision: http://reviews.llvm.org/D9558 llvm-svn: 237145
2015-04-28Use CIE version 4 for dwarf4.Rafael Espindola1-4/+15
According to http://www.dwarfstd.org/doc/DWARF4.pdf appendix F the CIE version for dwarf 4 is 4. llvm-svn: 235988
2015-04-27Use CIE version 1 for .eh_frame.Rafael Espindola1-1/+2
According to http://www.linuxbase.org/betaspecs/lsb/LSB-Core-generic/LSB-Core-generic/ehframechpt.html we should always use 1. llvm-svn: 235923
2015-04-15Change range-based for-loops to be -Wrange-loop-analysis clean.Richard Trieu1-1/+1
No functionality change. llvm-svn: 234963
2015-03-24Reset the CFA offset at the start of every FDE.Rafael Espindola1-1/+7
This fixes PR21515. llvm-svn: 233120
2015-03-23Refactor how passes get a symbol at the end of a section.Rafael Espindola1-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
2015-03-23Update variable name and reuse existing variable. NFC.Rafael Espindola1-5/+5
llvm-svn: 233014
2015-03-18Remove many superfluous SmallString::str() calls.Yaron Keren1-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
2015-03-16Fix build failure on MSVC compilers.Gabor Horvath1-3/+2
llvm-svn: 232368
2015-03-16[llvm] Replacing asserts with static_asserts where appropriateGabor Horvath1-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
2015-03-15[MCDwarf] Do not emit useless line table opcode.Frederic Riss1-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
2015-02-26[MC] Use the non-EH register mapping in the debug_frame section.Frederic Riss1-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
2014-11-19Remove StringMap::GetOrCreateValue in favor of StringMap::insertDavid Blaikie1-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
2014-10-21Drop support for an old version of ld64 (from darwin 9).Rafael Espindola1-12/+0
llvm-svn: 220310
2014-09-22Downgrade DWARF2 section limit error to a warningOliver Stannard1-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
2014-09-06MC: correct DWARF line info for PE/COFFSaleem Abdulrasool1-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