summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
...
* Produce INIT_ARRAY for sections named .init_array.*Rafael Espindola2017-03-221-1/+5
| | | | | | | These sections are merged together by the linker, so they should have the same time. llvm-svn: 298505
* [Asm] Don't list '@<type>' in diag when '@' is a commentOliver Stannard2017-03-171-2/+6
| | | | | | | | This fixes https://bugs.llvm.org//show_bug.cgi?id=31280 Differential revision: https://reviews.llvm.org/D31026 llvm-svn: 298067
* [WebAssembly] Fix some broken type encodings in wasm binaryDerek Schuff2017-03-161-9/+9
| | | | | | | | | | | | A recent change switch the in-memory wasm value types to be signed integers, but I missing a few cases where these were being writing to the binary. Differential Revision: https://reviews.llvm.org/D31014 Patch by Sam Clegg llvm-svn: 297991
* Check that line table entries don't spill over between sections even if ↵David Blaikie2017-03-161-0/+1
| | | | | | they're empty at the end of a section llvm-svn: 297922
* Simplify/make more explicit (by making less explicit in some ways) some ↵David Blaikie2017-03-162-2/+2
| | | | | | function calls llvm-svn: 297921
* [WebAssembly] Update format of 'names' section.Derek Schuff2017-03-151-6/+11
| | | | | | | | | | | | This change updates to the format of the 'names' sectionin the generated wasm binary to match the latest changesto the design and 'wabt'. Differential Revision: https://reviews.llvm.org/D30950 Patch by Sam Clegg llvm-svn: 297877
* [WebAssembly] Use LEB encoding for value typesDerek Schuff2017-03-141-20/+24
| | | | | | | | | | | | Previously we were using the encoded LEB hex values for the value types. This change uses the decoded negative value and the LEB encoder to write them out. Differential Revision: https://reviews.llvm.org/D30847 Patch by Sam Clegg llvm-svn: 297777
* Fix asm printing of associated sections.Evgeniy Stepanov2017-03-144-20/+32
| | | | | | | Make MCSectionELF::AssociatedSection be a link to a symbol, because that's how it works in the assembly, and use it in the asm printer. llvm-svn: 297769
* [Assembler] Add location info to unary expressions.Sanne Wouda2017-03-102-6/+6
| | | | | | | | | | | | | | | | | Summary: This is a continuation of D28861. Add an SMLoc to MCUnaryExpr such that a better diagnostic can be given in case of an error in later stages of assembling. Reviewers: rengolin, grosbach, javed.absar, olista01 Reviewed By: olista01 Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D30581 llvm-svn: 297454
* [MC] Set SHT_MIPS_DWARF section type for all .debug_* sections on MIPSSimon Atanasyan2017-03-102-23/+36
| | | | | | | | | | | | All MIPS .debug_* sections should be marked with ELF type SHT_MIPS_DWARF accordingly the specification [1]. Also the same section type is assigned to these sections by GNU tools. [1] ftp.software.ibm.com/software/os390/czos/dwarf/mips_extensions.pdf Differential Revision: https://reviews.llvm.org/D29789 llvm-svn: 297447
* [MC] Accept a numeric value as an ELF section header's typeSimon Atanasyan2017-03-102-2/+9
| | | | | | | | | | | | | | | | | | | | | | GAS supports specification of section header's type using a numeric value [1]. This patch brings the same functionality to LLVM. That allows to setup some target-specific section types belong to the SHT_LOPROC - SHT_HIPROC range. If we attempt to print unknown section type, MCSectionELF class shows an error message. It's better than print sole '@' sign without any section type name. In case of MIPS, example of such section's type is SHT_MIPS_DWARF. Without the patch we will have to implement some workarounds in probably not-MIPS-specific part of code base to convert SHT_MIPS_DWARF to the @progbits while printing assembly and to assign SHT_MIPS_DWARF for @progbits sections named .debug_* if we encounter such section in an input assembly. [1] https://sourceware.org/binutils/docs/as/Section.html Differential Revision: https://reviews.llvm.org/D29719 llvm-svn: 297446
* Perform symbol binding for .symver versioned symbolsTeresa Johnson2017-03-092-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In a .symver assembler directive like: .symver name, name2@@nodename "name2@@nodename" should get the same symbol binding as "name". While the ELF object writer is updating the symbol binding for .symver aliases before emitting the object file, not doing so when the module inline assembly is handled by the RecordStreamer is causing the wrong behavior in *LTO mode. E.g. when "name" is global, "name2@@nodename" must also be marked as global. Otherwise, the symbol is skipped when iterating over the LTO InputFile symbols (InputFile::Symbol::shouldSkip). So, for example, when performing any *LTO via the gold-plugin, the versioned symbol definition is not recorded by the plugin and passed back to the linker. If the object was in an archive, and there were no other symbols needed from that object, the object would not be included in the final link and references to the versioned symbol are undefined. The llvm-lto2 tests added will give an error about an unused symbol resolution without the fix. Reviewers: rafael, pcc Reviewed By: pcc Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D30485 llvm-svn: 297332
* Silence a warning "hiding virtual function".Vassil Vassilev2017-03-061-0/+1
| | | | llvm-svn: 297018
* MC: De-duplicate the object streamer implementations of EmitFileDirective ↵Peter Collingbourne2017-03-036-25/+6
| | | | | | into MCObjectStreamer. NFCI. llvm-svn: 296912
* [DWARFv5] llvm-mc support for new unit header.Paul Robinson2017-02-281-5/+9
| | | | | | | | | This is for running the assembler with -g (to emit DWARF describing the assembler source). Differential Revision: http://reviews.llvm.org/D30475 llvm-svn: 296541
* [MC] Implement the COFF directives in MCNullStreamer.Dan Gohman2017-02-271-0/+4
| | | | | | This fixes -filetype=null errors introduced in r296403. llvm-svn: 296410
* [MC] Factor out non-COFF handling of COFF-specific directives.Dan Gohman2017-02-274-52/+12
| | | | | | | | | Instead of requiring every non-COFF MCObjectStreamer to implement the COFF hooks just to do an llvm_unreachable to say that they're not supported, do the llvm_unreachable in the default implementation, as suggested by rnk in https://reviews.llvm.org/D26722. llvm-svn: 296403
* [WebAssembly] Add some comments and tidy up whitespace.Dan Gohman2017-02-271-2/+3
| | | | llvm-svn: 296402
* [WebAssembly] Add support for using a wasm global for the stack pointer.Dan Gohman2017-02-241-0/+24
| | | | | | | This replaces the __stack_pointer variable which was allocated in linear memory. llvm-svn: 296201
* [WebAssembly] Basic support for Wasm object file encoding.Dan Gohman2017-02-244-10/+941
| | | | | | | | | With the "wasm32-unknown-unknown-wasm" triple, this allows writing out simple wasm object files, and is another step in a larger series toward migrating from ELF to general wasm object support. Note that this code and the binary format itself is still experimental. llvm-svn: 296190
* Disallow redefinition of section symbols.Evgeniy Stepanov2017-02-241-1/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D30235 llvm-svn: 296180
* Initialize MCContext::InlineSrcMgr in the constructor.Evgeniy Stepanov2017-02-241-2/+3
| | | | | | Found with ASan (and a local source change) on test/CodeGen/XCore/section-name.ll. llvm-svn: 296179
* [WebAssembly] Implement the wasm binary container header.Dan Gohman2017-02-221-1/+3
| | | | | | | Also, update the version number to 0x1, which is what engines are now expecting. llvm-svn: 295860
* [WebAssembly] Add skeleton MC support for the Wasm container formatDan Gohman2017-02-229-2/+587
| | | | | | | | | This just adds the basic skeleton for supporting a new object file format. All of the actual encoding will be implemented in followup patches. Differential Revision: https://reviews.llvm.org/D26722 llvm-svn: 295803
* SubtargetFeature: Cleanup; NFCMatthias Braun2017-02-211-65/+31
| | | | | | | | | - Fix doxygen comments - Remove duplicated comments - Remove section comments (which became wrong over time) - Use more `const` and references but less `auto` llvm-svn: 295687
* MC/COFF: Do not emit forward associative section referenceds.Rui Ueyama2017-02-171-26/+53
| | | | | | | | | | | | | | | | MSVC link.exe cannot handle associative sections that refer later sections in the section header. Technically, such COFF object doesn't violate the Microsoft COFF spec, as the spec doesn't say anything about that, but still we should avoid doing that to make it compatible with MS tools. This patch assigns smaller section numbers to non-associative sections and larger numbers to associative sections. This should resolve the compatibility issue. Differential Revision: https://reviews.llvm.org/D30080 llvm-svn: 295464
* Split WinCOFFObjectWriter::writeSection.Rui Ueyama2017-02-161-28/+39
| | | | llvm-svn: 295276
* Split WinCOFFObjectWriter::writeObject function.Rui Ueyama2017-02-161-160/+183
| | | | llvm-svn: 295273
* Remove useless local variable.Rui Ueyama2017-02-161-9/+4
| | | | llvm-svn: 295268
* Rename variables to match the LLVM style.Rui Ueyama2017-02-161-94/+97
| | | | llvm-svn: 295265
* Revert r295138: Instead of a series of string operations, use snprintf().Rui Ueyama2017-02-151-2/+4
| | | | | | This broke buildbots. llvm-svn: 295142
* Instead of a series of string operations, use snprintf().Rui Ueyama2017-02-151-4/+2
| | | | llvm-svn: 295138
* Return early. NFC.Rui Ueyama2017-02-151-16/+17
| | | | llvm-svn: 295137
* Use LLVM-style naming scheme.Rui Ueyama2017-02-151-22/+22
| | | | llvm-svn: 295136
* Use LLVM-style naming scheme.Rui Ueyama2017-02-151-18/+18
| | | | llvm-svn: 295132
* Remove useless local variable.Rui Ueyama2017-02-151-3/+1
| | | | llvm-svn: 295131
* Split WinCOFFObjectWriter::defineSection. NFC.Rui Ueyama2017-02-151-47/+38
| | | | llvm-svn: 295128
* Simplify WinCOFFObjectWriter by removing a template member function.Rui Ueyama2017-02-141-15/+5
| | | | llvm-svn: 295126
* Do not lookup a DenseMap twice using the same key.Rui Ueyama2017-02-141-7/+4
| | | | llvm-svn: 295124
* Use endian::write32le instead of endian::write.Rui Ueyama2017-02-141-7/+3
| | | | llvm-svn: 295120
* Use zero-initialization instead of memset.Rui Ueyama2017-02-141-18/+5
| | | | llvm-svn: 295119
* [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-02-144-34/+56
| | | | | | | | minor fixes (NFC). Same changes in files affected by reduced MC headers dependencies. llvm-svn: 295009
* [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-02-1111-103/+83
| | | | | | minor fixes (NFC). llvm-svn: 294813
* Move some error handling down to MCStreamer.Rafael Espindola2017-02-107-26/+21
| | | | | | | | | This makes sure we get the same redefinition rules regardless of who is printing (asm parser, codegen) and to what (asm, obj). This fixes an unintentional regression in r293936. llvm-svn: 294752
* [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-02-1010-86/+139
| | | | | | minor fixes (NFC). llvm-svn: 294685
* Make it possible to set SHF_LINK_ORDER explicitly.Rafael Espindola2017-02-093-6/+29
| | | | | | | This will make it possible to add support for gcing user metadata (asan for example). llvm-svn: 294589
* [MC] Fix some Clang-tidy modernize and Include What You Use warnings in ↵Eugene Zelenko2017-02-091-8/+11
| | | | | | | | SubtargetFeature; other minor fixes (NFC). Same changes in files affected by reduced SubtargetFeature.h dependencies. llvm-svn: 294548
* [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-02-0810-40/+49
| | | | | | minor fixes (NFC). llvm-svn: 294526
* [Assembler] Enable nicer diagnostics for inline assembly.Sanne Wouda2017-02-082-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed test. Summary: Enables source location in diagnostic messages from the backend. This is after parsing, during finalization. This requires the SourceMgr, the inline assembly string buffer, and DiagInfo to still be alive after EmitInlineAsm returns. This patch creates a single SourceMgr for inline assembly inside the AsmPrinter. MCContext gets a pointer to this SourceMgr. Using one SourceMgr per call to EmitInlineAsm would make it difficult for MCContext to figure out in which SourceMgr the SMLoc is located, while a single SourceMgr can figure it out if it has multiple buffers. The Str argument to EmitInlineAsm is copied into a buffer and owned by the inline asm SourceMgr. This ensures that DiagHandlers won't print garbage. (Clang emits a "note: instantiated into assembly here", which refers to this string.) The AsmParser gets destroyed before finalization, which means that the DiagHandlers the AsmParser installs into the SourceMgr will be stale. Restore the saved DiagHandlers. Since now we're using just one SourceMgr for multiple inline asm strings, we need to tell the AsmParser which buffer it needs to parse currently. Hand a buffer id -- returned from SourceMgr:: AddNewSourceBuffer -- to the AsmParser. Reviewers: rnk, grosbach, compnerd, rengolin, rovka, anemet Reviewed By: rnk Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D29441 llvm-svn: 294458
* Revert "[Assembler] Enable nicer diagnostics for inline assembly."Diana Picus2017-02-082-18/+11
| | | | | | This reverts commit r294433 because it seems it broke the buildbots. llvm-svn: 294448
OpenPOWER on IntegriCloud