summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCStreamer.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [weak vtables] Remove a bunch of weak vtablesJuergen Ributzka2013-11-151-0/+2
| | | | | | | | | | | This patch removes most of the trivial cases of weak vtables by pinning them to a single object file. Differential Revision: http://llvm-reviews.chandlerc.com/D2068 Reviewed by Andy llvm-svn: 194865
* MCStreamer: Reimplement the virtual EmitRawText as a protected member, ↵David Blaikie2013-10-241-3/+2
| | | | | | | | | | EmitRawTextImpl, to avoid string literal ambiguities Also improve the implementation of EmitRawText(Twine) so it doesn't bother using the SmallString buffer if the Twine is a simple StringRef anyway. llvm-svn: 193378
* Add a MCTargetStreamer interface.Rafael Espindola2013-10-081-53/+8
| | | | | | | | | | | | | This patch fixes an old FIXME by creating a MCTargetStreamer interface and moving the target specific functions for ARM, Mips and PPC to it. The ARM streamer is still declared in a common place because it is used from lib/CodeGen/ARMException.cpp, but the Mips and PPC are completely hidden in the corresponding Target directories. I will send an email to llvmdev with instructions on how to use this. llvm-svn: 192181
* Remove some really nasty uses of hasRawTextSupport.Rafael Espindola2013-10-051-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When MC was first added, targets could use hasRawTextSupport to keep features working before they were added to the MC interface. The design goal of MC is to provide an uniform api for printing assembly and object files. Short of relaxations and other corner cases, a object file is just another representation of the assembly. It was never the intention that targets would keep doing things like if (hasRawTextSupport()) Set flags in one way. else Set flags in another way. When they do that they create two code paths and the object file is no longer just another representation of the assembly. This also then requires testing with llc -filetype=obj, which is extremelly brittle. This patch removes some of these hacks by replacing them with smaller ones. The ARM flag setting is trivial, so I just moved it to the constructor. For Mips, the patch adds two temporary hack directives that allow the assembly to represent the same things as the object file was already able to. The hope is that the mips developers will replace the hack directives with the same ones that gas uses and drop the -print-hack-directives flag. I will also try to implement a target streamer interface, so that we can move this out of the common code. In summary, for any new work, two rules of the thumb are * Don't use "llc -filetype=obj" in tests. * Don't add calls to hasRawTextSupport. llvm-svn: 192035
* Implements parsing and emitting of .cfi_window_save in MC.Venkatraman Govindaraju2013-09-261-0/+8
| | | | llvm-svn: 191431
* Added support for generate DWARF .debug_aranges sections automatically.Richard Mitton2013-09-191-2/+13
| | | | llvm-svn: 191052
* Set the encoding to '0' if we don't have an MAB.Bill Wendling2013-09-091-2/+1
| | | | llvm-svn: 190354
* Call generateCompactUnwindEncodings() right before we need to output the ↵Bill Wendling2013-09-091-7/+7
| | | | | | | | | | | | | 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-091-0/+9
| | | | | | | | | | | | | | | 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
* Fix wrong code offset for unwind code SET_FPREG.Kai Nacke2013-08-271-1/+3
| | | | | | | | | | | | 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
* Revert: Fix wrong code offset for unwind code SET_FPREG.Kai Nacke2013-07-081-3/+1
| | | | llvm-svn: 185793
* Fix wrong code offset for unwind code SET_FPREG.Kai Nacke2013-07-061-1/+3
| | | | | | | | | | | | 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 Charles Davis and Nico Rieck. llvm-svn: 185758
* Remove address spaces from MC.Rafael Espindola2013-07-021-25/+17
| | | | | | | | This is dead code since PIC16 was removed in 2010. The result was an odd mix, where some parts would carefully pass it along and others would assert it was zero (most of the object streamer for example). llvm-svn: 185436
* Use MCFillFragment for zero-initialized data.Serge Pavlov2013-06-271-0/+6
| | | | | | | | It fixes PR16338 (ICE when compiling very large two-dimensional array). Differential Revision: http://llvm-reviews.chandlerc.com/D1043 llvm-svn: 185080
* Use pointers to the MCAsmInfo and MCRegInfo.Bill Wendling2013-06-181-3/+3
| | | | | | | | | Someone may want to do something crazy, like replace these objects if they change or something. No functionality change intended. llvm-svn: 184175
* MCStreamer: Also clear vector of W64UnwindInfos on reset().Charles Davis2013-05-071-0/+1
| | | | | | Patch by Kai Nacke! llvm-svn: 181363
* Add support for subsections to the ELF assembler. Fixes PR8717.Peter Collingbourne2013-04-171-8/+6
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D598 llvm-svn: 179725
* Change NULL to 0.Jakub Staszak2013-03-181-5/+5
| | | | llvm-svn: 177342
* Debug Info: store the files and directories for each compile unit.Manman Ren2013-03-071-2/+2
| | | | | | | | | | | | | | We now emit a line table for each compile unit. To reduce the prologue size of each line table, the files and directories used by each compile unit are stored in std::map<unsigned, std::vector< > > instead of std::vector< >. The prologue for a lto'ed image can be as big as 93K. Duplicating 93K for each compile unit causes a huge increase of debug info. With this patch, each prologue will only emit the files required by the compile unit. rdar://problem/13342023 llvm-svn: 176605
* ELF symbol table field st_other support, Jack Carter2013-02-191-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | excluding visibility bits. Generic STO handling at the Target level. The st_other field of the ELF symbol table is one byte in size. The first 2 bytes are used for generic visibility and are currently handled by llvm. The other six bits are processor specific and need to be set at the target level. A couple of notes: The new static methods for accessing and setting the "other" flags in include/llvm/MC/MCELF.h match the style guide and not the other methods in the file. I don't like the inconsistency, but feel I should follow the prescribed lowerUpper() convention. STO_ value definitions are not specified in gnu land as consistently as the STT_ and STB_ fields. Probably because the latter were defined in a standards doc and the former defined partially in code. I have stuck with the full byte definition of the flags. Contributer: Zoran Jovanovic llvm-svn: 175561
* This patch just fixes up various llvm formattingJack Carter2013-02-121-2/+2
| | | | | | | | | | violations such as tabs, blanks at eol and long lines. llvm-svn: 175007
* Give the MCStreamer class hierarchy LLVM RTTI facilities for use withChandler Carruth2013-01-311-4/+3
| | | | | | | | | | | | | | | | isa<> and dyn_cast<>. In several places, code is already hacking around the absence of this, and there seem to be several interfaces that might be lifted and/or devirtualized using this. This change was based on a discussion with Jim Grosbach about how best to handle testing for specific MCStreamer subclasses. He said that this was the correct end state, and everything else was too hacky so I decided to just make it so. No functionality should be changed here, this is just threading the kind through all the constructors and setting up the classof overloads. llvm-svn: 174113
* Last in the series of removing unnecessary '0' arguments forEric Christopher2013-01-091-2/+2
| | | | | | | address space. Reordered the EmitULEB128IntValue arguments to make this easier. llvm-svn: 171949
* small fixes to enable the reuse of the pass manager across multiple modulesPedro Artigas2013-01-041-1/+0
| | | | llvm-svn: 171475
* This patch is needed to make c++ exceptions work for mips16.Reed Kotler2012-12-161-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mips16 is really a processor decoding mode (ala thumb 1) and in the same program, mips16 and mips32 functions can exist and can call each other. If a jal type instruction encounters an address with the lower bit set, then the processor switches to mips16 mode (if it is not already in it). If the lower bit is not set, then it switches to mips32 mode. The linker knows which functions are mips16 and which are mips32. When relocation is performed on code labels, this lower order bit is set if the code label is a mips16 code label. In general this works just fine, however when creating exception handling tables and dwarf, there are cases where you don't want this lower order bit added in. This has been traditionally distinguished in gas assembly source by using a different syntax for the label. lab1: ; this will cause the lower order bit to be added lab2=. ; this will not cause the lower order bit to be added In some cases, it does not matter because in dwarf and debug tables the difference of two labels is used and in that case the lower order bits subtract each other out. To fix this, I have added to mcstreamer the notion of a debuglabel. The default is for label and debug label to be the same. So calling EmitLabel and EmitDebugLabel produce the same result. For various reasons, there is only one set of labels that needs to be modified for the mips exceptions to work. These are the "$eh_func_beginXXX" labels. Mips overrides the debug label suffix from ":" to "=." . This initial patch fixes exceptions. More changes most likely will be needed to DwarfCFException to make all of this work for actual debugging. These changes will be to emit debug labels in some places where a simple label is emitted now. Some historical discussion on this from gcc can be found at: http://gcc.gnu.org/ml/gcc-patches/2008-08/msg00623.html http://gcc.gnu.org/ml/gcc-patches/2008-11/msg01273.html llvm-svn: 170279
* Make the MCStreamer have a reset method and call that after finalization of ↵Pedro Artigas2012-12-121-0/+13
| | | | | | | | the asm printer, also changed MCContext to a single reset only method for simplicity as requested on the list llvm-svn: 170041
* Defer call to InitSections until after MCContext has been initialized. IfLang Hames2012-12-101-1/+2
| | | | | | | | InitSections is called before the MCContext is initialized it could cause duplicate temporary symbols to be emitted later (after context initialization resets the temporary label counter). llvm-svn: 169785
* 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
OpenPOWER on IntegriCloud