summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
...
* [MC][AsmParser] Hook for post assembly file processingJack Carter2013-10-041-2/+5
| | | | | | | | | | | | | | | | | | | | | This patch handles LLVM standalone assembler (llvm-mc) ELF flag setting based on input file directive processing. Mips assembly requires processing inline directives that directly and indirectly affect the output ELF header flags. This patch handles one ".abicalls". To process these directives we are following the model the code generator uses by storing state in a container as we go through processing and when we detect the end of input file processing, AsmParser is notified and we update the ELF header flags through a MipsELFStreamer method with a call from MCTargetAsmParser::emitEndOfAsmFile(MCStreamer &OutStreamer). This patch will allow other targets the same functionality. Jack llvm-svn: 191982
* [llvm-c][Disassembler] When printing latency information, fall back to theQuentin Colombet2013-10-032-1/+34
| | | | | | | | | | | itinerary model in case the target does not supply a scheduling model. By doing this, targets like cortex-a8 can benefit from the latency printing feature added in r191859. This part of <rdar://problem/14687488>. llvm-svn: 191916
* [llvm-c][Disassembler] When printing latency information, skip schedulingQuentin Colombet2013-10-021-1/+3
| | | | | | | | | classes that are marked as Variant as those require an MI to pass to SubTargetInfo::resolveSchedClass. This is part of <rdar://problem/14687488>. llvm-svn: 191864
* [llvm-c][Disassembler] Add an option to print latency information inQuentin Colombet2013-10-022-0/+63
| | | | | | | | | | | | | | | | | | | | | | | disassembled output alongside the instructions. E.g., on a vector shuffle operation with a memory operand, disassembled outputs are: * Without the option: vpshufd $-0x79, (%rsp), %xmm0 * With the option: vpshufd $-0x79, (%rsp), %xmm0 ## Latency: 5 The printed latency is extracted from the schedule model available in the disassembler context. Thus, this option has no effect if there is not a scheduling model for the target. This boils down to one may need to specify the CPU string, so that this option could have an effect. Note: Latency < 2 are not printed. This part of <rdar://problem/14687488>. llvm-svn: 191859
* Add Support For .bss Named Section Directive For Darwin Targets.Rafael Espindola2013-10-021-0/+5
| | | | | | Patch by Nicholas White. llvm-svn: 191824
* [llvm-c][Disassembler] Add an option to reproduce in disassembled output theQuentin Colombet2013-10-011-8/+45
| | | | | | | | | | | | | | comments issued with verbose assembly. E.g., on a vector shuffle operation, disassembled output are: * Without the option: vpshufd $-0x79, (%rsp), %xmm0 * With the option: vpshufd $-0x79, (%rsp), %xmm0 ## xmm0 = mem[3,1,0,2] This part of <rdar://problem/14687488>. llvm-svn: 191799
* [MC] When MCInstPrint::printAnnotation uses a comment stream, it has to ensureQuentin Colombet2013-10-011-2/+6
| | | | | | | | | that each comment ends with a newline to match the definition in the header file. This is part of <rdar://problem/14687488>. llvm-svn: 191787
* MCParser/Debug info: Accept line number 0 as a legitimate value, sinceAdrian Prantl2013-09-261-2/+2
| | | | | | | | CFE produces it to indicate artificial locations. c.f.: DWARF standard, Table 6.2: line -- An unsigned integer indicating a source line number. Lines are numbered beginning at 1. The compiler may emit the value 0 in cases where an instruction cannot be attributed to any source line. llvm-svn: 191471
* Implements parsing and emitting of .cfi_window_save in MC.Venkatraman Govindaraju2013-09-264-1/+35
| | | | llvm-svn: 191431
* MC: Add support for treating $ as a reference to the PCDavid Majnemer2013-09-252-3/+14
| | | | | | | | | | | | | | | | | The binutils assembler supports a mode called DOLLAR_DOT which treats the dollar sign token as a reference to the current program counter if the dollar sign doesn't precede a constant or identifier. This commit adds a new MCAsmInfo flag stating whether or not a given target supports this interpretation of the dollar sign token; by default, this flag is not enabled. Further, enable this flag for PPC. The system assembler for AIX and binutils both support using the dollar sign in this manner. This fixes PR17353. llvm-svn: 191368
* MC: Remove vestigial PCSymbol field from AsmInfoDavid Majnemer2013-09-251-1/+0
| | | | llvm-svn: 191362
* MachO: Improve backend diagnostic for overalignment.Jim Grosbach2013-09-241-1/+2
| | | | | | Give the symbol's name and disengage the enchanced crash reporting. llvm-svn: 191344
* Make the size and expr arguments of .fill directive optional.Roman Divacky2013-09-241-16/+21
| | | | llvm-svn: 191318
* Fixed debug_aranges handling for common symbols.Richard Mitton2013-09-231-4/+4
| | | | | | | | | | The size of common symbols is now tracked correctly, so they can be listed in the arange section without needing knowledge of other following symbols. .comm (and .lcomm) do not indicate to the system assembler any particular section to use, so we have to treat them as having no section. Test case update to account for this. llvm-svn: 191210
* Provide basic type safety for array_pod_sort comparators.Benjamin Kramer2013-09-223-11/+9
| | | | | | | | This makes using array_pod_sort significantly safer. The implementation relies on function pointer casting but that should be safe as we're dealing with void* here. llvm-svn: 191175
* ELF: Parse types in directives like binutils gasDavid Majnemer2013-09-211-20/+43
| | | | | | | | | | Allow binutils .type and .section directives to take the following forms: - @<type> - %<type> - "<type>" llvm-svn: 191134
* Initialize BSSSection explicitly in InitMachOMCObjectFileInfo() to appease msvc.NAKAMURA Takumi2013-09-211-0/+3
| | | | | | This can revert r191087. llvm-svn: 191128
* MC: Tidy up.Jim Grosbach2013-09-201-743/+723
| | | | | | | | Clean up some simple code quality issues. Bring internal naming conventions up to current standard, fix inconsistent formatting, and tidy up a couple of odd contructs. llvm-svn: 191117
* Added support for generate DWARF .debug_aranges sections automatically.Richard Mitton2013-09-197-11/+43
| | | | llvm-svn: 191052
* Remove extraneous space, the asm printing infrastructure adds a spaceEric Christopher2013-09-191-1/+0
| | | | | | in normally. llvm-svn: 191026
* Fix X86 subtarget to not overwrite the autodetected features by calling ↵Craig Topper2013-09-181-0/+5
| | | | | | InitMCProcessorInfo right after detecting them. Instead add a new function that only updates the scheduling model and call that. llvm-svn: 190919
* COFF: Ensure that objects produced by LLVM link with /safesehReid Kleckner2013-09-171-5/+14
| | | | | | | | | | | | | | | | | | | | Summary: We indicate that the object files are safe by emitting a @feat.00 absolute address symbol. The address is presumably interpreted as a bitfield of features that the compiler would like to enable. Bit 0 is documented in the PE COFF spec to opt in to "registered SEH", which is what /safeseh enables. LLVM's object files are safe by default because LLVM doesn't know how to produce SEH handlers. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1691 llvm-svn: 190898
* COFF: Emit all MCSymbols rather than filtering out some of themReid Kleckner2013-09-171-19/+3
| | | | | | | | | | In particular, this means we emit non-external symbols defined to variables, such as aliases or absolute addresses. This is needed to implement /safeseh, and it appears there was some confusion about what symbols to emit previously. llvm-svn: 190888
* COFF: Remove ExportSection, which has been dead since r114823Reid Kleckner2013-09-171-5/+0
| | | | llvm-svn: 190887
* Use reference instead of copy.Jakub Staszak2013-09-161-1/+1
| | | | llvm-svn: 190813
* ELF: Add support for the exclude section bit for gas compat.Benjamin Kramer2013-09-152-5/+12
| | | | llvm-svn: 190769
* MC: Add support for '?' flags in .section directivesDavid Majnemer2013-09-151-2/+20
| | | | | | | | | | | | | | | | | | | Summary: The '?' flag uses the last section group if the last had a section group. We treat combining an explicit section group and the '?' as a hard error. This fixes PR17198. Reviewers: rafael, bkramer Reviewed By: bkramer CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1686 llvm-svn: 190768
* Fix alignment of unwind data.Kai Nacke2013-09-151-7/+12
| | | | | | | | | | | For alignment purposes, the instruction array will always have an even number of entries, with the final entry potentially unused (in which case the array will be one longer than indicated by the count of unwind codes field). Reviewed by Anton Korobeynikov, Charles Davis and Nico Rieck. llvm-svn: 190767
* Generate IMAGE_REL_AMD64_ADDR32NB relocations for SEHKai Nacke2013-09-151-5/+21
| | | | | | | | | | | | | | data structures. The Win64 EH data structures must be of type IMAGE_REL_AMD64_ADDR32NB instead of IMAGE_REL_AMD64_ADDR32. This is easiely achieved by adding the VK_COFF_IMGREL32 modifier to the symbol reference. Change also references to start and end of the SEH range of a function as offsets to start of the function. Reviewed by Jim Grosbach, Charles Davis and Nico Rieck. llvm-svn: 190766
* Remove unused StringRef that no compiler warned about, I wonder why.Benjamin Kramer2013-09-141-1/+0
| | | | llvm-svn: 190759
* Remove unused functions.Eli Friedman2013-09-101-11/+0
| | | | llvm-svn: 190442
* MCObjectFileInfo.cpp: Fix a couple of possible typo(s), ↵NAKAMURA Takumi2013-09-101-2/+2
| | | | | | | | s/DwarfPub/DwarfGnuPub/, in r190344. XFAIL can be removed. (in r190374) llvm-svn: 190386
* Set the encoding to '0' if we don't have an MAB.Bill Wendling2013-09-091-2/+1
| | | | llvm-svn: 190354
* Add the gnu pubnames and pubtypes sections to the mc object fileEric Christopher2013-09-091-0/+24
| | | | | | handling. llvm-svn: 190344
* Call generateCompactUnwindEncodings() right before we need to output the ↵Bill Wendling2013-09-095-14/+15
| | | | | | | | | | | | | frame information. There are more than one paths to where the frame information is emitted. Place the call to generateCompactUnwindEncodings() into the method which outputs the frame information, thus ensuring that the encoding is there for every path. This involved threading the MCAsmBackend object through to this method. <rdar://problem/13623355> llvm-svn: 190335
* Generate compact unwind encoding from CFI directives.Bill Wendling2013-09-092-0/+10
| | | | | | | | | | | | | | | We used to generate the compact unwind encoding from the machine instructions. However, this had the problem that if the user used `-save-temps' or compiled their hand-written `.s' file (with CFI directives), we wouldn't generate the compact unwind encoding. Move the algorithm that generates the compact unwind encoding into the MCAsmBackend. This way we can generate the encoding whether the code is from a `.ll' or `.s' file. <rdar://problem/13623355> llvm-svn: 190290
* Improve handling of .file, .include and .incbin directives toYunzhong Gao2013-09-051-12/+16
| | | | | | | | | allow escaped octal character sequences. The patch was discussed in Phabricator. See: http://llvm-reviews.chandlerc.com/D1289 llvm-svn: 190089
* Fix comments to reflect reality.Bill Wendling2013-09-051-6/+2
| | | | llvm-svn: 190021
* Add names for mach-o permissions bits and use the symbol names in place of ↵Nick Kledzik2013-09-041-2/+4
| | | | | | magic numbers llvm-svn: 190013
* Add missing header line.Bill Wendling2013-09-041-0/+1
| | | | llvm-svn: 190004
* Use ArrayRef instead of explicit container.Bill Wendling2013-09-041-2/+2
| | | | llvm-svn: 190003
* Move everything depending on Object/MachOFormat.h over to Support/MachO.h.Charles Davis2013-09-013-56/+55
| | | | llvm-svn: 189728
* The integrated darwin assembler can hang in an infinite loop (or get an assert Kevin Enderby2013-08-283-4/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | with a debug build) with this buggy .indirect_symbol directive usage: % cat test.s x: .indirect_symbol _y The assertion is because it is trying to get the symbol index for the symbol _y when it is writing out the indirect symbol table. This line of code in MachObjectWriter::WriteObject() : Write32(Asm.getSymbolData(*it->Symbol).getIndex()); And while there is a symbol _y it does not have any getSymbolData set which is only done in MachObjectWriter::BindIndirectSymbols() for pointer sections or stub sections. I added a check and an error in there to catch this in case something slips through. But to get a better error the parser should detect when a .indirect_symbol directive is used and it is not in a pointer section or stub section. To make that work I moved the handling of the indirect symbol out of the target independent AsmParser code into the DarwinAsmParser code that can check for the proper Mach-O section types. rdar://14825505 llvm-svn: 189497
* Remove support for the .debug_inlined section. No known softwareEric Christopher2013-08-281-1/+0
| | | | | | in use supports it. llvm-svn: 189439
* Given target assembler parsers a chance to handle variant expressionsJoerg Sonnenberger2013-08-271-0/+4
| | | | | | | first. Use this to turn the PPC modifiers into PPC specific expressions, allowing them to work on constants. llvm-svn: 189400
* Revert "Fix the build broken by r189315." and "Move everything depending on ↵Charles Davis2013-08-273-55/+56
| | | | | | | | | Object/MachOFormat.h over to Support/MachO.h." This reverts commits r189319 and r189315. r189315 broke some tests on what I believe are big-endian platforms. llvm-svn: 189321
* Move everything depending on Object/MachOFormat.h over to Support/MachO.h.Charles Davis2013-08-273-56/+55
| | | | llvm-svn: 189315
* Support/MachO: Add a bunch of defines.Charles Davis2013-08-271-1/+1
| | | | | | | | Right now we have two headers for the Mach-O format. I'd like to get rid of one. Since the other object formats are all in Support, I chose to keep the Mach-O header in Support, and discard the other one. llvm-svn: 189314
* Fix wrong code offset for unwind code SET_FPREG.Kai Nacke2013-08-272-4/+5
| | | | | | | | | | | | The code offset for unwind code SET_FPREG is wrong because it is set to constant 0. The fix is to do the same as for the other unwind codes: emit a label and later the absolute difference between the label and the begin of the prologue. Also enables the failing test case MC/COFF/seh.s Reviewed by Jim Grosbach, Charles Davis and Nico Rieck. llvm-svn: 189309
* MC CFG: Remap enough for data too, analoguous to r188873.Ahmed Bougacha2013-08-211-1/+1
| | | | llvm-svn: 188925
OpenPOWER on IntegriCloud