summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCStreamer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert r221150, as it broke sanitizer testsOliver Stannard2014-11-031-4/+4
| | | | llvm-svn: 221151
* Emit .eh_frame with relocations to functions, rather than sectionsOliver Stannard2014-11-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | | When LLVM emits DWARF call frame information, it currently creates a local, section-relative symbol in the code section, which is pointed to by a relocation on the .eh_frame section. However, for C++ we emit some functions in section groups, and the SysV ABI has some rules to make it easier to remove these sections (http://www.sco.com/developers/gabi/latest/ch4.sheader.html#section_group_rules): A symbol table entry with STB_LOCAL binding that is defined relative to one of a group's sections, and that is contained in a symbol table section that is not part of the group, must be discarded if the group members are discarded. References to this symbol table entry from outside the group are not allowed. This means that we need to use the function symbol for the relocation, not a temporary symbol. There was a comment in the code claiming that the local symbol was used to avoid creating a relocation, but a relocation must be created anyway as the code and CFI are in different sections. llvm-svn: 221150
* Simplify handling of --noexecstack by using getNonexecutableStackSection.Rafael Espindola2014-10-151-1/+1
| | | | llvm-svn: 219799
* [asan-asm-instrumentation] CFI directives are generated for .S files.Yuri Gorshenin2014-10-071-0/+12
| | | | | | | | | | | | Summary: CFI directives are generated for .S files. Reviewers: eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5520 llvm-svn: 219199
* Another required re-setting for MCStreamer::reset().Yaron Keren2014-09-171-0/+1
| | | | llvm-svn: 217970
* Add and update reset() and doInitialization() methods to MC* and passes.Yaron Keren2014-09-171-0/+1
| | | | | | This enables reusing a PassManager instead of re-constructing it every time. llvm-svn: 217948
* Don't allow MCStreamer::EmitIntValue to output 0-byte integers.Alexey Samsonov2014-08-201-1/+1
| | | | | | | | It makes no sense and can hide bugs. In particular, it lead to left shift by 64 bits, which is an undefined behavior, properly reported by UBSan. llvm-svn: 216134
* Make EmitAbsValue an static helper.Rafael Espindola2014-08-151-17/+0
| | | | llvm-svn: 215721
* Delete dead code. NFC.Rafael Espindola2014-08-151-6/+0
| | | | llvm-svn: 215720
* Make EmitDwarfSetLineAddr an static helper. NFC.Rafael Espindola2014-08-151-12/+0
| | | | llvm-svn: 215718
* Make BuildSymbolDiff an static helper.Rafael Espindola2014-08-151-13/+0
| | | | llvm-svn: 215717
* Make ForceExpAbs an static helper.Rafael Espindola2014-08-151-3/+4
| | | | llvm-svn: 215715
* MC: virtualise EmitWindowsUnwindTablesSaleem Abdulrasool2014-08-031-4/+0
| | | | | | | | | This makes EmitWindowsUnwindTables a virtual function and lowers the implementation of the function to the X86WinCOFFStreamer. This method is a target specific operation. This enables making the behaviour target dependent by isolating it entirely to the target specific streamer. llvm-svn: 214664
* MC: rename Win64EHFrameInfo to WinEH::FrameInfoSaleem Abdulrasool2014-08-031-18/+27
| | | | | | | | | | | | | | The frame information stored in this structure is driven by the requirements for Windows NT unwinding rather than Windows 64 specifically. As a result, this type can be shared across multiple architectures (ARM, AXP, MIPS, PPC, SH). Rename this class in preparation for adding support for supporting unwinding information for Windows on ARM. Take the opportunity to constify the members as everything except the ChainedParent is read-only. This required some adjustment to the label handling. llvm-svn: 214663
* MC: permit emitting a symbol value as section relativeSaleem Abdulrasool2014-07-191-2/+9
| | | | | | | | | | | This adds an optional parameter to the EmitSymbolValue method in MCStreamer to permit emitting a symbol value as a section relative value. This is to cover the use in MCDwarf which should not really know about how to emit a section relative value for a given target. This addresses post-review comments from Eric Christopher in SVN r213275. llvm-svn: 213463
* MC: make WinEH opcode an opaque valueSaleem Abdulrasool2014-07-171-10/+22
| | | | | | | | | | | This makes the opcode an opaque value (unsigned int) rather than the enumeration. This permits the use of target specific operands. Split out the generic type into a MCWinEH header and add a supporting MCWin64EH::Instruction to abstract out the selection of the opcode and construction of the actual instruction. llvm-svn: 213221
* MC: make DWARF and Windows unwinding handling more similarSaleem Abdulrasool2014-07-131-93/+89
| | | | | | | | Rename member variables and functions for the MCStreamer for DWARF-like unwinding management. Rename the Windows ones as well and make the naming and handling similar across the two. No functional change intended. llvm-svn: 212912
* MC: remove use of unnecessary variableSaleem Abdulrasool2014-07-121-41/+27
| | | | | | | | | Due to the fact that the windows unwinding has the concept of chained frames, we maintain a current frame info pointer that is adjusted on any push and pop of a unwinding context. This just removes an unnecessary variable that was used to mirror the DWARF unwinding code. llvm-svn: 212882
* MC: rename MCW64UnwindInfo to MCWinFrameInfoSaleem Abdulrasool2014-07-121-17/+17
| | | | | | | | This structure contains information related to the call frame used to generate unwinding information. Rename this to reflect the future use to represent the shared state between various architectures for WinCFI information. llvm-svn: 212881
* Fix .seh_stackalloc 0Reid Kleckner2014-07-011-0/+2
| | | | | | | | | | | | | seh_stackalloc 0 is not representable in Win64 SEH info, so emitting it is a bug. Reviewers: rnk Differential Revision: http://reviews.llvm.org/D4334 Patch by Vadim Chugunov! llvm-svn: 212081
* MC: rename EmitWin64EH routinesSaleem Abdulrasool2014-06-291-14/+14
| | | | | | | | | | | | | | | Rename the routines to reflect the reality that they are more related to call frame information than to Win64 EH. Although EH is implemented in an intertwined manner by augmenting with an exception handler and an associated parameter, the majority of these routines emit information required to unwind the frames. This also helps identify that these routines are generic for most windows platforms (they apply equally to nearly all architectures except x86) although the encoding of the information is architecture dependent. Unwinding data is emitted via EmitWinCFI* and exception handling information via EmitWinEH*. llvm-svn: 211994
* Merge the used symbol scanning of MCObjectStreamer and RecordStreamer.Rafael Espindola2014-06-251-1/+12
| | | | | | This completes the refactoring of RecordStreamer. llvm-svn: 211727
* Move expression visitation logic up to MCStreamer.Rafael Espindola2014-06-251-0/+29
| | | | | | Remove the duplicate from MCRecordStreamer. No functionality change. llvm-svn: 211714
* Re-apply r211399, "Generate native unwind info on Win64" with a fix to ↵NAKAMURA Takumi2014-06-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | ignore SEH pseudo ops in X86 JIT emitter. -- This patch enables LLVM to emit Win64-native unwind info rather than DWARF CFI. It handles all corner cases (I hope), including stack realignment. Because the unwind info is not flexible enough to describe stack frames with a gap of unknown size in the middle, such as the one caused by stack realignment, I modified register spilling code to place all spills into the fixed frame slots, so that they can be accessed relative to the frame pointer. Patch by Vadim Chugunov! Reviewed By: rnk Differential Revision: http://reviews.llvm.org/D4081 llvm-svn: 211691
* Fix another asserting method in the null streamer.Rafael Espindola2014-06-251-1/+0
| | | | llvm-svn: 211668
* Fix a regression from r211653.Rafael Espindola2014-06-251-1/+0
| | | | | | | The method was empty in the null streamer but I mistakenly replaced it with the aborting one in MCStreamer. llvm-svn: 211666
* Move some trivial methods up to MCStreamer.Rafael Espindola2014-06-251-0/+33
| | | | | | This saves some duplicated boilerplate in RecordStreamer and NullStreamer. llvm-svn: 211653
* Simplify the handling of .cfi_endproc.Rafael Espindola2014-06-251-11/+3
| | | | | | No functionality change. llvm-svn: 211651
* Print a=b as an assignment.Rafael Espindola2014-06-241-6/+0
| | | | | | | | | | | In assembly the expression a=b is parsed as an assignment, so it should be printed as one. This remove a truly horrible hack for producing a label with "a=.". It would be used by codegen but would never be reached by the asm parser. Sorry I missed this when it was first committed. llvm-svn: 211639
* Allow using .cfi_startproc without a leading symbol.Rafael Espindola2014-06-231-9/+1
| | | | | | This is possible now that we don't produce .eh symbols. This fixes pr19430. llvm-svn: 211502
* Revert r211399, "Generate native unwind info on Win64"NAKAMURA Takumi2014-06-221-2/+0
| | | | | | It broke Legacy JIT Tests on x86_64-{mingw32|msvc}, aka Windows x64. llvm-svn: 211480
* Generate native unwind info on Win64Reid Kleckner2014-06-201-0/+2
| | | | | | | | | | | | | | | | | | | | This patch enables LLVM to emit Win64-native unwind info rather than DWARF CFI. It handles all corner cases (I hope), including stack realignment. Because the unwind info is not flexible enough to describe stack frames with a gap of unknown size in the middle, such as the one caused by stack realignment, I modified register spilling code to place all spills into the fixed frame slots, so that they can be accessed relative to the frame pointer. Patch by Vadim Chugunov! Reviewed By: rnk Differential Revision: http://reviews.llvm.org/D4081 llvm-svn: 211399
* Move EH/Debug frame handling to the object streamer.Rafael Espindola2014-05-121-17/+1
| | | | | | | Now that the asm streamer doesn't use it, the MCStreamer doesn't need to know about it. llvm-svn: 208562
* Remove always true argument.Rafael Espindola2014-05-121-2/+2
| | | | llvm-svn: 208558
* Remove an always true argument.Rafael Espindola2014-05-121-3/+3
| | | | llvm-svn: 208557
* Make getOrCreateSymbolData non virtual.Rafael Espindola2014-04-271-5/+0
| | | | llvm-svn: 207367
* Fix the assembler to print a better relocatable expression errorKevin Enderby2014-04-221-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostic that includes location information. Currently if one has this assembly: .quad (0x1234 + (4 * SOME_VALUE)) where SOME_VALUE is undefined ones gets the less than useful error message with no location information: % clang -c x.s clang -cc1as: fatal error: error in backend: expected relocatable expression With this fix one now gets a more useful error message with location information: % clang -c x.s x.s:5:8: error: expected relocatable expression .quad (0x1234 + (4 * SOME_VALUE)) ^ To do this I plumbed the SMLoc through the MCObjectStreamer EmitValue() and EmitValueImpl() interfaces so it could be used when creating the MCFixup. rdar://12391022 llvm-svn: 206906
* [MC] Emit an error if cfi_startproc is used before a symbol is defined.Quentin Colombet2014-04-151-0/+4
| | | | | | | | | Currently, we bind those directives with the last symbol, so if none has been defined, this would lead to a crash of the compiler. <rdar://problem/15939159> llvm-svn: 206236
* [C++11] More 'nullptr' conversion or in some cases just using a boolean ↵Craig Topper2014-04-131-5/+5
| | | | | | check instead of comparing to nullptr. llvm-svn: 206129
* DebugInfo: Avoid creating unnecessary/empty line tables and remove the ↵David Blaikie2014-04-011-0/+10
| | | | | | | | | | | | special case of '0' in DwarfCompileUnit::initStmtList by just always using a label difference This moves one case of raw text checking down into the MCStreamer interfaces in the form of a virtual function, even if we ultimately end up consolidating on the one-or-many line tables issue one day, this is nicer in the interim. This just generally streamlines a bunch of use cases into a common code path. llvm-svn: 205287
* Don't use EmitAbsValue with symbol references.Rafael Espindola2014-03-201-2/+2
| | | | | | | | | | | | | | | The function exists to force an expression to be absolute, but there it is not possible to force a symbol reference since a = b .long a means something else. This is an alternative fix for pr9951 that uses an assert. It then deletes the old pr9951 test that was testing nothing already. llvm-svn: 204399
* Mark alias symbols as microMIPS if necessary. Differential Revision: ↵Zoran Jovanovic2014-03-201-1/+11
| | | | | | http://llvm-reviews.chandlerc.com/D3080 llvm-svn: 204323
* DebugInfo: Improve reuse of file table entries in asm debug infoDavid Blaikie2014-03-171-4/+4
| | | | | | | | | | | | | | | | | The previous deduping strategy was woefully inadequate - it only considered the most recent file used and avoided emitting a duplicate in that case - never considering the a/b/a scenario. It was also lacking when it came to directory paths as the previous filename would never match the current if the filename had been split into file and directory components. This change builds caching functionality into the line table at the lowest level in an optional form (a file number of 0 indicates that one should be chosen and returned) and will eventually be reused by the normal source level debugging DWARF emission. llvm-svn: 204027
* Always print the implicit .text at the start of an asm file.Rafael Espindola2014-03-051-1/+1
| | | | | | | | | | | | | | | | | Before llvm-mc would print it, but llc was assuming that it would produce another section changing directive before one was needed. That assumption is false with inline asm. Fixes PR19049. Another option would be to always create the section, but in the asm printer avoid printing sections changes during initialization. That would work, but * We do use the fact that llvm-mc prints it in testing. The tests can be changed if needed. * A quick poll on IRC suggest that most developers prefer the implicit .text to be printed. llvm-svn: 203001
* Always create a temporary symbol to use with the cfi frame.Rafael Espindola2014-02-071-9/+3
| | | | | | | This is a small simplification and a small step in fixing pr18743 since private functions on MachO should be using a 'l' prefix. llvm-svn: 200994
* Remove another hasRawTextSupport.Rafael Espindola2014-01-311-0/+6
| | | | | | | | | To remove this one simply move the end of file logic from the asm printer to the target mc streamer. This removes the last call to hasRawTextSupport from lib/Target. llvm-svn: 200590
* MC: Add support for .cfi_startproc simpleDavid Majnemer2014-01-271-1/+2
| | | | | | | | | | | | | This commit allows LLVM MC to process .cfi_startproc directives when they are followed by an additional `simple' identifier. This signals to elide the emission of target specific CFI instructions that would normally occur initially. This fixes PR16587. Differential Revision: http://llvm-reviews.chandlerc.com/D2624 llvm-svn: 200227
* Construct the MCStreamer before constructing the MCTargetStreamer.Rafael Espindola2014-01-261-5/+8
| | | | | | | | | | This has a few advantages: * Only targets that use a MCTargetStreamer have to worry about it. * There is never a MCTargetStreamer without a MCStreamer, so we can use a reference. * A MCTargetStreamer can talk to the MCStreamer in its constructor. llvm-svn: 200129
* Simplify the logic for deciding when to initialize the sections.Rafael Espindola2014-01-241-3/+2
| | | | llvm-svn: 199971
* Most streamers' InitSections just create a text section. Make that the defaultRafael Espindola2014-01-241-0/+5
| | | | llvm-svn: 199969
OpenPOWER on IntegriCloud