summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCStreamer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-4/+4
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Add support for .cfi_register now that it is easy to extent the representationRafael Espindola2012-11-251-0/+8
| | | | | | | to support it. Original patch with the parsing and plumbing by the PaX team and Roman Divacky. I added the bits in MCDwarf.cpp and the test. llvm-svn: 168565
* Give each MCCFIInstruction its own opcode.Rafael Espindola2012-11-241-1/+1
| | | | | | | This untangles the switch cases of the old Move and RelMove opcodes a bit and makes it clear how to add new instructions. llvm-svn: 168534
* Move a bit of duplicated code into a helper function.Rafael Espindola2012-11-241-46/+29
| | | | llvm-svn: 168533
* Refactor how MCCFIInstructions are created.Rafael Espindola2012-11-241-24/+21
| | | | | | | | | | Give MCCFIInstruction a single, private constructor and add helper static methods that create each type of cfi instruction. This is is preparation for changing its representation. The representation with a pair MachineLocations older than MC and has been abused quiet a bit to support more cfi instructions. llvm-svn: 168532
* Implement .cfi_undefined. Based on a patch from PaX team, updated byRafael Espindola2012-11-231-0/+9
| | | | | | Roman Divacky. I just added the testcase. llvm-svn: 168520
* PowerPC: add EmitTCEntry class for TOC creationAdhemerval Zanella2012-10-151-0/+4
| | | | | | | This patch replaces the EmitRawText by a EmitTCEntry class (specialized for each Streamer) in PowerPC64 TOC entry creation. llvm-svn: 165940
* Move [SU]LEB128 encoding to a utility header.Jim Grosbach2012-08-081-2/+3
| | | | | | | These functions are very generic. There's no reason for them to be tied to MCObjectWriter. llvm-svn: 161545
* Refactor data-in-code annotations.Jim Grosbach2012-05-181-86/+3
| | | | | | | | | | | | | | | | | | | | | | Use a dedicated MachO load command to annotate data-in-code regions. This is the same format the linker produces for final executable images, allowing consistency of representation and use of introspection tools for both object and executable files. Data-in-code regions are annotated via ".data_region"/".end_data_region" directive pairs, with an optional region type. data_region_directive := ".data_region" { region_type } region_type := "jt8" | "jt16" | "jt32" | "jta32" end_data_region_directive := ".end_data_region" The previous handling of ARM-style "$d.*" labels was broken and has been removed. Specifically, it didn't handle ARM vs. Thumb mode when marking the end of the section. rdar://11459456 llvm-svn: 157062
* Bump SmallString to the minimum required amount for raw_ostream to avoid ↵Benjamin Kramer2012-02-231-2/+2
| | | | | | | | allocation. It's is a bit annoying, we should hide this implementation detail better. llvm-svn: 151284
* Convert assert(0) to llvm_unreachableCraig Topper2012-02-071-1/+1
| | | | llvm-svn: 149967
* Add a new MachineJumpTableInfo entry type, EK_GPRel64BlockAddress, which isAkira Hatanaka2012-02-031-0/+4
| | | | | | | | needed to emit a 64-bit gp-relative relocation entry. Make changes necessary for emitting jump tables which have entries with directive .gpdword. This patch does not implement the parts needed for direct object emission or JIT. llvm-svn: 149668
* Add support for .cfi_signal_frame. Fixes pr11762.Rafael Espindola2012-01-231-0/+6
| | | | llvm-svn: 148733
* Don't print an unused label before .cfi_endproc.Rafael Espindola2012-01-091-2/+9
| | | | llvm-svn: 147763
* Don't print a label before .cfi_startproc when we don't need to. This makesRafael Espindola2012-01-071-4/+10
| | | | | | the produce assembly when using CFI just a bit more readable. llvm-svn: 147743
* Split Finish into Finish and FinishImpl to have a common place to do end ofRafael Espindola2012-01-071-0/+7
| | | | | | | | file error checking. Use that to error on an unfinished cfi_startproc. The error is not nice, but is already better than a segmentation fault. llvm-svn: 147717
* Implement cfi_restore. Patch by Brian Anderson!Rafael Espindola2011-12-291-0/+9
| | | | llvm-svn: 147356
* Rename Remember and Restore to RememberState and RestoreState for consistency.Rafael Espindola2011-12-291-2/+2
| | | | llvm-svn: 147354
* Implement .cfi_escape. Patch by Brian Anderson!Rafael Espindola2011-12-291-0/+9
| | | | llvm-svn: 147352
* Add back the MC bits of 126425. Original patch by Nathan Jeffords. I added theRafael Espindola2011-12-171-0/+4
| | | | | | asm parsing and testcase. llvm-svn: 146801
* Twinify.Benjamin Kramer2011-11-051-16/+13
| | | | llvm-svn: 143811
* Add an option to pad an uleb128 to MCObjectWriter and remove the uleb128 ↵Benjamin Kramer2011-11-051-2/+3
| | | | | | | | encoding from the DWARF asm printer. As a side effect we now print dwarf ulebs with .ascii directives. llvm-svn: 143809
* Add support for a new extension to the .file directive:Nick Lewycky2011-10-171-1/+2
| | | | | | | | | | .file filenumber "directory" "filename" This removes one join+split of the directory+filename in MC internals. Because bitcode files have independent fields for directory and filenames in debug info, this patch may change the .o files written by existing .bc files. llvm-svn: 142300
* Teach the MC to output code/data region marker labels in MachO and ELF ↵Owen Anderson2011-10-041-1/+86
| | | | | | modes. These are used by disassemblers to provide better disassembly, particularly on targets like ARM Thumb that like to intermingle data in the TEXT segment. llvm-svn: 141135
* Initialize member variable.Benjamin Kramer2011-08-251-1/+2
| | | | llvm-svn: 138548
* Some autoconf tests use module level inline asm to test compiler's handling ofEvan Cheng2011-08-241-2/+2
| | | | | | | | | | | | | | | | .cfi_startproc. e.g. libffi: $ cat confopt.c asm (".cfi_startproc\n\t.cfi_endproc"); int main () { return 0; } Teach MC / dwarf emission to handle these cfi directives which essentially create an empty frame. rdar://10017184 llvm-svn: 138504
* Assume .cfi_startproc is the first thing in a function. If the function isRafael Espindola2011-08-021-7/+14
| | | | | | | | | externally visable, create a local symbol to use in the CFE. If not, use the function label itself. Fixes PR10420. llvm-svn: 136716
* Add a method to set compact unwind encoding information in a frame.Bill Wendling2011-07-191-0/+6
| | | | llvm-svn: 135449
* Move some parts of TargetAsmInfo down to MCAsmInfo. This is not the greatestEvan Cheng2011-07-151-2/+1
| | | | | | | solution but it is a small step towards removing the horror that is TargetAsmInfo. llvm-svn: 135237
* Make EmitIntValue() work properly on big-endian targets.Roman Divacky2011-06-071-3/+6
| | | | llvm-svn: 132715
* Start keeping track of where the various unwind instructions are in the prolog.Charles Davis2011-05-271-6/+16
| | | | | | | Use them to calculate the offset inside the prolog. Emit this value when emitting the unwind codes. llvm-svn: 132177
* My attempt at fixing the leak reported by the valgrind buildbots. Valgrind willCharles Davis2011-05-271-2/+4
| | | | | | | | still report leaks, but they're spurious now. Valgrind cannot peer into std::vector objects--or any dynamic array, for that matter--because it doesn't know how big the array is. llvm-svn: 132174
* Fix inverted conditional in SaveReg and SaveXMM. Err when the frame pointer isCharles Davis2011-05-271-3/+7
| | | | | | | already defined, and err when the PushMachFrame operation isn't the first operation (if specified at all). llvm-svn: 132173
* Test .seh_startchained and .seh_endchained parsing.Charles Davis2011-05-261-13/+13
| | | | | | | | | | | Rework how the MCWin64EHUnwindInfo instances are stored. Fix issues with chained unwind areas exposed by the test that were related to this. The ChainedParent field had the wrong address, because when the chained unwind info was added, the addresses shifted around. Now we store the pointers to the structures, which are now allocated from the MC heap. llvm-svn: 132106
* Test basic SEH directive-parsing functionality. Fix a latent bug exposed byCharles Davis2011-05-241-1/+2
| | | | | | this test. llvm-svn: 132004
* Add methods to parse the SEH directives to the COFFAsmParser. Implement someCharles Davis2011-05-221-1/+1
| | | | | | | of them, particularly the ones that don't take arguments. Also implement .seh_proc and .seh_handler. llvm-svn: 131866
* Implement emission of all Win64 exception tables. Make the COFF streamer emitCharles Davis2011-05-221-0/+7
| | | | | | these tables. llvm-svn: 131833
* Don't allow unaligned offsets and sizes in the Win64 EH directives.Charles Davis2011-05-221-2/+10
| | | | | | Also, fix threshold for 'Big' register saves. llvm-svn: 131830
* Don't allow .seh_handler and .seh_handlerdata directives inside chainedCharles Davis2011-05-211-0/+5
| | | | | | unwind areas. llvm-svn: 131795
* A handler for a function in the Win64 EH scheme can be both an unwind handlerCharles Davis2011-05-211-3/+5
| | | | | | | | | and an exception handler. Handle that case. Also, add an 'Emitted' member to the MCWin64EHUnwindInfo struct. It will be needed later. llvm-svn: 131791
* Set the "LastFrameInst" field when streaming a .seh_setframe directive. ThisCharles Davis2011-05-211-0/+1
| | | | | | is needed for an upcoming patch. llvm-svn: 131772
* "Implement" the HandlerData Win64 EH method in the base MCStreamer.Charles Davis2011-05-201-2/+1
| | | | | | | | There's really nothing to implement. All this really does is swap to a pseudo-section that later gets written to the unwind info struct. That needs to be implemented in the object streamers. llvm-svn: 131734
* Looks like OS X assemblers (including MC) don't likeRafael Espindola2011-05-191-1/+2
| | | | | | | | | | foo: bar = foo .quad bar Avoid producing it. Fixes PR9951. llvm-svn: 131687
* Misc code refactorings:Rafael Espindola2011-05-191-14/+8
| | | | | | | * Remove unnecessary arguments now that ForceExpAbs is a method. * Use ForceExpAbs in EmitAbsValue. llvm-svn: 131683
* Implement the EndProlog Win64 EH method on the base MCStreamer.Charles Davis2011-05-191-2/+4
| | | | llvm-svn: 131679
* Implement the Win64 EH prolog instruction methods on the base MCStreamer.Charles Davis2011-05-191-17/+33
| | | | | | I had to change the API slightly to avoid overloading issues. llvm-svn: 131666
* Turns out GAS does have Win64 EH directives. (It also supports WinCE EH.) MakeCharles Davis2011-05-191-22/+22
| | | | | | | | | ours compatible with GAS. In retrospect, I should have emailed binutils about this earlier. Thanks to Kai Tietz for pointing out that GAS already had SEH directives. llvm-svn: 131652
* Implement the StartChained and EndChained Win64 EH methods on MCStreamer.Charles Davis2011-05-191-13/+23
| | | | llvm-svn: 131629
* Implement the StartProc and EndProc Win64 EH methods on the base MCStreamer.Charles Davis2011-05-191-8/+29
| | | | | | Based largely on Rafael Espindola's work on CFI. Other methods soon to follow. llvm-svn: 131623
* Add some more Win64 EH directives:Charles Davis2011-05-181-0/+24
| | | | | | | | | | | | | - StartChained and EndChained delimit a chained unwind area, which can contain additional operations to be undone if an exception occurs inside of it. - UnwindOnly declares that this function doesn't handle any exceptions. If it has a handler, it's an unwind handler instead of an exception handler. - Lsda declares the location and size of the LSDA, which in the Win64 EH scheme is kept inside the UNWIND_INFO struct. Windows itself ignores the LSDA; it's used by the Language-Specific Handler (the "Personality Function" from DWARF). llvm-svn: 131572
OpenPOWER on IntegriCloud