summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
* Extend sys::getHostCPUFeatures to work on AArch64 platformsBradley Smith2014-05-221-1/+37
| | | | llvm-svn: 209420
* Clean up language and grammar.Eric Christopher2014-05-202-2/+2
| | | | | | | Based on a patch by jfcaron3@gmail.com! PR19806 llvm-svn: 209216
* MemoryBuffer: Use GetNativeSystemInfo()Alp Toker2014-05-192-17/+6
| | | | | | | Removes old 4096 byte workaround. This functionality has been available since Windows XP. llvm-svn: 209137
* Remove last uses of OwningPtr from llvm. As far as I can tell these method ↵Craig Topper2014-05-182-63/+0
| | | | | | versions are not used by lldb, lld, or clang. llvm-svn: 209103
* Fix hardcoded slash to native path seperator which was exposed from ↵Yaron Keren2014-05-162-1/+8
| | | | | | | | llvm::sys::path. http://reviews.llvm.org/D3687 llvm-svn: 208980
* MemoryBuffer: don't force mmap when stat failsAlp Toker2014-05-091-3/+2
| | | | | | | Fix error handling introduced in r127426 that could result in MemoryBuffers not having null termination. llvm-svn: 208396
* MemoryBuffer: remove unusued definitionsAlp Toker2014-05-091-8/+0
| | | | | | These were made redundant back in r186560. llvm-svn: 208395
* [Support/MemoryBuffer] Remove the assertion that the file size did not shrink.Argyrios Kyrtzidis2014-05-061-3/+0
| | | | | | This can happen in practice with the user changing files and we can recover from it. llvm-svn: 208143
* Re-commit r208025, reverted in r208030, with a fix for a conformance issueRichard Smith2014-05-061-7/+6
| | | | | | which GCC detects and Clang does not! llvm-svn: 208033
* Revert r208025, which made buildbots unhappy for unknown reasons.Richard Smith2014-05-061-6/+7
| | | | llvm-svn: 208030
* [Support/MemoryBuffer] Rename IsVolatile -> IsVolatileSize and add a comment ↵Argyrios Kyrtzidis2014-05-061-22/+23
| | | | | | about the use case for the new parameter. llvm-svn: 208026
* Add llvm::function_ref (and a couple of uses of it), representing a ↵Richard Smith2014-05-061-7/+6
| | | | | | type-erased reference to a callable object. llvm-svn: 208025
* Include intrin.h before windows.h as a workaround for the x64 self-hostReid Kleckner2014-05-061-0/+1
| | | | | | | | | On x64, windows.h doesn't include intrin.h for intrinsics. It just declares them in the global namespace and uses them, expecting the compiler to lower it as a builtin. We basically need to do this in clang, eventually. llvm-svn: 208023
* [Support/MemoryBuffer] Move the IsVolatile check inside shouldUseMmap() and ↵Argyrios Kyrtzidis2014-05-061-7/+13
| | | | | | | | make sure to zero-initialize the rest of the buffer if we unexpectedly reach end-of-file while reading. llvm-svn: 208021
* [Support/MemoryBuffer] Introduce a boolean parameter (false by default) ↵Argyrios Kyrtzidis2014-05-051-18/+32
| | | | | | | | 'IsVolatile' for the open file functions. This provides a hint that the file may be changing often so mmap is avoided. llvm-svn: 208007
* Select bdver2 instead of bdver1 if TBM support is present on models < 0x10.Kaelyn Takata2014-05-051-1/+2
| | | | | | | | | | Tested that the right -target-cpu is set in the clang -cc1 command line when running "clang -march=native -E -v - </dev/null" on both an FX-8150 and an FX-8350. Both are family 15h; the FX-8150 (Bulldozer processor) reports a model number of 1, and the FX-8350 (Piledriver processor) reports a model number of 2. llvm-svn: 207973
* Add a description for AMD's bdver4 (aka Excavator).Benjamin Kramer2014-05-021-0/+2
| | | | | | This is just bdver3 + AVX2 + BMI2. llvm-svn: 207847
* raw_ostream: Forward declare OpenFlags and include FileSystem.h only where ↵Benjamin Kramer2014-04-291-0/+1
| | | | | | necessary. llvm-svn: 207593
* BranchProb: Simplify printing codeDuncan P. N. Exon Smith2014-04-291-10/+4
| | | | llvm-svn: 207559
* blockfreq: Defer to BranchProbability::scale() (again)Duncan P. N. Exon Smith2014-04-291-93/+2
| | | | | | | | | | | | Change `BlockFrequency` to defer to `BranchProbability::scale()` and `BranchProbability::scaleByInverse()`. This removes `BlockFrequency::scale()` from its API (and drops the ability to see the remainder), but the only user was the unit tests. If some code in the future needs an API that exposes the remainder, we can add something to `BranchProbability`, but I find that unlikely. llvm-svn: 207550
* Support: remove unnecessary namespaceDuncan P. N. Exon Smith2014-04-291-5/+1
| | | | llvm-svn: 207545
* Support: Add BranchProbability::scale() and ::scaleByInverse()Duncan P. N. Exon Smith2014-04-291-0/+47
| | | | | | | Add API to `BranchProbability` for scaling big integers. Next job is to rip the logic out of `BlockMass` and `BlockFrequency`. llvm-svn: 207544
* [C++] Use 'nullptr'.Craig Topper2014-04-286-46/+47
| | | | llvm-svn: 207394
* Use raw_ostream and Format.h on Windows so that we don't have to rollChandler Carruth2014-04-281-5/+10
| | | | | | our own portability system to cope without snprintf. llvm-svn: 207389
* Update the Windows TimeValue formatting to match the new formatting onChandler Carruth2014-04-281-9/+5
| | | | | | Unix-like OSes. llvm-svn: 207388
* Teach the pass manager's execution dump to print the current time beforeChandler Carruth2014-04-271-3/+5
| | | | | | | | | | | | | | | each line. This is particularly nice for tracking which run of a particular pass over a particular function was slow. This also required making the TimeValue string much more useful. First, there is a standard format for writing out a date and time. Let's use that rather than strings that would have to be parsed. Second, actually output the nanosecond resolution that timevalue claims to have. This is proving useful working on PR19499, so I figured it would be generally useful to commit. llvm-svn: 207385
* cl::ParseCommandLineOptions(): Use StringRef to receive ↵NAKAMURA Takumi2014-04-231-1/+1
| | | | | | sys::path::filename() instead of std::string. llvm-svn: 206990
* [Modules] Fix potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-222-2/+4
| | | | | | definition below all of the header #include lines, lib/Support edition. llvm-svn: 206847
* [Modules] Followup to r206822 to add a DEBUG_TYPE which is used on ARMChandler Carruth2014-04-211-0/+2
| | | | | | and PPC, but not x86. llvm-svn: 206830
* [Modules] Make Support/Debug.h modular. This requires it to not changeChandler Carruth2014-04-212-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | behavior based on other files defining DEBUG_TYPE, which means it cannot define DEBUG_TYPE at all. This is actually better IMO as it forces folks to define relevant DEBUG_TYPEs for their files. However, it requires all files that currently use DEBUG(...) to define a DEBUG_TYPE if they don't already. I've updated all such files in LLVM and will do the same for other upstream projects. This still leaves one important change in how LLVM uses the DEBUG_TYPE macro going forward: we need to only define the macro *after* header files have been #include-ed. Previously, this wasn't possible because Debug.h required the macro to be pre-defined. This commit removes that. By defining DEBUG_TYPE after the includes two things are fixed: - Header files that need to provide a DEBUG_TYPE for some inline code can do so by defining the macro before their inline code and undef-ing it afterward so the macro does not escape. - We no longer have rampant ODR violations due to including headers with different DEBUG_TYPE definitions. This may be mostly an academic violation today, but with modules these types of violations are easy to check for and potentially very relevant. Where necessary to suppor headers with DEBUG_TYPE, I have moved the definitions below the includes in this commit. I plan to move the rest of the DEBUG_TYPE macros in LLVM in subsequent commits; this one is big enough. The comments in Debug.h, which were hilariously out of date already, have been updated to reflect the recommended practice going forward. llvm-svn: 206822
* ManagedStatic is never built with a null constructor, remove support for it.David Blaikie2014-04-171-2/+3
| | | | llvm-svn: 206492
* [C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper2014-04-159-25/+25
| | | | | | instead of comparing to nullptr. llvm-svn: 206252
* [ARM64] Add big endian target arm64_be.James Molloy2014-04-141-1/+9
| | | | llvm-svn: 206197
* [Allocator] Hoist the external helper function into a namespace scopeChandler Carruth2014-04-141-0/+4
| | | | | | | declaration. GCC 4.7 appears to get hopelessly confused by declaring this function within a member function of a class template. Go figure. llvm-svn: 206152
* [Allocator] Make the underlying allocator a template instead of anChandler Carruth2014-04-141-12/+0
| | | | | | | | | | | | 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. =] llvm-svn: 206149
* [Allocator] Switch the BumpPtrAllocator to use a vector of pointers toChandler Carruth2014-04-141-22/+5
| | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 206147
* Retire llvm::array_endof in favor of non-member std::end.Benjamin Kramer2014-04-121-2/+2
| | | | | | While there make array_lengthof constexpr if we have support for it. llvm-svn: 206112
* YAMLIO: Allow scalars to dictate quotation rulesDavid Majnemer2014-04-101-10/+4
| | | | | | | Introduce ScalarTraits::mustQuote which determines whether or not a StringRef needs quoting before it is acceptable to output. llvm-svn: 205955
* Use range-based for loops. No functionality change.Simon Atanasyan2014-04-101-25/+16
| | | | llvm-svn: 205953
* Revert "Revert "YAMLIO: Encode ambiguous hex strings explicitly""David Majnemer2014-04-091-1/+2
| | | | | | | | | Don't quote octal compatible strings if they are only two wide, they aren't ambiguous. This reverts commit r205857 which reverted r205857. llvm-svn: 205914
* Revert "YAMLIO: Encode ambiguous hex strings explicitly"Filipe Cabecinhas2014-04-091-4/+1
| | | | | | | | This reverts commit r205839. It broke several tests in lld. llvm-svn: 205857
* YAMLIO: Encode ambiguous hex strings explicitlyDavid Majnemer2014-04-091-1/+4
| | | | | | | | | | YAMLIO would turn a BinaryRef into the string 0000000004000000. However, the leading zero causes parsers to interpret it as being an octal number instead of a hexadecimal one. Instead, escape such strings as needed. llvm-svn: 205839
* [C++11] Replace some comparisons with 'nullptr' with simple boolean checks ↵Craig Topper2014-04-0911-33/+31
| | | | | | to reduce verbosity. llvm-svn: 205829
* [C++11] Make use of 'nullptr' in the Support library.Craig Topper2014-04-0736-182/+184
| | | | llvm-svn: 205697
* [Support] Modify LockFileManager::waitForUnlock() to return info about how ↵Argyrios Kyrtzidis2014-04-061-6/+10
| | | | | | the lock was released. llvm-svn: 205683
* Simplify compression API by compressing into a SmallVector rather than a ↵David Blaikie2014-04-051-12/+6
| | | | | | | | MemoryBuffer This is the other half of r205676. llvm-svn: 205677
* Simplify compression API by decompressing into a SmallVector rather than a ↵David Blaikie2014-04-051-11/+6
| | | | | | | | | | | | MemoryBuffer This avoids an extra copy during decompression and avoids the use of MemoryBuffer which is a weirdly esoteric device that includes unrelated concepts like "file name" (its rather generic name is a bit misleading). Similar refactoring of zlib::compress coming up. llvm-svn: 205676
* Support: generalise object type handling for WindowsSaleem Abdulrasool2014-03-311-7/+15
| | | | | | | | | This generalises the object file type parsing to all Windows environments. This is used by cygwin as well as MSVC environments for MCJIT. This also makes the triple more similar to Chandler's suggestion of a separate field for the object file format. llvm-svn: 205219
* [Allocator] Lift the slab size and size threshold into templateChandler Carruth2014-03-301-131/+16
| | | | | | | | | | parameters rather than runtime parameters. There is only one user of these parameters and they are compile time for that user. Making these compile time seems to better reflect their intended usage as well. llvm-svn: 205143
* Don't mark the declarations of the TSan annotation functions as weak.Chandler Carruth2014-03-301-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | That causes references to them to be weak references which can collapse to null if no definition is provided. We call these functions unconditionally, so a definition *must* be provided. Make the definitions provided in the .cpp file weak by re-declaring them as weak just prior to defining them. This should keep compilers which cannot attach the weak attribute to the definition happy while actually resolving the symbols correctly during the link. You might ask yourself upon reading this commit log: how did *any* of this work before? Well, fun story. It turns out we have some code in Support (BumpPtrAllocator) which both uses virtual dispatch and has out-of-line vtables used by that virtual dispatch. If you move the virtual dispatch into its header in *just* the right way, the optimizer gets to devirtualize, and remove all references to the vtable. Then the sad part: the references to this one vtable were the only strong symbol uses in the support library for llvm-tblgen AFAICT. At least, after doing something just like this, these symbols stopped getting their weak definition and random calls to them would segfault instead. Yay software. llvm-svn: 205137
OpenPOWER on IntegriCloud