summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/WinCOFFStreamer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename WinCOFFStreamer.cpp -> MCWinCOFFStreamer.cppSam Clegg2017-06-211-296/+0
| | | | | | | | | For consistency with other MC*Streamer.cpp files and the header file. Differential Revision: https://reviews.llvm.org/D34466 llvm-svn: 305952
* Move Object format code to lib/BinaryFormat.Zachary Turner2017-06-071-1/+1
| | | | | | | | | | | | This creates a new library called BinaryFormat that has all of the headers from llvm/Support containing structure and layout definitions for various types of binary formats like dwarf, coff, elf, etc as well as the code for identifying a file from its magic. Differential Revision: https://reviews.llvm.org/D33843 llvm-svn: 304864
* Sort the remaining #include lines in include/... and lib/....Chandler Carruth2017-06-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | I did this a long time ago with a janky python script, but now clang-format has built-in support for this. I fed clang-format every line with a #include and let it re-sort things according to the precise LLVM rules for include ordering baked into clang-format these days. I've reverted a number of files where the results of sorting includes isn't healthy. Either places where we have legacy code relying on particular include ordering (where possible, I'll fix these separately) or where we have particular formatting around #include lines that I didn't want to disturb in this patch. This patch is *entirely* mechanical. If you get merge conflicts or anything, just ignore the changes in this patch and run clang-format over your #include lines in the files. Sorry for any noise here, but it is important to keep these things stable. I was seeing an increasing number of patches with irrelevant re-ordering of #include lines because clang-format was used. This patch at least isolates that churn, makes it easy to skip when resolving conflicts, and gets us to a clean baseline (again). llvm-svn: 304787
* MC: De-duplicate the object streamer implementations of EmitFileDirective ↵Peter Collingbourne2017-03-031-4/+0
| | | | | | into MCObjectStreamer. NFCI. llvm-svn: 296912
* Move some error handling down to MCStreamer.Rafael Espindola2017-02-101-3/+2
| | | | | | | | | This makes sure we get the same redefinition rules regardless of who is printing (asm parser, codegen) and to what (asm, obj). This fixes an unintentional regression in r293936. llvm-svn: 294752
* [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-02-071-10/+12
| | | | | | minor fixes (NFC). llvm-svn: 294369
* Reapply "[CodeGen] Fix invalid DWARF info on Win64"Keno Fischer2017-01-021-3/+12
| | | | | | | This reapplies rL289013 (reverted in rL289014) with the fixes identified in D21731. Should hopefully pass the buildbots this time. llvm-svn: 290809
* Revert "[CodeGen] Fix invalid DWARF info on Win64"Keno Fischer2016-12-081-12/+3
| | | | | | Appears to break on build bots. Reverting pending investigation. llvm-svn: 289014
* [CodeGen] Fix invalid DWARF info on Win64Keno Fischer2016-12-081-3/+12
| | | | | | | | | | | | | | | The relocations for `DIEEntry::EmitValue` were wrong for Win64 (emitting FK_Data_4 instead of FK_SecRel_4). This corrects that oversight so that the DWARF data is correct in Win64 COFF files. Fixes PR15393. Patch by Jameson Nash <jameson@juliacomputing.com> based on a patch by David Majnemer. Differential Revision: https://reviews.llvm.org/D21731 llvm-svn: 289013
* [MC, COFF] Permit a variable to be redefinedDavid Majnemer2016-07-081-19/+11
| | | | | | | | | Our assertions in WinCOFFStreamer had unexpected side effects resulting in symbols getting unexpectedly marked as used. This fixes PR28462. llvm-svn: 274941
* [Object] Make .alt_entry directive parsing MachO specific.Lang Hames2016-04-111-1/+1
| | | | | | ELF and COFF will now treat .alt_entry like any other unrecognized directive. llvm-svn: 265975
* [Object] Report an error if .alt_entry is used with ELF or COFF.Lang Hames2016-04-081-0/+2
| | | | | | | I'm looking into a better way to do this long-term, but for now at least don't crash. llvm-svn: 265815
* Simplify MCFillFragment.Rafael Espindola2016-01-191-1/+1
| | | | | | | | | The value size was always 1 or 0, so we don't need to store it. In a no asserts build this takes the testcase of pr26208 from 11 to 10 seconds. llvm-svn: 258141
* [Assembler] Make fatal assembler errors non-fatalOliver Stannard2015-11-171-14/+21
| | | | | | | | | | | | | | Currently, if the assembler encounters an error after parsing (such as an out-of-range fixup), it reports this as a fatal error, and so stops after the first error. However, for most of these there is an obvious way to recover after emitting the error, such as emitting the fixup with a value of zero. This means that we can report on all of the errors in a file, not just the first one. MCContext::reportError records the fact that an error was encountered, so we won't actually emit an object file with the incorrect contents. Differential Revision: http://reviews.llvm.org/D14717 llvm-svn: 253328
* Fix pr24486.Rafael Espindola2015-10-051-2/+0
| | | | | | | | | | | | | | | | | | This extends the work done in r233995 so that now getFragment (in addition to getSection) also works for variable symbols. With that the existing logic to decide if a-b can be computed works even if a or b are variables. Given that, the expression evaluation can avoid expanding variables as aggressively and that in turn lets the relocation code see the original variable. In order for this to work with the asm streamer, there is now a dummy fragment per section. It is used to assign a section to a symbol when no other fragment exists. This patch is a joint work by Maxim Ostapenko andy myself. llvm-svn: 249303
* Disallow assigning symbol a null section.Rafael Espindola2015-10-031-2/+0
| | | | | | | They are constructed without one and they can't go back, so this was effectively dead code. llvm-svn: 249220
* Remove and forbid raw_svector_ostream::flush() calls.Yaron Keren2015-08-131-2/+0
| | | | | | | | | | After r244870 flush() will only compare two null pointers and return, doing nothing but wasting run time. The call is not required any more as the stream and its SmallString are always in sync. Thanks to David Blaikie for reviewing. llvm-svn: 244928
* Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko2015-06-231-1/+1
| | | | | | Apparently, the style needs to be agreed upon first. llvm-svn: 240390
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-191-1/+1
| | | | | | | | | | | | | The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
* [WinEH] Emit .safeseh directives for all 32-bit exception handlersReid Kleckner2015-06-101-2/+8
| | | | | | | | | | Use a "safeseh" string attribute to do this. You would think we chould just accumulate the set of personalities like we do on dwarf, but this fails to account for the LSDA-loading thunks we use for __CxxFrameHandler3. Each of those needs to make it into .sxdata as well. The string attribute seemed like the most straightforward approach. llvm-svn: 239448
* Move all of the MCSymbol COFF flags logic in to MCSymbolCOFF.Pete Cooper2015-06-081-5/+4
| | | | | | | | | All flags setting/getting is now done in the class with helper methods instead of users having to get the bits in the correct order. Reviewed by Rafael Espíndola. llvm-svn: 239314
* Add MCSymbolCOFF class and use it to get and set the COFF type field.Pete Cooper2015-06-081-2/+2
| | | | | | Reviewed by Rafael Espíndola. llvm-svn: 239312
* Create a MCSymbolELF.Rafael Espindola2015-06-021-4/+0
| | | | | | | | | This create a MCSymbolELF class and moves SymbolSize since only ELF needs a size expression. This reduces the size of MCSymbol from 56 to 48 bytes. llvm-svn: 238801
* [WinCOFF] Ignore .safeseh for non-x86 architecturesDavid Majnemer2015-06-011-0/+6
| | | | | | | We don't want to bother with creating .sxdata sections on Win64; all the relevant information is already in the .pdata section. llvm-svn: 238730
* [WinCOFF] Add support for the .safeseh directiveDavid Majnemer2015-05-301-0/+15
| | | | | | | | | .safeseh adds an entry to the .sxdata section to register all the appropriate functions which may handle an exception. This entry is not a relocation to the symbol but instead the symbol table index of the function. llvm-svn: 238641
* MC: Clean up MCExpr naming. NFC.Jim Grosbach2015-05-301-2/+2
| | | | llvm-svn: 238634
* Remove getData.Rafael Espindola2015-05-291-8/+5
| | | | | | This completes the mechanical part of merging MCSymbol and MCSymbolData. llvm-svn: 238617
* Remove the MCSymbolData typedef.Rafael Espindola2015-05-291-3/+3
| | | | | | The getData member function is next. llvm-svn: 238611
* Rename getOrCreateSymbolData to registerSymbol and return void.Rafael Espindola2015-05-291-5/+8
| | | | | | Another step in merging MCSymbol and MCSymbolData. llvm-svn: 238607
* Move Flags from MCSymbolData to MCSymbol.Rafael Espindola2015-05-291-5/+6
| | | | llvm-svn: 238598
* Move common symbol related information from MCSectionData to MCSymbol.Rafael Espindola2015-05-291-1/+1
| | | | llvm-svn: 238583
* Don't call utostr in Twine/raw_ostream contexts.Benjamin Kramer2015-05-281-3/+2
| | | | | | Creating temporary std::strings there is unnecessary. llvm-svn: 238412
* Replace getOrCreateSectionData with registerSection.Rafael Espindola2015-05-261-3/+3
| | | | | | There is now no SectionData to be created. llvm-svn: 238208
* Store a MCSection in MCFragment.Rafael Espindola2015-05-251-3/+3
| | | | | | Part of the work to merge MCSectionData into MCSection. llvm-svn: 238160
* Stop forwarding (get|set)Aligment from MCSectionData to MCSection.Rafael Espindola2015-05-211-2/+2
| | | | llvm-svn: 237956
* Move alignment from MCSectionData to MCSection.Rafael Espindola2015-05-211-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | This starts merging MCSection and MCSectionData. There are a few issues with the current split between MCSection and MCSectionData. * It optimizes the the not as important case. We want the production of .o files to be really fast, but the split puts the information used for .o emission in a separate data structure. * The ELF/COFF/MachO hierarchy is not represented in MCSectionData, leading to some ad-hoc ways to represent the various flags. * It makes it harder to remember where each item is. The attached patch starts merging the two by moving the alignment from MCSectionData to MCSection. Most of the patch is actually just dropping 'const', since MCSectionData is mutable, but MCSection was not. llvm-svn: 237936
* MC: Clean up method names in MCContext.Jim Grosbach2015-05-181-1/+1
| | | | | | | The naming was a mish-mash of old and new style. Update to be consistent with the new. NFC. llvm-svn: 237594
* MC: Update MCCodeEmitter naming. NFC.Jim Grosbach2015-05-151-1/+1
| | | | | | s/EncodeInstruction/encodeInstruction/ llvm-svn: 237469
* MC: Update MCFixup naming. NFC.Jim Grosbach2015-05-151-2/+2
| | | | | | s/MCFixup::Create/MCFixup::create/ llvm-svn: 237468
* Use raw_pwrite_stream in the object writer/streamer.Rafael Espindola2015-04-141-1/+1
| | | | | | The ELF object writer will take advantage of that in the next commit. llvm-svn: 234950
* Fix uses of reserved identifiers starting with an underscore followed by an ↵David Blaikie2015-03-161-2/+2
| | | | | | | | | uppercase letter This covers essentially all of llvm's headers and libs. One or two weird cases I wasn't sure were worth/appropriate to fix. llvm-svn: 232394
* [cleanup] Re-sort all the #include lines in LLVM usingChandler Carruth2015-01-141-1/+1
| | | | | | | | | | | utils/sort_includes.py. I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the InstrProf library that I've added. No functionality changed here, just mechanical cleanup of the include order. llvm-svn: 225974
* MC, COFF: Use relocations for function references inside the sectionDavid Majnemer2014-11-111-1/+1
| | | | | | | | | | | | | | | | | | Referencing one symbol from another in the same section does not generally require a relocation. However, the MS linker has a feature called /INCREMENTAL which enables incremental links. It achieves this by creating thunks to the actual function and redirecting all relocations to point to the thunk. This breaks down with the old scheme if you have a function which references, say, itself. On x86_64, we would use %rip relative addressing to reference the start of the function from out current position. This would lead to miscompiles because other references might reference the thunk instead, breaking function pointer equality. This fixes PR21520. llvm-svn: 221678
* Simplify handling of --noexecstack by using getNonexecutableStackSection.Rafael Espindola2014-10-151-1/+1
| | | | llvm-svn: 219799
* Fix COFF section index relocation should be 16 bits, not 32Timur Iskhodzhanov2014-10-081-1/+1
| | | | | | | Original patch by Andrey Guskov! http://reviews.llvm.org/D5651 llvm-svn: 219327
* COFF: Don't oversize COMMON symbols when targeting BFD ldDavid Majnemer2014-10-081-5/+4
| | | | | | | | | | | | | | COFF normally doesn't allow us to describe the alignment of COMMON symbols. It turns out that most linkers use the symbol size as a hint as to how aligned the symbol should be. However the BFD folks have added a .drectve command, which we now support as of r219229, that allows us to specify the alignment precisely. With this in mind, stop rounding sizes up. llvm-svn: 219281
* MC: add support for -aligncomm GNU extensionSaleem Abdulrasool2014-10-071-8/+18
| | | | | | | The GNU linker supports an -aligncomm directive that allows for power-of-2 alignment of common data. Add support to emit this directive. llvm-svn: 219229
* MC: Support aligned COMMON symbols for COFFDavid Majnemer2014-09-211-2/+15
| | | | | | | | | | | | | | | | | | | | | link.exe: Fuzz testing has shown that COMMON symbols with size > 32 will always have an alignment of at least 32 and all symbols with size < 32 will have an alignment of at least the largest power of 2 less than the size of the symbol. binutils: The BFD linker essentially work like the link.exe behavior but with alignment 4 instead of 32. The BFD linker also supports an extension to COFF which adds an -aligncomm argument to the .drectve section which permits specifying a precise alignment for a variable but MC currently doesn't support editing .drectve in this way. With all of this in mind, we decide to play a little trick: we can ensure that the alignment will be respected by bumping the size of the global to it's alignment. llvm-svn: 218201
* MC: cleanup includesSaleem Abdulrasool2014-08-091-1/+0
| | | | | | Cleanup Win64EH header inclusion. NFC. llvm-svn: 215288
* MC: rename EmitWin64EH routinesSaleem Abdulrasool2014-06-291-1/+1
| | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud