summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
* 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
* ARM64: remove -m32/-m64 mapping with ARM.Tim Northover2014-03-301-2/+2
| | | | | | | This is causing the ARM build-bots to fail since they only include the ARM backend and can't create an ARM64 target. llvm-svn: 205132
* Support: correct Windows normalisationSaleem Abdulrasool2014-03-301-2/+12
| | | | | | | | | | | | | If the environment is unknown and no object file is provided, then assume an "MSVC" environment, otherwise, set the environment to the object file format. In the case that we have a known environment but a non-native file format for Windows (COFF) which is used for MCJIT, then append the custom file format to the triple as an additional component. This fixes the MCJIT tests on Windows. llvm-svn: 205130
* Support: normalize the default triple on UnixSaleem Abdulrasool2014-03-301-1/+1
| | | | | | | | | | This will fix cross-compiling buildbots (e.g. cygwin). This is in the same vein as SVN r205070. Apply this to fix the cross-compiling scenario, even though the preferred solution is to update the build system to normalize the embedded triple rather than perform this at runtime every time. This is meant to tide us over until that approach is fleshed out and applied. llvm-svn: 205120
* ARM64: initial backend importTim Northover2014-03-292-10/+21
| | | | | | | | | | | | This adds a second implementation of the AArch64 architecture to LLVM, accessible in parallel via the "arm64" triple. The plan over the coming weeks & months is to merge the two into a single backend, during which time thorough code review should naturally occur. Everything will be easier with the target in-tree though, hence this commit. llvm-svn: 205090
* Windows: canonicalise the default windows tripleSaleem Abdulrasool2014-03-291-1/+1
| | | | | | | Canonicalise the default triple that is used on Windows. This should hopefully fix the MSVC buildbots. llvm-svn: 205070
* Add ARM big endian Target (armeb, thumbeb)Christian Pirker2014-03-281-1/+18
| | | | | | Reviewed at http://llvm-reviews.chandlerc.com/D3095 llvm-svn: 205007
* [Allocator Cleanup] Move generic pointer alignment helper out of anChandler Carruth2014-03-281-15/+3
| | | | | | | out-of-line private static method and into the collection of inline alignment helpers in MathExtras.h. llvm-svn: 204995
* [Allocator Cleanup] Make the growth of the "slab" size of theChandler Carruth2014-03-281-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | BumpPtrAllocator significantly less strange by making it a simple function of the number of slabs allocated rather than by making it a recurrance. I *think* the previous behavior was essentially that the size of the slabs would be doubled after the first 128 were allocated, and then doubled again each time 64 more were allocated, but only if every allocation packed perfectly into the slab size. If not, the wasted space wouldn't be counted toward increasing the size, but allocations over the size threshold *would*. And since the allocations over the size threshold might be much larger than the slab size, this could have somewhat surprising consequences where we rapidly grow the slab size. This currently requires adding state to the allocator to track the number of slabs currently allocated, but that isn't too bad. I'm planning further changes to the allocator that will make this state fall out even more naturally. It still doesn't fully decouple the growth rate from the allocations which are over the size threshold. That fix is coming later. This specific fix will allow making the entire thing into a more stateless device and lifting the parameters into template parameters rather than runtime parameters. llvm-svn: 204993
* Canonicalise Windows target triple spellingsSaleem Abdulrasool2014-03-271-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | Construct a uniform Windows target triple nomenclature which is congruent to the Linux counterpart. The old triples are normalised to the new canonical form. This cleans up the long-standing issue of odd naming for various Windows environments. There are four different environments on Windows: MSVC: The MS ABI, MSVCRT environment as defined by Microsoft GNU: The MinGW32/MinGW32-W64 environment which uses MSVCRT and auxiliary libraries Itanium: The MSVCRT environment + libc++ built with Itanium ABI Cygnus: The Cygwin environment which uses custom libraries for everything The following spellings are now written as: i686-pc-win32 => i686-pc-windows-msvc i686-pc-mingw32 => i686-pc-windows-gnu i686-pc-cygwin => i686-pc-windows-cygnus This should be sufficiently flexible to allow us to target other windows environments in the future as necessary. llvm-svn: 204977
* Disable Visual C++ warning 4722 about aborting a destructor,Yaron Keren2014-03-251-13/+0
| | | | | | it has no value for us. llvm-svn: 204704
* remove a bunch of unused private methodsNuno Lopes2014-03-231-39/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | found with a smarter version of -Wunused-member-function that I'm playwing with. Appologies in advance if I removed someone's WIP code. include/llvm/CodeGen/MachineSSAUpdater.h | 1 include/llvm/IR/DebugInfo.h | 3 lib/CodeGen/MachineSSAUpdater.cpp | 10 -- lib/CodeGen/PostRASchedulerList.cpp | 1 lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 10 -- lib/IR/DebugInfo.cpp | 12 -- lib/MC/MCAsmStreamer.cpp | 2 lib/Support/YAMLParser.cpp | 39 --------- lib/TableGen/TGParser.cpp | 16 --- lib/TableGen/TGParser.h | 1 lib/Target/AArch64/AArch64TargetTransformInfo.cpp | 9 -- lib/Target/ARM/ARMCodeEmitter.cpp | 12 -- lib/Target/ARM/ARMFastISel.cpp | 84 -------------------- lib/Target/Mips/MipsCodeEmitter.cpp | 11 -- lib/Target/Mips/MipsConstantIslandPass.cpp | 12 -- lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp | 21 ----- lib/Target/NVPTX/NVPTXISelDAGToDAG.h | 2 lib/Target/PowerPC/PPCFastISel.cpp | 1 lib/Transforms/Instrumentation/AddressSanitizer.cpp | 2 lib/Transforms/Instrumentation/BoundsChecking.cpp | 2 lib/Transforms/Instrumentation/MemorySanitizer.cpp | 1 lib/Transforms/Scalar/LoopIdiomRecognize.cpp | 8 - lib/Transforms/Scalar/SCCP.cpp | 1 utils/TableGen/CodeEmitterGen.cpp | 2 24 files changed, 2 insertions(+), 261 deletions(-) llvm-svn: 204560
* [Support] Follow up to r204426, for LockFileManager, make the given path ↵Argyrios Kyrtzidis2014-03-211-3/+6
| | | | | | absolute so relative paths are properly handled in both Windows and Unix. llvm-svn: 204520
* [Support] Make sure LockFileManager works correctly with relative paths.Argyrios Kyrtzidis2014-03-211-1/+3
| | | | llvm-svn: 204426
* [Support] Make sure sys::fs::remove can remove symbolic links and make sure ↵Argyrios Kyrtzidis2014-03-212-8/+5
| | | | | | LockFileManager can handle a symbolic link that points nowhere. llvm-svn: 204422
* Remove dead and incorrect code.Rafael Espindola2014-03-201-14/+1
| | | | | | is_symlink was always false since it was using stat instead of lstat. llvm-svn: 204361
* Support: add support to identify WinCOFF/ARM objectsSaleem Abdulrasool2014-03-131-0/+1
| | | | | | | Add the Windows COFF ARM object file magic. This enables the LLVM tools to interact with COFF object files for Windows on ARM. llvm-svn: 203761
* support: add a utility function to normalise path separatorsSaleem Abdulrasool2014-03-112-0/+18
| | | | | | | | Add a utility function to convert the Windows path separator to Unix style path separators. This is used by a subsequent change in clang to enable the use of Windows SDK headers on Linux. llvm-svn: 203611
* Cleanup the interface for creating soft or hard links.Rafael Espindola2014-03-113-33/+9
| | | | | | | | | | | | Before this patch the unix code for creating hardlinks was unused. The code for creating symbolic links was implemented in lib/Support/LockFileManager.cpp and the code for creating hard links in lib/Support/*/Path.inc. The only use we have for these is in LockFileManager.cpp and it can use both soft and hard links. Just have a create_link function that creates one or the other depending on the platform. llvm-svn: 203596
* [C++11] Remove 'virtual' keyword from methods marked with 'override' keyword.Craig Topper2014-03-105-22/+20
| | | | llvm-svn: 203442
* Fix inconsistent whitespace.Bob Wilson2014-03-091-1/+1
| | | | llvm-svn: 203423
* [C++11] Revert uses of lambdas with array_pod_sort.Benjamin Kramer2014-03-071-5/+6
| | | | | | Looks like GCC implements the lambda->function pointer conversion differently. llvm-svn: 203294
* [C++11] Convert sort predicates into lambdas.Benjamin Kramer2014-03-071-6/+5
| | | | | | No functionality change. llvm-svn: 203288
* [Support/LockFileManager] Re-apply r203137 and r203138 but use symbolic ↵Argyrios Kyrtzidis2014-03-061-24/+56
| | | | | | | | links only on unix. Reid Kleckner pointed out that we can't use symbolic links on Windows. llvm-svn: 203162
* Support: split object format out of environmentSaleem Abdulrasool2014-03-061-7/+45
| | | | | | | | | | | This is a preliminary setup change to support a renaming of Windows target triples. Split the object file format information out of the environment into a separate entity. Unfortunately, file format was previously treated as an environment with an unknown OS. This is most obvious in the ARM subtarget where the handling for macho on an arbitrary platform switches to AAPCS rather than APCS (as per Apple's needs). llvm-svn: 203160
* Revert create_symbolic_link and both depending changesReid Kleckner2014-03-063-64/+24
| | | | | | | | | | This reverts commits r203136, r203137, and r203138. This code doesn't build on Windows. Even on Vista+, Windows requires elevated privileges to create a symlink. Therefore we can't use symlinks in the compiler. We'll have to find another approach. llvm-svn: 203143
* [Support/LockFileManager] Make the LockFileManager more robust against races.Argyrios Kyrtzidis2014-03-061-17/+34
| | | | | | | | | | | There was a race where: - The LockFileManager tries to own the lock file and fails. - The other owner then releases and removes the lock file. - The LockFileManager tries to read the owner info from the lock file but fails now. In such a case have LockFileManager try to get ownership again, instead of error'ing out. llvm-svn: 203138
* [Support/LockFileManager] Use symbolic link for the lock file.Argyrios Kyrtzidis2014-03-061-13/+4
| | | | | | | | Hard links do not work on SMB network directories, and it causes us to fail to build clang module files if the module cache is in such a directory. rdar://15944959 llvm-svn: 203137
* [Support/FileSystem] Introduce llvm::sys::fs::create_symbolic_link().Argyrios Kyrtzidis2014-03-062-0/+32
| | | | llvm-svn: 203136
* Add <cstddef> for use of std::ptrdiff_t.Ahmed Charles2014-03-061-0/+1
| | | | llvm-svn: 203086
* Fix break by qualifying ptrdiff_t with std::.Ahmed Charles2014-03-061-2/+2
| | | | llvm-svn: 203084
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-069-28/+17
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. llvm-svn: 203083
* Fix an inconsistency in treatment of trailing / in path::const_iteratorBen Langmuir2014-03-051-8/+5
| | | | | | | | | When using a //net/ path, we were transforming the trailing / into a '.' when the path was just the root path and we were iterating backwards. Forwards iteration and other kinds of root path (C:\, /) were already correct. llvm-svn: 202999
* [C++11] Add overloads for externally used OwningPtr functions.Ahmed Charles2014-03-052-23/+81
| | | | | | | | This will allow external callers of these functions to switch over time rather than forcing a breaking change all a once. These particular functions were determined by building clang/lld/lldb. llvm-svn: 202959
* [C++11] Replace OwningPtr::take() with OwningPtr::release().Ahmed Charles2014-03-051-1/+1
| | | | llvm-svn: 202957
* Remove unnecessary variables.Ahmed Charles2014-03-051-2/+2
| | | | | | Found self-hosting clang-cl on windows. :) llvm-svn: 202935
* Remove dependence on std::function.Richard Smith2014-03-041-15/+6
| | | | llvm-svn: 202902
* Add support for arbitrary functors to CrashRecoveryContext.Richard Smith2014-03-041-6/+15
| | | | llvm-svn: 202895
* APFloat: Add a move ctor and operator=Benjamin Kramer2014-03-041-0/+18
| | | | llvm-svn: 202883
* [Modules] Move the ConstantRange class into the IR library. This isChandler Carruth2014-03-042-735/+0
| | | | | | | | | | a bit surprising, as the class is almost entirely abstracted away from any particular IR, however it encodes the comparsion predicates which mutate ranges as ICmp predicate codes. This is reasonable as they're used for both instructions and constants. Thus, it belongs in the IR library with instructions and constants. llvm-svn: 202838
* [C+11] Add 'override' keyword to methods in the support library.Craig Topper2014-03-041-1/+1
| | | | llvm-svn: 202791
* Revert "[C++11] Replace LLVM atomics with std::atomic."Benjamin Kramer2014-03-034-7/+8
| | | | | | | Breaks the MSVC build. DataStream.cpp(44): error C2552: 'llvm::Statistic::Value' : non-aggregates cannot be initialized with initializer list llvm-svn: 202731
* [C++11] Replace LLVM atomics with std::atomic.Benjamin Kramer2014-03-034-8/+7
| | | | | | | | | | | With C++11 we finally have a standardized way to specify atomic operations. Use them to replace the existing custom implemention. Sadly the translation is not entirely trivial as std::atomic allows more fine-grained control over the atomicity. I tried to preserve the old semantics as well as possible. Differential Revision: http://llvm-reviews.chandlerc.com/D2915 llvm-svn: 202730
* [C++11] Replace llvm::tie with std::tie.Benjamin Kramer2014-03-022-2/+2
| | | | | | The old implementation is no longer needed in C++11. llvm-svn: 202644
* [C++11] Replace LLVM_STATIC_ASSERT with static_assert, we now haveChandler Carruth2014-03-021-2/+2
| | | | | | access to it on all host toolchains. llvm-svn: 202642
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-026-20/+20
| | | | llvm-svn: 202621
* [C++11] Switch all uses of the llvm_move macro to use std::moveChandler Carruth2014-03-022-5/+5
| | | | | | directly, and remove the macro. llvm-svn: 202612
* Now that we have C++11, turn simple functors into lambdas and remove a ton ↵Benjamin Kramer2014-03-012-27/+12
| | | | | | | | of boilerplate. No intended functionality change. llvm-svn: 202588
OpenPOWER on IntegriCloud