summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
...
* Allow ELF section flags to be specified numericallyPrakhar Bahuguna2016-12-151-0/+4
| | | | | | | | | | | | | | | | | Summary: GAS already allows flags for sections to be specified directly as a numeric value. This functionality is particularly useful for setting processor or application-specific values that may not be directly supported or understood by LLVM. This patch allows LLVM to use numeric section flag values verbatim if specified by the assembly file. Reviewers: grosbach, rafael, t.p.northover, rengolin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D27451 llvm-svn: 289785
* [ARM] Implement execute-only support in CodeGenPrakhar Bahuguna2016-12-153-1/+8
| | | | | | | | | | | | | | | | | | | | This implements execute-only support for ARM code generation, which prevents the compiler from generating data accesses to code sections. The following changes are involved: * Add the CodeGen option "-arm-execute-only" to the ARM code generator. * Add the clang flag "-mexecute-only" as well as the GCC-compatible alias "-mpure-code" to enable this option. * When enabled, literal pools are replaced with MOVW/MOVT instructions, with VMOV used in addition for floating-point literals. As the MOVT instruction is required, execute-only support is only available in Thumb mode for targets supporting ARMv8-M baseline or Thumb2. * Jump tables are placed in data sections when in execute-only mode. * The execute-only text section is assigned section ID 0, and is marked as unreadable with the SHF_ARM_PURECODE flag with symbol 'y'. This also overrides selection of ELF sections for globals. llvm-svn: 289784
* Replace APFloatBase static fltSemantics data members with getter functionsStephan Bergmann2016-12-141-5/+5
| | | | | | | | | | | | | At least the plugin used by the LibreOffice build (<https://wiki.documentfoundation.org/Development/Clang_plugins>) indirectly uses those members (through inline functions in LLVM/Clang include files in turn using them), but they are not exported by utils/extract_symbols.py on Windows, and accessing data across DLL/EXE boundaries on Windows is generally problematic. Differential Revision: https://reviews.llvm.org/D26671 llvm-svn: 289647
* [Assembler] Better error messages for .org directiveOliver Stannard2016-12-145-17/+32
| | | | | | | | | | | | | | | | | | | | | Currently, the error messages we emit for the .org directive when the expression is not absolute or is out of range do not include the line number of the directive, so it can be hard to track down the problem if a file contains many .org directives. This patch stores the source location in the MCOrgFragment, so that it can be used for diagnostics emitted during layout. Since layout is an iterative process, and the errors are detected during each iteration, it would have been possible for errors to be reported multiple times. To prevent this, I've made the assembler bail out after each iteration if any errors have been reported. This will still allow multiple unrelated errors to be reported in the common case where they are all detected in the first round of layout. Differential Revision: https://reviews.llvm.org/D27411 llvm-svn: 289643
* Add a comment consumer mechanism to MCAsmLexerOliver Stannard2016-12-082-1/+17
| | | | | | | | | This allows clients to register an AsmCommentConsumer with the MCAsmLexer, which receives a callback each time a comment is parsed. Differential Revision: https://reviews.llvm.org/D27511 llvm-svn: 289036
* Revert "[CodeGen] Fix invalid DWARF info on Win64"Keno Fischer2016-12-085-33/+10
| | | | | | Appears to break on build bots. Reverting pending investigation. llvm-svn: 289014
* [CodeGen] Fix invalid DWARF info on Win64Keno Fischer2016-12-085-10/+33
| | | | | | | | | | | | | | | The relocations for `DIEEntry::EmitValue` were wrong for Win64 (emitting FK_Data_4 instead of FK_SecRel_4). This corrects that oversight so that the DWARF data is correct in Win64 COFF files. Fixes PR15393. Patch by Jameson Nash <jameson@juliacomputing.com> based on a patch by David Majnemer. Differential Revision: https://reviews.llvm.org/D21731 llvm-svn: 289013
* [llvm] Fix D26214: Move error handling out of MC and to the callers.Mandeep Singh Grang2016-12-061-14/+5
| | | | | | | | | | | | Summary: Related clang patch; https://reviews.llvm.org/D27360 Reviewers: t.p.northover, grosbach, compnerd, echristo Subscribers: compnerd, mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D27359 llvm-svn: 288763
* Summary: Currently there is no way to disable deprecated warning from asm ↵Weiming Zhao2016-12-051-1/+2
| | | | | | | | | | | | | | | | | | | | like this clang -target arm deprecated-asm.s -c deprecated-asm.s:30:9: warning: use of SP or PC in the list is deprecated stmia r4!, {r12-r14} We have to have an option what can disable it. Patched by Yin Ma! Reviewers: joey, echristo, weimingz Subscribers: llvm-commits, aemerson Differential Revision: https://reviews.llvm.org/D27219 llvm-svn: 288734
* [MC] Generalize MCContext's SectionSymbols field.Dan Gohman2016-12-031-3/+3
| | | | | | | Change SectionSymbols so that it doesn't hard-code ELF types, so that it can be used for non-ELF targets. llvm-svn: 288607
* [MC] Refactor emitELFSize to make usage more consistent. NFC.Dan Gohman2016-12-013-5/+5
| | | | | | | | | | | | | Move the cast<MCSymbolELF> inside emitELFSize, so that: - it's done in one place instead of at each call - it's more consistent with similar functions like EmitCOFFSafeSEH - ambiguity between cast<> and dyn_cast<> is avoided (which also eliminates an unnecessary dyn_cast call) This also makes it easier to experiment with using ".size" directives on non-ELF targets. llvm-svn: 288437
* [llvm] Implement support for -defsym assembler optionMandeep Singh Grang2016-12-011-0/+16
| | | | | | | | | | | | | | | Summary: Changes to llvm-mc to move common logic to separate function. Related clang patch: https://reviews.llvm.org/D26213 Reviewers: rafael, t.p.northover, colinl, echristo, rengolin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26214 llvm-svn: 288396
* [AsmParser] Diagnose empty symbol for .set directiveWeiming Zhao2016-12-011-0/+3
| | | | | | | | | | | | Summary: Diagnose empty symbol to avoid hitting assertion in MCContext::getOrCreateSymbol Reviewers: eli.friedman, rengolin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26728 llvm-svn: 288390
* MCStreamer: Use "cfi" for CFI related temp labels.Matthias Braun2016-11-301-25/+18
| | | | | | | | | | | | | Choosing a "cfi" name makes the intend a bit clearer in an assembly dump and more importantly the assembly dumps are slightly more stable as the numbers don't move around anymore when unrelated code calls createTempSymbol() more or less often. As they are temp labels the name doesn't influence the generated object code. Differential Revision: https://reviews.llvm.org/D27244 llvm-svn: 288290
* MC: ensure that we have a section before accessing itSaleem Abdulrasool2016-11-221-15/+17
| | | | | | | | | | | | We would attempt to access the symbol section without ensuring that the symbol was not absolute. When the assembler referenced relocation is not evaluated to the absolute, but when we record the relocation, we would query the section. Because the symbol is absolute, it does not have a section associated with it, triggering an assertion. Just be more careful about the access of the section. Addresses PR31064! llvm-svn: 287619
* Fix comment typos. NFC.Simon Pilgrim2016-11-201-1/+1
| | | | | | Identified by Pedro Giffuni in PR27636. llvm-svn: 287490
* Fix 24560: assembler does not share constant pool for same constantsWeiming Zhao2016-11-041-1/+11
| | | | | | | | | | | | Summary: This patch returns the same label if the CP entry with the same value has been created. Reviewers: eli.friedman, rengolin, jmolloy Subscribers: majnemer, jmolloy, llvm-commits Differential Revision: https://reviews.llvm.org/D25804 llvm-svn: 286006
* 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
OpenPOWER on IntegriCloud