summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
* Don't declare all text sections at the start of the .sRafael Espindola2015-03-202-7/+51
| | | | | | | | | | | | | | | | | The code this patch removes was there to make sure the text sections went before the dwarf sections. That is necessary because MachO uses offsets relative to the start of the file, so adding a section can change relaxations. The dwarf sections were being printed at the start just to produce symbols pointing at the start of those sections. The underlying issue was fixed in r231898. The dwarf sections are now printed when they are about to be used, which is after we printed the text sections. To make sure we don't regress, the patch makes the MachO streamer assert if CodeGen puts anything unexpected after the DWARF sections. llvm-svn: 232842
* Split the object streamer callback in one per file format.Rafael Espindola2015-03-193-13/+2
| | | | | | | | | | | | | There are two main advantages to doing this * Targets that only need to handle one of the formats specially don't have to worry about the others. For example, x86 now only registers a constructor for the COFF streamer. * Changes to the arguments passed to one format constructor will not impact the other formats. llvm-svn: 232699
* Add a default implementation of createObjectStreamer.Rafael Espindola2015-03-181-0/+14
| | | | | | | This removes duplicated code from backends that don't need to do anything fancy. llvm-svn: 232658
* Add support for .ifnes psuedo-op.Sid Manning2015-03-181-10/+22
| | | | llvm-svn: 232636
* Remove many superfluous SmallString::str() calls.Yaron Keren2015-03-183-5/+5
| | | | | | | | | | | | | | | Now that SmallString is a first-class citizen, most SmallString::str() calls are not required. This patch removes a whole bunch of them, yet there are lots more. There are two use cases where str() is really needed: 1) To use one of StringRef member functions which is not available in SmallString. 2) To convert to std::string, as StringRef implicitly converts while SmallString do not. We may wish to change this, but it may introduce ambiguity. llvm-svn: 232622
* Centralize the handling of unique ids for temporary labels.Rafael Espindola2015-03-171-32/+31
| | | | | | | | | | | | | | | | Before this patch code wanting to create temporary labels for a given entity (function, cu, exception range, etc) had to keep its own counter to have stable symbol names. createTempSymbol would still add a suffix to make sure a new symbol was always returned, but it kept a single counter. Because of that, if we were to use just createTempSymbol("cu_begin"), the label could change from cu_begin42 to cu_begin43 because some other code started using temporary labels. Simplify this by just keeping one counter per prefix and removing the various specialized counters. llvm-svn: 232535
* Remove LookupSymbol(StringRef) and optimize LookupSymbol(Twine).Yaron Keren2015-03-171-7/+3
| | | | | | | | Same as MakeArgString in r232465, keep only LookupSymbol(Twine) while making sure it handles the StringRef like cases efficiently using twine::toStringRef. llvm-svn: 232517
* Teach Twine to support SmallString.Yaron Keren2015-03-171-9/+6
| | | | | | | | Enable removing .str() member calls for these frequent cases. http://reviews.llvm.org/D6372 llvm-svn: 232465
* Fix uses of reserved identifiers starting with an underscore followed by an ↵David Blaikie2015-03-166-28/+22
| | | | | | | | | 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
* Fix build failure on MSVC compilers.Gabor Horvath2015-03-161-3/+2
| | | | llvm-svn: 232368
* [llvm] Replacing asserts with static_asserts where appropriateGabor Horvath2015-03-161-1/+3
| | | | | | | | | | | | | | | | Summary: This patch consists of the suggestions of clang-tidy/misc-static-assert check. Reviewers: alexfh Reviewed By: alexfh Subscribers: xazax.hun, llvm-commits Differential Revision: http://reviews.llvm.org/D8343 llvm-svn: 232366
* [MCDwarf] Do not emit useless line table opcode.Frederic Riss2015-03-151-1/+1
| | | | | | | | | | | | | No need to emit a DW_LNS_advance_pc with a 0 increment. Found out while comparing dsymutil's and LLVM's line table encoding. Not a correctenss fix, just a small encoding size optimization. I'm not sure how to generate a sequence that triggers this, and moreover llvm-dwardump doesn't dump the line table program, thus the effort involved in creating a testcase for this trivial patch seemed out of proportion. llvm-svn: 232332
* Recommit r232027 with PR22883 fixed: Add infrastructure for support of ↵Daniel Sanders2015-03-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | multiple memory constraints. The operand flag word for ISD::INLINEASM nodes now contains a 15-bit memory constraint ID when the operand kind is Kind_Mem. This constraint ID is a numeric equivalent to the constraint code string and is converted with a target specific hook in TargetLowering. This patch maps all memory constraints to InlineAsm::Constraint_m so there is no functional change at this point. It just proves that using these previously unused bits in the encoding of the flag word doesn't break anything. The next patch will make each target preserve the current mapping of everything to Constraint_m for itself while changing the target independent implementation of the hook to return Constraint_Unknown appropriately. Each target will then be adapted in separate patches to use appropriate Constraint_* values. PR22883 was caused the matching operands copying the whole of the operand flags for the matched operand. This included the constraint id which needed to be replaced with the operand number. This has been fixed with a conversion function. Following on from this, matching operands also used the operand number as the constraint id. This has been fixed by looking up the matched operand and taking it from there. llvm-svn: 232165
* [NVPTXAsmPrinter] do not print .align on function headersJingyue Wu2015-03-121-0/+1
| | | | | | | | | | | | | | | | | | | Summary: PTX does not allow .align directives on function headers. Fixes PR21551. Test Plan: test/Codegen/NVPTX/function-align.ll Reviewers: eliben, jholewinski Reviewed By: eliben, jholewinski Subscribers: llvm-commits, eliben, jpienaar, jholewinski Differential Revision: http://reviews.llvm.org/D8274 llvm-svn: 232004
* Don't print labels that on ELF are never used.Rafael Espindola2015-03-111-16/+14
| | | | llvm-svn: 231904
* Print section start labels when first switching to the section.Rafael Espindola2015-03-111-0/+4
| | | | | | | This is less brittle and avoids polluting the start of the file with every debug section. llvm-svn: 231898
* Add missing section symbol to COFF's .debug_types.dwo.Rafael Espindola2015-03-101-1/+1
| | | | | | | | | Should bring the cygwin bots back. I added a triple to the test that was failing so that it would have failed on Linux. llvm-svn: 231882
* Create symbols marking the start of a section earlier.Rafael Espindola2015-03-103-77/+99
| | | | | | | | | This lets us pass the symbol to the constructor and avoid the mutable field. This also opens the way for outputting the symbol only when needed, instead of outputting them at the start of the file. llvm-svn: 231859
* Move a non-trivial virtual function out of line.Rafael Espindola2015-03-101-0/+11
| | | | llvm-svn: 231853
* clang-format code that is about to change.Rafael Espindola2015-03-102-283/+219
| | | | llvm-svn: 231848
* Simplify expressions involving boolean constants with clang-tidyDavid Blaikie2015-03-092-2/+2
| | | | | | | | Patch by Richard (legalize at xmission dot com). Differential Revision: http://reviews.llvm.org/D8154 llvm-svn: 231617
* Make constant arrays that are passed to functions as const.Benjamin Kramer2015-03-071-5/+4
| | | | | | | | In theory this allows the compiler to skip materializing the array on the stack. In practice clang often fails to do that, but that's a different story. NFC. llvm-svn: 231571
* Use the generic Lfunc_begin label on ppc.Rafael Espindola2015-03-051-0/+1
| | | | | | This removes yet another custom label to mark the start of a function. llvm-svn: 231390
* Replace llvm.frameallocate with llvm.frameescapeReid Kleckner2015-03-051-3/+4
| | | | | | | | | | Turns out it's pretty straightforward and simplifies the implementation. Reviewers: andrew.w.kaylor Differential Revision: http://reviews.llvm.org/D8051 llvm-svn: 231386
* Expand variables when evaluating absolute expressions.Rafael Espindola2015-03-041-1/+1
| | | | | | | This allows for variables to be used in .size. This matches gnu AS functionality. llvm-svn: 231295
* [MC][Target] Implement support for R_X86_64_SIZE{32,64}.Davide Italiano2015-03-041-0/+2
| | | | | | | Differential Revision: D7990 Reviewed by: rafael, majnemer llvm-svn: 231216
* Remove MCStreamer include which isn't used here. NFCPete Cooper2015-03-041-1/+0
| | | | llvm-svn: 231195
* This file should always have included MCAssembler and not MCStreamer. NFCPete Cooper2015-03-041-1/+1
| | | | llvm-svn: 231194
* Remove MCStreamer.h include from MCContext.h and explictly include it where ↵Pete Cooper2015-03-042-0/+2
| | | | | | necessary. NFC llvm-svn: 231193
* Remove useless .debug_macinfo section setup.Paul Robinson2015-03-021-12/+0
| | | | llvm-svn: 231001
* Make some non-constant static variables non-static or fully const.Benjamin Kramer2015-03-011-1/+1
| | | | | | Otherwise we have to emit thread-safe initialization for them. NFC. llvm-svn: 230894
* Centralize handling of the eh_begin and eh_end labels.Rafael Espindola2015-02-271-0/+6
| | | | | | | | | | This removes a bit of duplicated code and more importantly, remembers the labels so that they don't need to be looked up by name. This in turn allows for any name to be used and avoids a crash if the name we wanted was already taken. llvm-svn: 230772
* [MC] Use the non-EH register mapping in the debug_frame section.Frederic Riss2015-02-261-4/+20
| | | | | | | | | | | | | | | | | | | | On 32bits x86 Darwin, the register mappings for the eh_frane and debug_frame sections are different. Thus the same CFI instructions should result in different registers in the object file. The problem isn't target specific though, but it requires that the mappings for EH register numbers be different from the standard Dwarf one. The patch looks a bit clumsy. LLVM uses the EH mapping as canonical for everything frame related. Thus we need to do a double conversion EH -> LLVM -> Non-EH, when emitting the debug_frame section. Fixes PR22363. Differential Revision: http://reviews.llvm.org/D7593 llvm-svn: 230670
* Fix UTF8 chars to ASCII.NAKAMURA Takumi2015-02-251-1/+1
| | | | llvm-svn: 230479
* COFF: Add 'IMAGE_SCN_CNT_INITIALIZED_DATA' to all DWARF sectionsDavid Majnemer2015-02-221-0/+25
| | | | | | | The CodeView debug info section, .debug$S, also has this set. MinGW sets this bit for their DWARF sections as well. llvm-svn: 230156
* COFF: Consistently format the DWARF sectionsDavid Majnemer2015-02-221-45/+44
| | | | llvm-svn: 230155
* MC: Allow multiple comma-separated expressions on the .uleb128 directive.Benjamin Kramer2015-02-191-9/+15
| | | | | | | For compatiblity with GNU as. Binutils documents this as '.uleb128 expressions'. Subtle, isn't it? llvm-svn: 229911
* Reverting r229831 due to multiple ARM/PPC/MIPS build-bot failures.Michael Kuperstein2015-02-192-19/+13
| | | | llvm-svn: 229841
* Use std::bitset for SubtargetFeaturesMichael Kuperstein2015-02-192-13/+19
| | | | | | | | | | | Previously, subtarget features were a bitfield with the underlying type being uint64_t. Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset. No functional change. Differential Revision: http://reviews.llvm.org/D7065 llvm-svn: 229831
* Add r228980 back.Rafael Espindola2015-02-174-9/+34
| | | | | | | | | | Add support for having multiple sections with the same name and comdat. Using this in combination with -ffunction-sections allows LLVM to output a .o file with mulitple sections named .text. This saves space by avoiding long unique names of the form .text.<C++ mangled name>. llvm-svn: 229541
* Add r228889 back.Rafael Espindola2015-02-171-31/+26
| | | | | | | | | | Original message: Invert the section relocation map. It now points from rel section to section. Use it to set sh_info, avoiding a brittle name lookup. llvm-svn: 229539
* Add r228888 back.Rafael Espindola2015-02-171-7/+3
| | | | | | | | Original message: Use the existing SymbolTableIndex instead of doing a lookup. NFC. llvm-svn: 229538
* Add r228886 back now that r229530 fixed the issue lldb was hitting.Rafael Espindola2015-02-171-47/+45
| | | | | | | | | | Original message: Create the Seciton -> Rel Section map when it is first needed. NFC. Saves a walk over every section. llvm-svn: 229536
* Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for ↵Aaron Ballman2015-02-151-2/+2
| | | | | | requiring the macro. NFC; LLVM edition. llvm-svn: 229340
* Format: Modernize using variadic templates.Benjamin Kramer2015-02-151-3/+3
| | | | | | | | | | | Introduces a subset of C++14 integer sequences in STLExtras. This is just enough to support unpacking a std::tuple into the arguments of snprintf, we can add more of it when it's actually needed. Also removes an ancient macro hack that leaks a macro into the global namespace. Clean up users that made use of the convenient hack. llvm-svn: 229337
* Revert a series of commits starting at r228886 which is triggering someChandler Carruth2015-02-134-104/+90
| | | | | | | | | | | | | | | | regressions for LLDB on Linux. Rafael indicated on lldb-dev that we should just go ahead and revert these but that he wasn't at a computer. The patches backed out are as follows: r228980: Add support for having multiple sections with the name and ... r228889: Invert the section relocation map. r228888: Use the existing SymbolTableIndex intsead of doing a lookup. r228886: Create the Section -> Rel Section map when it is first needed. These patches look pretty nice to me, so hoping its not too hard to get them re-instated. =D llvm-svn: 229080
* Add support for having multiple sections with the same name and comdat.Rafael Espindola2015-02-124-9/+34
| | | | | | | | Using this in combination with -ffunction-sections allows LLVM to output a .o file with mulitple sections named .text. This saves space by avoiding long unique names of the form .text.<C++ mangled name>. llvm-svn: 228980
* Learn that __DATA,__objc_classrefs is not atomized via symbols.Rafael Espindola2015-02-121-0/+4
| | | | | | This should hopefully fix objc on AArch64. llvm-svn: 228976
* Invert the section relocation map.Rafael Espindola2015-02-111-31/+26
| | | | | | | It now points from rel section to section. Use it to set sh_info, avoiding a brittle name lookup. llvm-svn: 228889
* Use the existing SymbolTableIndex instead of doing a lookup. NFC.Rafael Espindola2015-02-111-7/+3
| | | | llvm-svn: 228888
OpenPOWER on IntegriCloud