summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Style cleanup following David's review for r188876.Ahmed Bougacha2013-08-211-5/+4
| | | | llvm-svn: 188924
* MC CFG: Add YAML MCModule representation to enable MC CFG testing.Ahmed Bougacha2013-08-212-0/+462
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like yaml ObjectFiles, this will be very useful for testing the MC CFG implementation (mostly MCObjectDisassembler), by matching the output with YAML, and for potential users of the MC CFG, by using it as an input. There isn't much to the actual format, it is just a serialization of the MCModule class. Of note: - Basic block references (pred/succ, ..) are represented by the BB's start address. - Just as in the MC CFG, instructions are MCInsts with a size. - Operands have a prefix representing the type (only register and immediate supported here). - Instruction opcodes are represented by their names; enum values aren't stable, enum names mostly are: usually, a change to a name would need lots of changes in the backend anyway. Same with registers. All in all, an example is better than 1000 words, here goes: A simple binary: Disassembly of section __TEXT,__text: _main: 100000f9c: 48 8b 46 08 movq 8(%rsi), %rax 100000fa0: 0f be 00 movsbl (%rax), %eax 100000fa3: 3b 04 25 48 00 00 00 cmpl 72, %eax 100000faa: 0f 8c 07 00 00 00 jl 7 <.Lend> 100000fb0: 2b 04 25 48 00 00 00 subl 72, %eax .Lend: 100000fb7: c3 ret And the (pretty verbose) generated YAML: --- Atoms: - StartAddress: 0x0000000100000F9C Size: 20 Type: Text Content: - Inst: MOV64rm Size: 4 Ops: [ RRAX, RRSI, I1, R, I8, R ] - Inst: MOVSX32rm8 Size: 3 Ops: [ REAX, RRAX, I1, R, I0, R ] - Inst: CMP32rm Size: 7 Ops: [ REAX, R, I1, R, I72, R ] - Inst: JL_4 Size: 6 Ops: [ I7 ] - StartAddress: 0x0000000100000FB0 Size: 7 Type: Text Content: - Inst: SUB32rm Size: 7 Ops: [ REAX, REAX, R, I1, R, I72, R ] - StartAddress: 0x0000000100000FB7 Size: 1 Type: Text Content: - Inst: RET Size: 1 Ops: [ ] Functions: - Name: __text BasicBlocks: - Address: 0x0000000100000F9C Preds: [ ] Succs: [ 0x0000000100000FB7, 0x0000000100000FB0 ] <snip> ... llvm-svn: 188890
* MC CFG: Support disassembly at arbitrary addresses in MCObjectDisassembler.Ahmed Bougacha2013-08-211-7/+206
| | | | llvm-svn: 188889
* MC CFG: Use data structures more appropriate than std::set.Ahmed Bougacha2013-08-211-10/+16
| | | | llvm-svn: 188888
* MC CFG: Add an MCObjectSymbolizer in the MCObjectDisassembler.Ahmed Bougacha2013-08-211-1/+2
| | | | | | Used to detect calls to function symbol stubs (future commit). llvm-svn: 188887
* MC CFG: Add MCObjectDisassembler Mach-O implementation.Ahmed Bougacha2013-08-211-0/+89
| | | | | | | | | | Supports: - entrypoint, using LC_MAIN. - static ctors/dtors, using __mod_{init,exit}_func - translation between effective and object load address, using dyld's VM address slide. llvm-svn: 188886
* MC CFG: Add "dynamic disassembly" support to MCObjectDisassembler.Ahmed Bougacha2013-08-211-1/+11
| | | | | | | | It can now disassemble code in situations where the effective load address is different than the load address declared in the object file. This happens for PIC, hence "dynamic". llvm-svn: 188884
* MC CFG: When disassembly is impossible, fallback to data bytes.Ahmed Bougacha2013-08-211-16/+30
| | | | | | | | | This is the behavior of sequential disassemblers (llvm-objdump, ...), when there is no instruction size hint (fixed-length, ...) While there, also do some minor cleanup. llvm-svn: 188883
* MC CFG: Add MCObjectDisassembler support for entrypoint + static ctors.Ahmed Bougacha2013-08-211-2/+49
| | | | | | For now, this isn't implemented for any format. llvm-svn: 188882
* MC CFG: Split MCBasicBlocks to mirror atom splitting.Ahmed Bougacha2013-08-213-2/+42
| | | | | | | | When an MCTextAtom is split, all MCBasicBlocks backed by it are automatically split, with a fallthrough between both blocks, and the successors moved to the second block. llvm-svn: 188881
* MC CFG: Add a few needed methods, mainly MCModule::findFirstAtomAfter.Ahmed Bougacha2013-08-212-5/+20
| | | | | | While there, do some minor cleanup. llvm-svn: 188880
* MC: ObjectSymbolizer can now recognize external function stubs.Ahmed Bougacha2013-08-211-1/+76
| | | | | | | Only implemented in the Mach-O ObjectSymbolizer. The testcase sadly introduces a new binary. llvm-svn: 188879
* MC: Refactor ObjectSymbolizer to make relocation/section info generation lazy.Ahmed Bougacha2013-08-211-100/+122
| | | | llvm-svn: 188878
* MC CFG: Add more MCFunction container methods (find, empty).Ahmed Bougacha2013-08-211-0/+12
| | | | llvm-svn: 188876
* MC CFG: Keep pointer to parent MCModule in created MCFunctions.Ahmed Bougacha2013-08-212-5/+9
| | | | | | Also, drive-by cleaning around createFunction. llvm-svn: 188875
* MC CFG: Don't insert preds/succs again.Ahmed Bougacha2013-08-211-2/+4
| | | | llvm-svn: 188874
* MC CFG: Remap enough for the inserted instruction.Ahmed Bougacha2013-08-211-2/+2
| | | | llvm-svn: 188873
* Fix style issues in AsmParser.cppVladimir Medic2013-08-201-9/+11
| | | | llvm-svn: 188798
* Support C99 hexadecimal floating-point literals in assemblyTim Northover2013-08-141-1/+53
| | | | | | | | It's useful to be able to write down floating-point numbers without having to worry about what they'll be rounded to (as C99 discovered), this extends that ability to the MC assembly parsers. llvm-svn: 188370
* [-cxx-abi microsoft] Stick zero initialized symbols into the .bss section ↵David Majnemer2013-08-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | for COFF Summary: We need to do two things: - Initialize BSSSection in MCObjectFileInfo::InitCOFFMCObjectFileInfo - Teach TargetLoweringObjectFileCOFF::SelectSectionForGlobal what to do with it This fixes PR16861. Reviewers: rnk Reviewed By: rnk CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1361 llvm-svn: 188244
* [CodeGen] prevent abnormal on invalid attributesSaleem Abdulrasool2013-08-097-19/+32
| | | | | | | | | | | Currently, when an invalid attribute is encountered on processing a .s file, clang will abort due to llvm_unreachable. Invalid user input should not cause an abnormal termination of the compiler. Change the interface to return a boolean to indicate the failure as a first step towards improving hanlding of malformed user input to clang. Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org> llvm-svn: 188047
* [Object] Split the ELF interface into 3 parts.Michael J. Spencer2013-08-081-2/+2
| | | | | | | | * ELFTypes.h contains template magic for defining types based on endianess, size, and alignment. * ELFFile.h defines the ELFFile class which provides low level ELF specific access. * ELFObjectFile.h contains ELFObjectFile which uses ELFFile to implement the ObjectFile interface. llvm-svn: 188022
* Fix a FIXME, on darwin all virtual sections have a zerofill type.Eric Christopher2013-08-071-1/+2
| | | | llvm-svn: 187912
* Move assert above first use of variable that we'd be asserting on.Eric Christopher2013-08-071-2/+2
| | | | llvm-svn: 187899
* AsmParser: Store MacroLikeBodies on the side so they don't get leaked.Benjamin Kramer2013-08-041-1/+5
| | | | llvm-svn: 187702
* Pacify GCC, which worries about falling off the end of the switch.Duncan Sands2013-08-021-0/+2
| | | | llvm-svn: 187649
* Fixed the Intel-syntax X86 disassembler to respect the (existing) option for ↵Daniel Malea2013-08-011-6/+49
| | | | | | | | | hexadecimal immediates, to match AT&T syntax. This also brings a new option for C-vs-MASM-style hex. Patch by Richard Mitton Reviewed: http://llvm-reviews.chandlerc.com/D1243 llvm-svn: 187614
* MC: Support larger COFF string tablesNico Rieck2013-07-291-12/+15
| | | | | | | Single-slash encoded entries do not require a terminating null. This bumps the maximum table size from ~1MB to ~9.5MB. llvm-svn: 187352
* [PowerPC] Support powerpc64le as a syntax-checking target.Bill Schmidt2013-07-261-2/+3
| | | | | | | | | | | | | | | | | | | | | | | This patch provides basic support for powerpc64le as an LLVM target. However, use of this target will not actually generate little-endian code. Instead, use of the target will cause the correct little-endian built-in defines to be generated, so that code that tests for __LITTLE_ENDIAN__, for example, will be correctly parsed for syntax-only testing. Code generation will otherwise be the same as powerpc64 (big-endian), for now. The patch leaves open the possibility of creating a little-endian PowerPC64 back end, but there is no immediate intent to create such a thing. The LLVM portions of this patch simply add ppc64le coverage everywhere that ppc64 coverage currently exists. There is nothing of any import worth testing until such time as little-endian code generation is implemented. In the corresponding Clang patch, there is a new test case variant to ensure that correct built-in defines for little-endian code are generated. llvm-svn: 187179
* Revert "Remove use of asymmetric std::lower_bound comparator."Ahmed Bougacha2013-07-231-18/+12
| | | | | | | This reverts commit r185676. Originally done because of VS 2008. llvm-svn: 186969
OpenPOWER on IntegriCloud