summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAge
* [C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper2014-04-15
| | | | | | instead of comparing to nullptr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206252 91177308-0d34-0410-b5e6-96231b3b80d8
* [Allocator] Constrain the Deallocate templated overloads to only applyChandler Carruth2014-04-15
| | | | | | | | | | | to types which we can compute the size of. The comparison with zero isn't actually interesting here, it's mostly about putting sizeof into a sfinae context. This is particular important for Deallocate as otherwise the void* overload can quickly become ambiguous. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206251 91177308-0d34-0410-b5e6-96231b3b80d8
* Use unique_ptr to manage ownership of GCFunctionInfos in GCStrategyDavid Blaikie2014-04-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206249 91177308-0d34-0410-b5e6-96231b3b80d8
* Use unique_ptr for the result of Registry entries.David Blaikie2014-04-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206248 91177308-0d34-0410-b5e6-96231b3b80d8
* Use unique_ptr to manage ownership of GCStrategy objects in GCMetadataDavid Blaikie2014-04-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206246 91177308-0d34-0410-b5e6-96231b3b80d8
* Use unique_ptr to own MCFunctions within MCModule.David Blaikie2014-04-15
| | | | | | | | MCModule's ctor had to be moved out of line so the definition of MCFunction was available. (ctor requires the dtor of members (in case the ctor throws) which required access to the dtor of MCFunction) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206244 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper2014-04-15
| | | | | | instead of comparing to nullptr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206243 91177308-0d34-0410-b5e6-96231b3b80d8
* Use std::unique_ptr to manage MCBasicBlocks in MCFunction.David Blaikie2014-04-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206242 91177308-0d34-0410-b5e6-96231b3b80d8
* [MC] Require an MCContext when constructing an MCDisassembler.Lang Hames2014-04-15
| | | | | | | | | | | | | | | | | | This patch re-introduces the MCContext member that was removed from MCDisassembler in r206063, and requires that an MCContext be passed in at MCDisassembler construction time. (Previously the MCContext member had been initialized in an ad-hoc fashion after construction). The MCCContext member can be used by MCDisassembler sub-classes to construct constant or target-specific MCExprs. This patch updates disassemblers for in-tree targets, and provides the MCRegisterInfo instance that some disassemblers were using through the MCContext (previously those backends were constructing their own MCRegisterInfo instances). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206241 91177308-0d34-0410-b5e6-96231b3b80d8
* Add iterator_range for MachineInstr defs.Jim Grosbach2014-04-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206238 91177308-0d34-0410-b5e6-96231b3b80d8
* [Allocator] Add Deallocate support to the AllocatorBase CRTP class,Chandler Carruth2014-04-15
| | | | | | | | | | | | along with templated overloads much like we have for Allocate. These will facilitate switching the Deallocate interface of all the Allocator classes to accept the size by pre-filling it from the type size where we can do so. I plan to convert several uses to the template variants in subsequent patches prior to adding the Size parameter. No functionality changed, WIP. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206230 91177308-0d34-0410-b5e6-96231b3b80d8
* [Allocator] Hack around the fact that GCC can't compile theChandler Carruth2014-04-15
| | | | | | | static_assert added in r206225. I'm looking into a proper fix, but wanted the bots back. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206226 91177308-0d34-0410-b5e6-96231b3b80d8
* [Allocator] Factor the Allocate template overloads into a base classChandler Carruth2014-04-15
| | | | | | | | | | | | | | | | | | | | rather than defining them (differently!) in both allocators. This also serves as a basis for documenting and even enforcing some of the LLVM-style "allocator" concept methods which must exist with various signatures. I plan on extending and changing the signatures of these to further simplify our allocator model in subsequent commits, so I wanted to factor things as best as I could first. Notably, I'm working to add the 'Size' to the deallocation method of all allocators. This has several implications not the least of which are faster deallocation times on certain allocation libraries (tcmalloc). It also will allow the JIT allocator to fully model the existing allocation interfaces and allow sanitizer poisoning of deallocated regions. The list of advantages goes on. =] But by factoring things first I'll be able to make this easier by first introducing template helpers for the deallocation path. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206225 91177308-0d34-0410-b5e6-96231b3b80d8
* [cleanup] Run clang-format over most of YAMLParser.h to fix a bunch ofChandler Carruth2014-04-14
| | | | | | | | small formatting inconsistencies with the rest of LLVM and even this file. I looked at all the changes and they seemed like just better formatting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206209 91177308-0d34-0410-b5e6-96231b3b80d8
* [ARM64] Add big endian target arm64_be.James Molloy2014-04-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206197 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach llvm-lto to respect the given RelocModel.James Molloy2014-04-14
| | | | | | | | Patch by Nick Tomlinson! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206177 91177308-0d34-0410-b5e6-96231b3b80d8
* [Allocator] Hoist the external helper function into a namespace scopeChandler Carruth2014-04-14
| | | | | | | declaration. GCC 4.7 appears to get hopelessly confused by declaring this function within a member function of a class template. Go figure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206152 91177308-0d34-0410-b5e6-96231b3b80d8
* [cleanup] Normalize YAMLParser.h's doxygen markers with '\foo' insteadChandler Carruth2014-04-14
| | | | | | | of '@foo'. The slash variant is prefered in LLVM and the file was already using a mixture. =/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206151 91177308-0d34-0410-b5e6-96231b3b80d8
* [Allocator] Make the underlying allocator a template instead of anChandler Carruth2014-04-14
| | | | | | | | | | | | abstract interface. The only user of this functionality is the JIT memory manager and it is quite happy to have a custom type here. This removes a virtual function call and a lot of unnecessary abstraction from the common case where this is just a *very* thin vaneer around a call to malloc. Hopefully still no functionality changed here. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206149 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the compile from r206147 in release builds by moving a variableChandler Carruth2014-04-14
| | | | | | | declaration outside of #ifndef NDEBUG -- its used elsewhere. Sorry for the noise. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206148 91177308-0d34-0410-b5e6-96231b3b80d8
* [Allocator] Switch the BumpPtrAllocator to use a vector of pointers toChandler Carruth2014-04-14
| | | | | | | | | | | | | | | | | | | | | | | slabs rather than embedding a singly linked list in the slabs themselves. This has a few advantages: - Better utilization of the slab's memory by not wasting 16-bytes at the front. - Simpler allocation strategy by not having a struct packed at the front. - Avoids paging every allocated slab in just to traverse them for deallocating or dumping stats. The latter is the really nice part. Folks have complained from time to time bitterly that tearing down a BumpPtrAllocator, even if it doesn't run any destructors, pages in all of the memory allocated. Now it won't. =] Also resolves a FIXME with the scaling of the slab sizes. The scaling now disregards specially sized slabs for allocations larger than the threshold. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206147 91177308-0d34-0410-b5e6-96231b3b80d8
* Add back some typecasts I accidentally lost in r206142.Craig Topper2014-04-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206143 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper2014-04-14
| | | | | | instead of comparing to nullptr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206142 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] More 'nullptr' conversion or in some cases just using a boolean ↵Craig Topper2014-04-13
| | | | | | check instead of comparing to nullptr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206129 91177308-0d34-0410-b5e6-96231b3b80d8
* tools: teach objdump about FILE aux recordsSaleem Abdulrasool2014-04-13
| | | | | | | | | Add support for file auxiliary symbol entries in COFF symbol tables. A COFF symbol table with a FILE entry is followed by sizeof(__FILE__) / 18 auxiliary symbol records which contain the filename. Read them and form the original filename that the record contains. Then display the name in the output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206126 91177308-0d34-0410-b5e6-96231b3b80d8
* Retire llvm::array_endof in favor of non-member std::end.Benjamin Kramer2014-04-12
| | | | | | While there make array_lengthof constexpr if we have support for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206112 91177308-0d34-0410-b5e6-96231b3b80d8
* Move MDBuilder's methods out of line.Benjamin Kramer2014-04-12
| | | | | | | Making them inline was a historical accident, they're neither hot nor templated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206109 91177308-0d34-0410-b5e6-96231b3b80d8
* blockfreq: Rename BlockProbInfoT to BranchProbabilityInfoTDuncan P. N. Exon Smith2014-04-11
| | | | | | | | No functionality change. <rdar://problem/14292693> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206085 91177308-0d34-0410-b5e6-96231b3b80d8
* blockfreq: Remove unnecessary template parametersDuncan P. N. Exon Smith2014-04-11
| | | | | | | | | | | Moves redundant template parameters into an implementation detail of BlockFrequencyInfoImpl. No functionality change. <rdar://problem/14292693> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206084 91177308-0d34-0410-b5e6-96231b3b80d8
* blockfreq: Rename BlockFrequencyImpl to BlockFrequencyInfoImplDuncan P. N. Exon Smith2014-04-11
| | | | | | | | | | | | This is a shared implementation class for BlockFrequencyInfo and MachineBlockFrequencyInfo, not for BlockFrequency, a related (but distinct) class. No functionality change. <rdar://problem/14292693> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206083 91177308-0d34-0410-b5e6-96231b3b80d8
* Format fixes for r205990David Blaikie2014-04-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206078 91177308-0d34-0410-b5e6-96231b3b80d8
* Make doxygen comment match the declaration.Benjamin Kramer2014-04-11
| | | | | | Found by -Wdocumentation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206076 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove redundant symbolization support from MCDisassembler interface.Lang Hames2014-04-11
| | | | | | | | | | | | | | | | | | | MCDisassembler has an MCSymbolizer member that is meant to take care of symbolizing during disassembly, but it also has several methods that enable the disassembler to do symbolization internally (i.e. without an attached symbolizer object). There is no need for this duplication, but ARM64 had been making use of it. This patch moves the ARM64 symbolization logic out of ARM64Disassembler and into an ARM64ExternalSymbolizer class, and removes the duplicated MCSymbolizer functionality from the MCDisassembler interface. Symbolization will now be done exclusively through MCSymbolizers. There should be no impact on disassembly for any platform, but this allows us to tidy up the MCDisassembler interface and simplify the process of (and invariants related to) disassembler setup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206063 91177308-0d34-0410-b5e6-96231b3b80d8
* Move ExtractVectorElements to SelectionDAG.Matt Arsenault2014-04-11
| | | | | | | This seems generally useful, and makes sense to go along with SplitVector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206041 91177308-0d34-0410-b5e6-96231b3b80d8
* SelectionDAG: Factor ISD::MUL lowering code out of DAGTypeLegalizerTom Stellard2014-04-11
| | | | | | | | | | | This code has been moved to a new function in the TargetLowering class called expandMUL(). The purpose of this is to be able to share lowering code between the SelectionDAGLegalize and DAGTypeLegalizer classes. No functionality changed intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206036 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix use-after-free bug caught by address sanitizer:Diego Novillo2014-04-11
| | | | | | | | http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/2959 The location string is returned as a std::string, not a StringRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206032 91177308-0d34-0410-b5e6-96231b3b80d8
* [yaml2obj][ELF] ELF Relocations Support.Simon Atanasyan2014-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch implements support for both relocation record formats: Elf_Rel and Elf_Rela. It is possible to define relocation against symbol only. Relocations against sections will be implemented later. Now yaml2obj recognizes X86_64, MIPS and Hexagon relocation types. Example of relocation section specification: Sections: - Name: .text Type: SHT_PROGBITS Content: "0000000000000000" AddressAlign: 16 Flags: [SHF_ALLOC] - Name: .rel.text Type: SHT_REL Info: .text AddressAlign: 4 Relocations: - Offset: 0x1 Symbol: glob1 Type: R_MIPS_32 - Offset: 0x2 Symbol: glob2 Type: R_MIPS_CALL16 The patch reviewed by Michael Spencer, Sean Silva, Shankar Easwaran. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206017 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement depth_first and inverse_depth_first range factory functions.David Blaikie2014-04-11
| | | | | | | | | | | | | | Also updated as many loops as I could find using df_begin/idf_begin - strangely I found no uses of idf_begin. Is that just used out of tree? Also a few places couldn't use df_begin because either they used the member functions of the depth first iterators or had specific ordering constraints (I added a comment in the latter case). Based on a patch by Jim Grosbach. (Jim - you just had iterator_range<T> where you needed iterator_range<idf_iterator<T>>) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206016 91177308-0d34-0410-b5e6-96231b3b80d8
* Use value types instead of 'new'd objects to store dwarf labels for asm filesDavid Blaikie2014-04-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206009 91177308-0d34-0410-b5e6-96231b3b80d8
* SDNode: Add uses() iterator_range convenience methods.Jim Grosbach2014-04-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206005 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove lazy-initialization of section caches in MCContextDavid Blaikie2014-04-10
| | | | | | | | This seems to have been a cargo-culted habit from the very first such cache which didn't have any specific justification (but might've been a layering constraint at the time). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206003 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the segmented stack switch to a function attributeReid Kleckner2014-04-10
| | | | | | | | | This removes the -segmented-stacks command line flag in favor of a per-function "split-stack" attribute. Patch by Luqman Aden and Alex Crichton! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205997 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify make_range by using move semanticsDavid Blaikie2014-04-10
| | | | | | | | | Move the iterators into the range the same way the range's ctor moves them into the members. Also remove some redundant top level parens in the return statement. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205993 91177308-0d34-0410-b5e6-96231b3b80d8
* Reimplement debug info compression by compressing the whole section, rather ↵David Blaikie2014-04-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | than a fragment. To support compressing the debug_line section that contains multiple fragments (due, I believe, to variation in choices of line table encoding depending on the size of instruction ranges in the actual program code) we needed to support compressing multiple MCFragments in a single pass. This patch implements that behavior by mutating the post-relaxed and relocated section to be the compressed form of its former self, including renaming the section. This is a more flexible (and less invasive, to a degree) implementation that will allow for other features such as "use compression only if it's smaller than the uncompressed data". Compressing debug_frame would be a possible further extension to this work, but I've left it for now. The hurdle there is alignment sections - which might require going as far as to refactor MCAssembler.cpp:writeFragment to handle writing to a byte buffer or an MCObjectWriter (there's already a virtual call there, so it shouldn't add substantial compile-time cost) which could in turn involve refactoring MCAsmBackend::writeNopData to use that same abstraction... which involves touching all the backends. This would remove the limited handling of fragment writing seen in ELFObjectWriter.cpp:getUncompressedData which would be nice - but it's more invasive. I did discover that I (perhaps obviously) don't need to handle relocations when I rewrite the fragments - since the relocations have already been applied and computed (and stored into ELFObjectWriter::Relocations) by this stage (necessarily, because we need to have written any immediate values or assembly-time relocations into the data already before we compress it, which we have). The test case doesn't necessarily cover that in detail - I can add more test coverage if that's preferred. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205990 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert debug info compression support.David Blaikie2014-04-10
| | | | | | | | | | To support compression for debug_line and debug_frame a different approach is required. To simplify review, revert the old implementation and XFAIL the test case. New implementation to follow shortly. Reverts r205059 and r204958. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205989 91177308-0d34-0410-b5e6-96231b3b80d8
* iterator_range: Add an llvm::make_range() helper method.Jim Grosbach2014-04-10
| | | | | | | | Convenience wrapper to make dealing with sub-ranges easier. Like the iterator_range<> itself, if/when this sort of thing gets standards blessing, it will be replaced by the official version. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205987 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Follow-up to r205973: change the return type to const MDNode*."Adrian Prantl2014-04-10
| | | | | | | | This reverts commit r205974, it turns out that this wasn't such a great idea after all. Using DIVariable as return value is self-documenting and marginally more type safe. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205979 91177308-0d34-0410-b5e6-96231b3b80d8
* Follow-up to r205973: change the return type to const MDNode*.Adrian Prantl2014-04-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205974 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug info: Factor the retrieving of the DIVariable from a MachineInstrAdrian Prantl2014-04-10
| | | | | | into a function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205973 91177308-0d34-0410-b5e6-96231b3b80d8
* SaveAndRestore: fix coding style and Doxygenify commentsDmitri Gribenko2014-04-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205959 91177308-0d34-0410-b5e6-96231b3b80d8