summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
...
* [MC] Plumb unique_ptr<MCELFObjectTargetWriter> through createELFObjectWriter toLang Hames2017-10-091-7/+8
| | | | | | | | | | ELFObjectWriter's constructor. Fixes the same ownership issue for ELF that r315245 did for MachO: ELFObjectWriter takes ownership of its MCELFObjectTargetWriter, so we want to pass this through to the constructor via a unique_ptr, rather than a raw ptr. llvm-svn: 315254
* [MC] Plumb unique_ptr<MCMachObjectTargetWriter> through createMachObjectWriterLang Hames2017-10-091-4/+4
| | | | | | | | | | | to MCObjectWriter's constructor. MCObjectWriter takes ownership of its MCMachObjectTargetWriter argument -- this patch plumbs that ownership relationship through the constructor (which previously took raw MCMachObjectTargetWriter*) and the createMachObjectWriter function. llvm-svn: 315245
* [MC] Use a unique_ptr<MCAssembler> for MCObjectStreamer's Assembler member.Lang Hames2017-10-091-3/+2
| | | | | | Removes manual new/delete. llvm-svn: 315225
* Remove unused variables. No functionality change.Benjamin Kramer2017-10-082-2/+0
| | | | llvm-svn: 315185
* [MC] Use unique_ptr to manage WinFrameInfos, NFCReid Kleckner2017-10-062-16/+12
| | | | | | | | The FrameInfo cannot be stored directly in the vector because chained frames may refer to parent frames, so we need pointers that are stable across a vector resize. llvm-svn: 315080
* [llvm-dsymutil] Add support for __swift_ast MachO DWARF sectionFrancis Ricci2017-10-061-0/+4
| | | | | | | | | | | | | | | | | | | | Summary: Xcode's dsymutil emits a __swift_ast DWARF section, which is required for debugging, and which contains a byte-for-byte dump of the swiftmodule file. Add this feature to llvm-dsymutil. Tested with `gobjdump --dwarf=info -s`, by verifying that the contents of `__DWARF.__swift_ast` match between Xcode's dsymutil and llvm-dsymutil (Xcode's dwarfdump and llvm-dwarfdump don't currently recognize the __swift_ast section). Reviewers: aprantl, friss Subscribers: llvm-commits, JDevlieghere Differential Revision: https://reviews.llvm.org/D38504 llvm-svn: 315066
* Revert "[llvm-dsymutil] Add support for __swift_ast MachO DWARF section"Francis Ricci2017-10-051-4/+0
| | | | | | | | Breaks aarch64 builders This reverts commit r315014. llvm-svn: 315034
* [llvm-dsymutil] Add support for __swift_ast MachO DWARF sectionFrancis Ricci2017-10-051-0/+4
| | | | | | | | | | | | | | | | | | | | Summary: Xcode's dsymutil emits a __swift_ast DWARF section, which is required for debugging, and which contains a byte-for-byte dump of the swiftmodule file. Add this feature to llvm-dsymutil. Tested with `gobjdump --dwarf=info -s`, by verifying that the contents of `__DWARF.__swift_ast` match between Xcode's dsymutil and llvm-dsymutil (Xcode's dwarfdump and llvm-dwarfdump don't currently recognize the __swift_ast section). Reviewers: aprantl, friss Subscribers: llvm-commits, JDevlieghere Differential Revision: https://reviews.llvm.org/D38504 llvm-svn: 315014
* Revert "[llvm-dsymutil] Add support for __swift_ast MachO DWARF section"Francis Ricci2017-10-051-4/+0
| | | | | | This reverts commit r315004, because of a failing test on non-apple platforms llvm-svn: 315009
* [llvm-dsymutil] Add support for __swift_ast MachO DWARF sectionFrancis Ricci2017-10-051-0/+4
| | | | | | | | | | | | | | | | | | | | Summary: Xcode's dsymutil emits a __swift_ast DWARF section, which is required for debugging, and which contains a byte-for-byte dump of the swiftmodule file. Add this feature to llvm-dsymutil. Tested with `gobjdump --dwarf=info -s`, by verifying that the contents of `__DWARF.__swift_ast` match between Xcode's dsymutil and llvm-dsymutil (Xcode's dwarfdump and llvm-dwarfdump don't currently recognize the __swift_ast section). Reviewers: aprantl, friss Subscribers: llvm-commits, JDevlieghere Differential Revision: https://reviews.llvm.org/D38504 llvm-svn: 315004
* [MC] - llvm-mc hangs on non-english characters.George Rimar2017-10-051-1/+1
| | | | | | | | | | | | | | | | | | Currently llvm-mc just hangs inside infinite loop while trying to parse file which has ".section .с" inside, where section name is non-english character. Patch fixes the issue. In this patch I also moved content of non-english-characters.s to test/MC/AsmParser/Inputs folder so that non-english-characters.s becomes a single testcase for all invalid inputs containing non-english symbols. That is convinent because llvm-mc otherwise tries to parse and tokenize the whole testcase file with tools invocations and it is harder to isolate the issue. Differential revision: https://reviews.llvm.org/D38545 llvm-svn: 314973
* [MC] - Don't assert when non-english characters are used.George Rimar2017-10-041-12/+13
| | | | | | | | | | | | | | | | | | I found that llvm-mc does not like non-english characters even in comments, which it tries to tokenize. Problem happens because of functions like isdigit(), isalnum() which takes int argument and expects it is not negative. But at the same time MCParser uses char* to store input buffer poiner, char has signed value, so it is possible to pass negative value to one of functions from above and that triggers an assert. Testcase for demonstration is provided. To fix the issue helper functions were introduced in StringExtras.h Differential revision: https://reviews.llvm.org/D38461 llvm-svn: 314883
* Simplify multikey_qsort function.Rui Ueyama2017-10-031-24/+20
| | | | | | | This function implements the three-way radix quicksort algorithm. This patch simplifies the implementation by using MutableArrayRef. llvm-svn: 314858
* Rewrite a function so that it doesn't use pointers to pointers. NFC.Rui Ueyama2017-10-031-12/+13
| | | | | | | | Previous code was a bit puzzling because of its use of pointers. In this patch, we pass a vector and its offsets, instead of pointers to vector elements. llvm-svn: 314756
* [AsmParser] Support GAS's .print directiveCoby Tayree2017-10-021-0/+18
| | | | | | Differential Revision: https://reviews.llvm.org/D38448 llvm-svn: 314674
* [WebAssembly] Allow each data segment to specify its own alignmentSam Clegg2017-09-291-15/+15
| | | | | | | | | Also, add a flags field as we will almost certainly be needing that soon too. Differential Revision: https://reviews.llvm.org/D38296 llvm-svn: 314534
* Typo: const MCSchedModel SchedModel -> const MCSchedModel &SchedModelKrzysztof Parzyszek2017-09-271-1/+1
| | | | llvm-svn: 314301
* [WebAssembly] Model weakly defined symbols as wasm exportsSam Clegg2017-09-261-1/+2
| | | | | | | | | | | | | Previously these were being included as both imports and exports, with the import being satisfied by the export (or some strong symbol) at runtime. However proved unnecessary and actually complicated linking as it meant there was not a 1-to-1 mapping between a wasm function /global index and a linker symbol. Differential Revision: https://reviews.llvm.org/D38246 llvm-svn: 314245
* [mips] Implement generation of relocations "chains" used by N32 ABISimon Atanasyan2017-09-211-0/+17
| | | | | | | | | In case of using a "nested" relocation expressions like this `%hi(%neg(%gp_rel()))`, N32 ABI requires generation of three consecutive relocations. That differs from the N64 ABI case where all relocations are packed into the single relocation record. llvm-svn: 313879
* [mips] Do not pass redundant IsN64 flag to MCELFObjectTargetWriter. NFCSimon Atanasyan2017-09-212-9/+5
| | | | | | | | Now we pass the 'Is64_' flag to the MCELFObjectTargetWriter ctor iif when we make deal with N64 ABI. So it is redundant to pass additional 'IsN64' flag. llvm-svn: 313878
* [WebAssembly] Add support for local symbol bindingsSam Clegg2017-09-201-15/+22
| | | | | | Differential Revision: https://reviews.llvm.org/D38096 llvm-svn: 313817
* Reland "[WebAssembly] Add support for naming wasm data segments"Sam Clegg2017-09-201-3/+16
| | | | | | | | | Add adds support for naming data segments. This is useful useful linkers so that they can merge similar sections. Differential Revision: https://reviews.llvm.org/D37886 llvm-svn: 313795
* Reverting due to Green Dragon bot failure.Mike Edwards2017-09-201-16/+3
| | | | | | http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/42594/ llvm-svn: 313706
* [WebAssembly] Add support for naming wasm data segmentsSam Clegg2017-09-191-3/+16
| | | | | | | | | Add adds support for naming data segments. This is useful useful linkers so that they can merge similar sections. Differential Revision: https://reviews.llvm.org/D37886 llvm-svn: 313692
* Re-land "Fix Bug 30978 by emitting cv file checksums."Reid Kleckner2017-09-195-42/+164
| | | | | | | This reverts r313431 and brings back r313374 with a fix to write checksums as binary data and not ASCII hex strings. llvm-svn: 313657
* Revert "Fix Bug 30978 by emitting cv file checksums."Eric Beckmann2017-09-165-154/+42
| | | | | | | | | | | This reverts commit 6389e7aa724ea7671d096f4770f016c3d86b0d54. There is a bug in this implementation where the string value of the checksum is outputted, instead of the actual hex bytes. Therefore the checksum is incorrect, and this prevent pdbs from being loaded by visual studio. Revert this until the checksum is emitted correctly. llvm-svn: 313431
* [WebAssembly] MC: Create wasm data segments based on MCSectionsSam Clegg2017-09-153-65/+71
| | | | | | | | | | | This means that we can honor -fdata-sections rather than always creating a segment for each symbol. It also allows for a followup change to add .init_array and friends. Differential Revision: https://reviews.llvm.org/D37876 llvm-svn: 313395
* Change encodeU/SLEB128 to pad to certain number of bytesSam Clegg2017-09-152-18/+9
| | | | | | | | | | | | | | | Previously the 'Padding' argument was the number of padding bytes to add. However most callers that use 'Padding' know how many overall bytes they need to write. With the previous code this would mean encoding the LEB once to find out how many bytes it would occupy and then using this to calulate the 'Padding' value. See: https://reviews.llvm.org/D36595 Differential Revision: https://reviews.llvm.org/D37494 llvm-svn: 313393
* [llvm] Fix some typos. NFC.Mandeep Singh Grang2017-09-152-3/+3
| | | | | | | | | | | | Reviewers: mcrosier Reviewed By: mcrosier Subscribers: mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D37922 llvm-svn: 313388
* [WebAssembly] Pass ArrayRef rather than SmallVectorSam Clegg2017-09-151-26/+20
| | | | | | | | This is more flexible and less verbose. Differential Revision: https://reviews.llvm.org/D37875 llvm-svn: 313384
* [WebAssembly] MC: Fix crash in getProvitionalValue on weak referencesSam Clegg2017-09-151-15/+15
| | | | | | | | | - Create helper function for resolving weak references. - Add test that preproduces the crash. Differential Revision: https://reviews.llvm.org/D37916 llvm-svn: 313381
* Fix Bug 30978 by emitting cv file checksums.Eric Beckmann2017-09-155-42/+154
| | | | | | | | | | | | Summary: The checksums had already been placed in the IR, this patch allows MCCodeView to actually write it out to an MCStreamer. Subscribers: llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D37157 llvm-svn: 313374
* [WebAssembly] Use a separate wasm data segment for each global symbolSam Clegg2017-09-141-70/+88
| | | | | | | | | | This is stepping stone towards honoring -fdata-sections and letting the assembler decide how many wasm data segments to create. Differential Revision: https://reviews.llvm.org/D37834 llvm-svn: 313313
* Subtarget support for parameterized register class informationKrzysztof Parzyszek2017-09-141-0/+12
| | | | | | | | Implement "checkFeatures" and emitting HW mode check code. Differential Revision: https://reviews.llvm.org/D31959 llvm-svn: 313295
* [WebAssembly] Remove flags from MCSectionWasmSam Clegg2017-09-122-54/+18
| | | | | | | | | | | Looks like these were copied from the ELF sections but don't apply to Wasm and were not used anywhere. Also remove unused Wasm methods in MCContext. Differential Revision: https://reviews.llvm.org/D37633 llvm-svn: 313058
* bpf: Add BPF AsmParser support in LLVMYonghong Song2017-09-121-0/+5
| | | | | | Reviewed-by: Yonghong Song <yhs@fb.com> Signed-off-by: Jiong Wang <jiong.wang@netronome.com> llvm-svn: 313055
* [WebAssembly] Update relocation names to match specSam Clegg2017-09-011-11/+11
| | | | | | | | Summary: See https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md Differential Revision: https://reviews.llvm.org/D37385 llvm-svn: 312342
* Untabify.NAKAMURA Takumi2017-08-281-4/+4
| | | | llvm-svn: 311875
* [X86AsmParser] Refactoring, (almost) NFC.Coby Tayree2017-08-241-14/+15
| | | | | | | | | | Some refactoring to X86AsmParser, mostly regarding the way rewrites are conducted. Mainly, we try to concentrate all the rewrite effort under one hood, so it'll hopefully be less of a mess and easier to maintain and understand. naturally, some frontend tests were affected: D36794 Differential Revision: https://reviews.llvm.org/D36793 llvm-svn: 311639
* [AsmParser] Recommit: Hash is not a comment on some targetsOliver Stannard2017-08-212-18/+0
| | | | | | | | | | | | | | | Re-committing after r311325 fixed an unintentional use of '#' comments in clang. The '#' token is not a comment for all targets (on ARM and AArch64 it marks an immediate operand), so we shouldn't treat it as such. Comments are already converted to AsmToken::EndOfStatement by AsmLexer::LexLineComment, so this check was unnecessary. Differential Revision: https://reviews.llvm.org/D36405 llvm-svn: 311326
* [Triple] Add isThumb and isARM functions.Florian Hahn2017-08-121-2/+1
| | | | | | | | | | | | | | | | | | | Summary: isThumb returns true for Thumb triples (little and big endian), isARM returns true for ARM triples (little and big endian). There are a few more checks using arm/thumb that are not covered by those functions, e.g. that the architecture is either ARM or Thumb (little endian) or ARM/Thumb little endian only. Reviewers: javed.absar, rengolin, kristof.beyls, t.p.northover Reviewed By: rengolin Subscribers: llvm-commits, aemerson Differential Revision: https://reviews.llvm.org/D34682 llvm-svn: 310781
* Revert "[AsmParser] Hash is not a comment on some targets"Ahmed Bougacha2017-08-102-0/+18
| | | | | | | | This reverts commit r310457. It causes clang-produced IR to fail llvm codegen. llvm-svn: 310662
* [AsmParser] Hash is not a comment on some targetsOliver Stannard2017-08-092-18/+0
| | | | | | | | | | | | The '#' token is not a comment for all targets (on ARM and AArch64 it marks an immediate operand), so we shouldn't treat it as such. Comments are already converted to AsmToken::EndOfStatement by AsmLexer::LexLineComment, so this check was unnecessary. Differential Revision: https://reviews.llvm.org/D36405 llvm-svn: 310457
* Don't pass the code model to MCRafael Espindola2017-08-021-20/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I was surprised to see the code model being passed to MC. After all, it assembles code, it doesn't create it. The one place it is used is in the expansion of .cfi directives to handle .eh_frame being more that 2gb away from the code. As far as I can tell, gnu assembler doesn't even have an option to enable this. Compiling a c file with gcc -mcmodel=large produces a regular looking .eh_frame. This is probably because in practice linker parse and recreate .eh_frames. In llvm this is used because the JIT can place the code and .eh_frame very far apart. Ideally we would fix the jit and delete this option. This is hard. Apart from confusion another problem with the current interface is that most callers pass CodeModel::Default, which is bad since MC has no way to map it to the target default if it actually needed to. This patch then replaces the argument with a boolean with a default value. The vast majority of users don't ever need to look at it. In fact, only CodeGen and llvm-mc use it and llvm-mc just to enable more testing. llvm-svn: 309884
* [AsmParser][GAS-compatibility] Ignore an empty 'p2align' directiveCoby Tayree2017-08-021-1/+8
| | | | | | | | | GAS ignores the aforementioned issue this patch aligns LLVM + throws in an appropriate warning Differential Revision: https://reviews.llvm.org/D36060 llvm-svn: 309841
* MC: simplify internal function call parameterSaleem Abdulrasool2017-07-291-30/+26
| | | | | | | | | | Rather than passing along most of the parameters, pass a reference to the MCDWARFrameInfo instead. This makes it easier to pass additional information about the frame to the checks. We need to keep the extra constructor for the Key around to allow the construction of the null and tombstone keys. NFC. llvm-svn: 309493
* MC: account for the return column in the CIE keySaleem Abdulrasool2017-07-291-8/+11
| | | | | | | | If the return column is different, we cannot coalesce the CIE across the FDEs. Add that to the key calculation. This ensures that we emit a separate CIE. llvm-svn: 309492
* MC: add support for cfi_return_columnSaleem Abdulrasool2017-07-284-10/+40
| | | | | | | | | This adds support for the CFI pseudo-op return_column. This specifies the frame table column which contains the return address. Addresses PR33953! llvm-svn: 309360
* MC: clang-format enumeration (NFC)Saleem Abdulrasool2017-07-281-29/+146
| | | | | | | This was hard to insert elements into. clang-format it so that it is easier. NFC. llvm-svn: 309359
* Simplify interface now that we don't need to pass IsPCRel. NFC.Rafael Espindola2017-07-115-16/+20
| | | | llvm-svn: 307734
OpenPOWER on IntegriCloud