summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
* Fix Clang-tidy readability-redundant-string-cstr warningsMalcolm Parsons2016-11-022-2/+2
| | | | | | | | | | Reviewers: beanz, lattner, jlebar Subscribers: jholewinski, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D26235 llvm-svn: 285832
* Reverting back r285355: "Update .debug_line section version information to ↵Ekaterina Romanova2016-10-271-7/+2
| | | | | | match DWARF version", while I'm investigating a test failure. llvm-svn: 285362
* Update .debug_line section version information to match DWARF version.Ekaterina Romanova2016-10-271-2/+7
| | | | | | | | | | In the past the compiler always emitted .debug_line version 2, though some opcodes from DWARF 3 (e.g. DW_LNS_set_prologue_end, DW_LNS_set_epilogue_begin or DW_LNS_set_isa) and from DWARF 4 could be emitted by the compiler. This patch changes version information of .debug_line to exactly match the DWARF version. For .debug_line version 4, a new field maximum_operations_per_instruction is emitted. Differential Revision: https://reviews.llvm.org/D16697 llvm-svn: 285355
* [MC] Fix comma typo in .loc parsingNirav Dave2016-10-261-1/+1
| | | | llvm-svn: 285214
* [MC] Fix Various End Of Line Comment checkingsNirav Dave2016-10-242-340/+286
| | | | | | | | | | | | | Fix AsmParser lines to correctly handle end-of-line pre-processor comments parsing when '#' is not the assembly line comment prefix. Reviewers: rnk Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25567 llvm-svn: 284978
* Remove unused #includes of TimeValue.h. NFC.Pavel Labath2016-10-241-1/+0
| | | | llvm-svn: 284975
* Retire llvm::alignOf in favor of C++11 alignof.Benjamin Kramer2016-10-201-3/+2
| | | | | | No functionality change intended. llvm-svn: 284733
* [ADT] Move CachedHashString to its own header in ADT, and rename to ↵Justin Lebar2016-10-171-25/+4
| | | | | | | | | | | | | | | | CachedHashStringRef. Summary: Reclaiming the name 'CachedHashString' will let us add a type with that name that owns its value. Reviewers: timshen Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25644 llvm-svn: 284434
* Move alignTo computation inside the if.Rafael Espindola2016-10-141-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | This is an improvement when compiling with llvm. llvm doesn't inline the call to insert, so the align is always executed and shows up in the profile. With gcc the call to insert is inlined and the align computation moved and done only if needed. With this patch we explicitly only compute it if it is needed. In the two tests with debug info, the speedup was scylla master 3.008959365 patch 2.932080942 1.02621974786x faster firefox master 6.709823604 patch 6.592387227 1.01781393795x faster In all others the difference was in the noise. llvm-svn: 284249
* Tidy the calls to getCurrentSection().first -> getCurrentSectionOnly to helpEric Christopher2016-10-148-24/+23
| | | | | | readability a bit. llvm-svn: 284202
* [AMDGPU] Add 32-bit lo/hi got and pc relative variant kinds and emit ↵Konstantin Zhuravlyov2016-10-141-0/+8
| | | | | | | | appropriate relocations Differential Revision: https://reviews.llvm.org/D25548 llvm-svn: 284195
* New llc option pie-copy-relocations to optimize access to extern globals.Sriraman Tallam2016-10-131-1/+2
| | | | | | | | | This option indicates copy relocations support is available from the linker when building as PIE and allows accesses to extern globals to avoid the GOT. Differential Revision: https://reviews.llvm.org/D24849 llvm-svn: 284160
* [MC] Fix Error Location for ParseIdentifierNirav Dave2016-10-121-4/+11
| | | | | | | Prevent partial parsing of '$' or '@' of invalid identifiers and fixup workaround points. NFC Intended. llvm-svn: 284017
* Revert r283690, "MC: Remove unused entities."Peter Collingbourne2016-10-104-1/+32
| | | | llvm-svn: 283814
* Add return type for checkForValidSection parsing function. NFC Intended.Nirav Dave2016-10-101-41/+35
| | | | llvm-svn: 283761
* MC: Remove unused entities.Peter Collingbourne2016-10-094-32/+1
| | | | llvm-svn: 283691
* Invoke add-discriminator at -g0 -fsample-profileDehao Chen2016-10-071-1/+2
| | | | | | | | | | | | Summary: -fsample-profile needs discriminator, which will not be added if built with -g0. This patch makes sure the discriminator is added for sample-profile at -g0. A followup patch will be send out to update clang tests. Reviewers: davidxl, dblaikie, echristo, dnovillo Subscribers: mehdi_amini, probinson, llvm-commits Differential Revision: https://reviews.llvm.org/D25132 llvm-svn: 283565
* [codeview] Truncate records to maximum record size near 64KBReid Kleckner2016-10-051-0/+7
| | | | | | | | | | | | If we don't truncate, LLVM asserts when the label difference doesn't fit in a 16 bit field. This patch truncates two kinds of data: trailing null terminated names in symbol records, and inline line tables. The inline line table test that I have is too large (many MB), so I'm not checking it in. Hopefully fixes PR28264. llvm-svn: 283403
* Allow the caller to pass in the hash.Rafael Espindola2016-10-051-2/+2
| | | | | | | If the caller already has the hash we don't have to compute it. This will be used in lld. llvm-svn: 283359
* Don't pass null to memcpy. Should fix the asan bots.Rafael Espindola2016-10-051-1/+2
| | | | llvm-svn: 283336
* Use StringRef in MCSectionMachO (NFC)Mehdi Amini2016-10-051-16/+14
| | | | llvm-svn: 283284
* Use StringRef in DarwinAsmParser (NFC)Mehdi Amini2016-10-051-4/+3
| | | | llvm-svn: 283283
* Misc improvements to StringTableBuilder.Rafael Espindola2016-10-044-81/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds write methods to StringTableBuilder so that it is easier to change the underlying implementation. Using the write methods, avoid creating a temporary buffer when using mmaped output. It also uses a more compact key in the DenseMap. Overall this produces a slightly faster lld: firefox master 6.853419709 patch 6.841968912 1.00167361138x faster chromium master 4.297280174 patch 4.298712163 1.00033323147x slower chromium fast master 1.802335952 patch 1.806872459 1.00251701521x slower the gold plugin master 0.3247149 patch 0.321971644 1.00852017888x faster clang master 0.551279945 patch 0.543733194 1.01387951128x faster llvm-as master 0.032743458 patch 0.032143478 1.01866568391x faster the gold plugin fsds master 0.350814247 patch 0.348571741 1.00643341309x faster clang fsds master 0.6281672 patch 0.621130222 1.01132931187x faster llvm-as fsds master 0.030168899 patch 0.029797155 1.01247582194x faster scylla master 3.104222518 patch 3.059590248 1.01458766252x faster llvm-svn: 283266
* Remove duplicated typedef. NFC.Rafael Espindola2016-10-041-5/+4
| | | | llvm-svn: 283216
* Revert "Use getSize instead of data().size(). NFC."Rafael Espindola2016-10-032-6/+1
| | | | | | | | This reverts commit r283125. lld needs to be updated. llvm-svn: 283127
* Use getSize instead of data().size(). NFC.Rafael Espindola2016-10-032-1/+6
| | | | | | | Also assert isFinalized in getSize(). This just reduces the noise from another patch. llvm-svn: 283125
* Prevent out of order HashDirective lexing in AsmLexer.Nirav Dave2016-10-031-26/+17
| | | | | | | | | | | | | | | | | | | Retrying after buildbot reset. To lex hash directives we peek ahead to find component tokens, create a unified token, and unlex the peeked tokens so the parser does not need to parse the tokens then. Make sure we do not to lex another hash directive during peek operation. This fixes PR28921. Reviewers: rnk, loladiro Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24839 llvm-svn: 283111
* Revert "[MC] Prevent out of order HashDirective lexing in AsmLexer."Nirav Dave2016-10-011-17/+26
| | | | | | This reverts commit r282992 which appears to be causing an LTO test failure. llvm-svn: 283034
* Use StringRef instead of raw pointers in MCAsmInfo/MCInstrInfo APIs (NFC)Mehdi Amini2016-10-012-4/+4
| | | | llvm-svn: 283018
* [MC] Prevent out of order HashDirective lexing in AsmLexer.Nirav Dave2016-10-011-26/+17
| | | | | | | | | | | | | | | | | To lex hash directives we peek ahead to find component tokens, create a unified token, and unlex the peeked tokens so the parser does not need to parse the tokens then. Make sure we do not to lex another hash directive during peek operation. This fixes PR28921. Reviewers: rnk, loladiro Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24839 llvm-svn: 282992
* Tidy spelling and grammar.Eric Christopher2016-09-291-1/+1
| | | | llvm-svn: 282672
* [MC] Support .ds directives in assembler parserPetr Hosek2016-09-231-0/+49
| | | | | | | | These directives are already supported by GNU assembler. Differential Revision: https://reviews.llvm.org/D24740 llvm-svn: 282303
* [MC] Support .dcb directives in assembler parserPetr Hosek2016-09-231-35/+149
| | | | | | | | These directives are already supported by GNU assembler. Differential Revision: https://reviews.llvm.org/D24741 llvm-svn: 282283
* [MC] Support skip and count for .incbin directivePetr Hosek2016-09-231-7/+45
| | | | | | | | These optional arguments are supported by GNU assembler. Differential Revision: https://reviews.llvm.org/D24714 llvm-svn: 282217
* Defer asm errors to post-statement failureNirav Dave2016-09-163-129/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recommitting after fixing AsmParser initialization and X86 inline asm error cleanup. Allow errors to be deferred and emitted as part of clean up to simplify and shorten Assembly parser code. This will allow error messages to be emitted in helper functions and be modified by the caller which has better context. As part of this many minor cleanups to the Parser: * Unify parser cleanup on error * Add Workaround for incorrect return values in ParseDirective instances * Tighten checks on error-signifying return values for parser functions and fix in-tree TargetParsers to be more consistent with the changes. * Fix AArch64 test cases checking for spurious error messages that are now fixed. These changes should be backwards compatible with current Target Parsers so long as the error status are correctly returned in appropriate functions. Reviewers: rnk, majnemer Subscribers: aemerson, jyknight, llvm-commits Differential Revision: https://reviews.llvm.org/D24047 llvm-svn: 281762
* [codeview] Optimize the size of defranges with gapsReid Kleckner2016-09-151-5/+43
| | | | | | | | | For small, discontiguous local variable regions, CodeView can use a single defrange record with a gap, rather than having two defrange records. I expect that this optimization will only have a minor impact on debug info size. llvm-svn: 281664
* [MC] Handle discardable COFF sections in assemblyReid Kleckner2016-09-142-13/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes a dumpbin warning on objects produced by the MC assembler when starting from text. All .debug$S sections are supposed to be marked IMAGE_SCN_MEM_DISCARDABLE. The main, non-COMDAT .debug$S section had this set, but any comdat ones were not being marked discardable because there was no .section flag for it. This change does two things: - If the section name starts with .debug, implicitly mark the section as discardable. This means we do the same thing as gas on .s files with DWARF from GCC, which is important. - Adds the 'D' flag to the .section directive on COFF to explicitly say a section is discardable. We only emit this flag if the section name does not start with .debug. This allows the user to explicitly tweak their section flags without worrying about magic section names. The only thing you can't do in this scheme is to create a non-discardable section with a name starting with ".debug", but hopefully users don't need that. Reviewers: majnemer, rafael Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24582 llvm-svn: 281554
* Revert r281336 (and r281337), it caused PR30372.Nico Weber2016-09-133-147/+129
| | | | llvm-svn: 281361
* Apply Clang-format to MCAsmParser.cpp NFC.Nirav Dave2016-09-131-1/+2
| | | | llvm-svn: 281337
* Defer asm errors to post-statement failureNirav Dave2016-09-133-129/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recommitting after fixing AsmParser Initialization. Allow errors to be deferred and emitted as part of clean up to simplify and shorten Assembly parser code. This will allow error messages to be emitted in helper functions and be modified by the caller which has better context. As part of this many minor cleanups to the Parser: * Unify parser cleanup on error * Add Workaround for incorrect return values in ParseDirective instances * Tighten checks on error-signifying return values for parser functions and fix in-tree TargetParsers to be more consistent with the changes. * Fix AArch64 test cases checking for spurious error messages that are now fixed. These changes should be backwards compatible with current Target Parsers so long as the error status are correctly returned in appropriate functions. Reviewers: rnk, majnemer Subscribers: aemerson, jyknight, llvm-commits Differential Revision: https://reviews.llvm.org/D24047 llvm-svn: 281336
* Temporarily Revert "[MC] Defer asm errors to post-statement failure" as it's ↵Eric Christopher2016-09-133-145/+129
| | | | | | | | causing errors on the sanitizer bots. This reverts commit r281249. llvm-svn: 281280
* [MC] Defer asm errors to post-statement failureNirav Dave2016-09-123-129/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow errors to be deferred and emitted as part of clean up to simplify and shorten Assembly parser code. This will allow error messages to be emitted in helper functions and be modified by the caller which has better context. As part of this many minor cleanups to the Parser: * Unify parser cleanup on error * Add Workaround for incorrect return values in ParseDirective instances * Tighten checks on error-signifying return values for parser functions and fix in-tree TargetParsers to be more consistent with the changes. * Fix AArch64 test cases checking for spurious error messages that are now fixed. These changes should be backwards compatible with current Target Parsers so long as the error status are correctly returned in appropriate functions. Reviewers: rnk, majnemer Subscribers: aemerson, jyknight, llvm-commits Differential Revision: https://reviews.llvm.org/D24047 llvm-svn: 281249
* MC: Move MCSection::begin/end to header, NFCDuncan P. N. Exon Smith2016-09-121-8/+0
| | | | llvm-svn: 281188
* [codeview] Add new directives to record inlined call site line infoReid Kleckner2016-09-075-124/+311
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously we were trying to represent this with the "contains" list of the .cv_inline_linetable directive, which was not enough information. Now we directly represent the chain of inlined call sites, so we know what location to emit when we encounter a .cv_loc directive of an inner inlined call site while emitting the line table of an outer function or inlined call site. Fixes PR29146. Also fixes PR29147, where we would crash when .cv_loc directives crossed sections. Now we write down the section of the first .cv_loc directive, and emit an error if any other .cv_loc directive for that function is in a different section. Also fixes issues with discontiguous inlined source locations, like in this example: volatile int unlikely_cond = 0; extern void __declspec(noreturn) abort(); __forceinline void f() { if (!unlikely_cond) abort(); } int main() { unlikely_cond = 0; f(); unlikely_cond = 0; } Previously our tables gave bad location information for the 'abort' call, and the debugger wouldn't snow the inlined stack frame for 'f'. It is important to emit good line tables for this code pattern, because it comes up whenever an asan bug occurs in an inlined function. The __asan_report* stubs are generally placed after the normal function epilogue, leading to discontiguous regions of inlined code. Reviewers: majnemer, amccarth Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24014 llvm-svn: 280822
* (LLVM part) Implement MASM-flavor intel syntax behavior for inline MS asm block:Yunzhong Gao2016-09-022-3/+46
| | | | | | | | | | | 1. 0xNN and NNh are accepted as valid hexadecimal numbers, but 0xNNh is not. 0xNN and NNh may come with optional U or L suffix. 2. NNb is accepted as a valid binary (base-2) number, but 0bNN is not. NNb may come with optional U or L suffix. Differential Revision: https://reviews.llvm.org/D22112 llvm-svn: 280555
* ADT: Split ilist_node_traits into alloc and callback, NFCDuncan P. N. Exon Smith2016-08-301-3/+1
| | | | | | | | | | | | | | | | Many lists want to override only allocation semantics, or callbacks for iplist. Split these up to prevent code duplication. - Specialize ilist_alloc_traits to change the implementations of deleteNode() and createNode(). - One common desire is to do nothing deleteNode() and disable createNode(). Specialize ilist_alloc_traits to inherit from ilist_noalloc_traits for that behaviour. - Specialize ilist_callback_traits to use the addNodeToList(), removeNodeFromList(), and transferNodesFromList() callbacks. As a drive-by, add some coverage to the callback-related unit tests. llvm-svn: 280128
* [MC] Move parser helper functions from Asmparser to MCAsmParserNirav Dave2016-08-302-65/+69
| | | | | | NFC Intended. llvm-svn: 280092
* Move code only used by codegen out of MC. NFC.Rafael Espindola2016-08-291-40/+0
| | | | | | MC itself never needs to know about these sections. llvm-svn: 279965
* [MC] Move .cv_loc management logic out of MCContextReid Kleckner2016-08-267-27/+25
| | | | | | | | | | | MCContext already has many tasks, and separating CodeView out from it is probably a good idea. The .cv_loc tracking was modelled on the DWARF tracking which lived directly in MCContext. Removes the inclusion of MCCodeView.h from MCContext.h, so now there are only 10 build actions while I hack on CodeView support instead of 265. llvm-svn: 279847
* [MC] Support .dc directives in assembler parserPetr Hosek2016-08-231-0/+26
| | | | | | | | | | While these directives are mostly aliases for the existing integer and float value directives, some of them like .dc.a have no direct equivalents and are sometimes being used for convenience. Differential Revision: https://reviews.llvm.org/D23810 llvm-svn: 279577
OpenPOWER on IntegriCloud