summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* CodeView: extract the OMF Directory HeaderSaleem Abdulrasool2016-08-095-28/+79
| | | | | | | | | | | | The DebugDirectory contains a pointer to the CodeView info structure which is a derivative of the OMF debug directory. The structure has evolved a bit over time, and PDB 2.0 used a slightly different definition from PDB 7.0. Both of these are specific to CodeView and not COFF. Reflect this by moving the structure definitions into the DebugInfo/CodeView headers. Define a generic DebugInfo union type that can be used to pass around a reference to the DebugInfo irrespective of the versioning. NFC. llvm-svn: 278075
* [x86] split combineVSelectWithAllOnesOrZeros into a helper function; NFCISanjay Patel2016-08-091-47/+61
| | | | llvm-svn: 278074
* [WebAssembly] Fix CFI index to account for padding nullptr functionDerek Schuff2016-08-085-10/+12
| | | | | | | | | | | | | The WebAssembly linker now creates a dummy function at index 0 to prevent miscomparisons with the NULL pointer, see https://github.com/WebAssembly/binaryen/pull/658. Thanks to pcc for pointing out this problem! Patch by Dominic Chen Differential Revision: https://reviews.llvm.org/D23137 llvm-svn: 278073
* The first string table entry should be a null terminated space, not just null.Pete Cooper2016-08-082-2/+71
| | | | | | | This matches the behaviour of ld64 which initializes the string table with ' ' then '\0'. lld only had the '\0' and needed the ' '. llvm-svn: 278071
* Revert "Do not ignore SizeOfOptionalHeader in COFF header even if PE header ↵Rui Ueyama2016-08-081-2/+1
| | | | | | | | is not present." This reverts commit r278066 to unbreak buildbots. llvm-svn: 278070
* Revert r278065 while I investigate some build-bot breakage.Lang Hames2016-08-086-92/+2
| | | | llvm-svn: 278069
* Allow building both shared and static libraryPetr Hosek2016-08-083-24/+63
| | | | | | | | | This change allows building both shared and static version of libc++ in a single build, sharing object files between both versions. Differential Revision: https://reviews.llvm.org/D23232 llvm-svn: 278068
* Allow building both shared and static libraryPetr Hosek2016-08-082-16/+42
| | | | | | | | | This change allows building both shared and static version of libunwind in a single build, sharing object files between both versions. Differential Revision: https://reviews.llvm.org/D23233 llvm-svn: 278067
* Do not ignore SizeOfOptionalHeader in COFF header even if PE header is not ↵Rui Ueyama2016-08-081-1/+2
| | | | | | | | | | | | | | | | | | | present. Attribute SizeOfOptionalHeader is ignored if no PE header is present in the file. This attribute should be ignored according to standard, however there are uses of this field even though it should not be used. This change does not conform to PE/COFF standard, but there are several COFF files without PE header, where you had to add up SizeOfOptionalHeader in order to get proper section headers. Other tools and their own parsers do take this into account. Patch by Marek Milkovič! https://reviews.llvm.org/D22750 llvm-svn: 278066
* [RuntimeDyld][Orc][MCJIT] Add partial weak-symbol support to RuntimeDyld.Lang Hames2016-08-086-2/+92
| | | | | | | | | | | | | | | This patch causes RuntimeDyld to check for existing definitions when it encounters weak symbols. If a definition already exists then the new weak definition is discarded. All symbol lookups within a "logical dylib" should now agree on the address of any given weak symbol. This allows the JIT to better match the behavior of the static linker for C++ code. This support is only partial, as it does not allow strong definitions that occur after the first weak definition (in JIT symbol lookup order) to override the previous weak definitions. Support for this will be added in a future patch. llvm-svn: 278065
* Garbage collection is not around anymore, we can remove our support for it.Greg Clayton2016-08-081-17/+1
| | | | llvm-svn: 278064
* Fix more RegisterInfo initialization issues and quiet hundreds of warnings.Greg Clayton2016-08-0811-727/+727
| | | | llvm-svn: 278063
* [ScopDetection] Remove unused DetectionContexts during expansion.Michael Kruse2016-08-081-1/+6
| | | | | | | | | | | | | | The function expandRegion() frees Region* objects again when it determines that these are not valid SCoPs. However, the DetectionContext added to the DetectionContextMap still holds a reference. The validity is checked using the ValidRegions lookup table. When a new Region is added to that list, it might share the same address, such that the DetectionContext contains two Region* associations that are in ValidRegions, but that are unrelated and of which one has already been free. Also remove the DetectionContext when not a valid expansion. llvm-svn: 278062
* Fix printf warnings.Greg Clayton2016-08-081-2/+2
| | | | llvm-svn: 278061
* Fix RegisterInfo initializers to have all the required initializers after ↵Greg Clayton2016-08-088-229/+229
| | | | | | recent changes. This quiets a few hundred warnings on MacOSX. llvm-svn: 278060
* Do not depend on unwind when building standalonePetr Hosek2016-08-081-4/+3
| | | | | | | | | | When libcxxabi is being built standalone, unwind dependency is not available, so do not use it even when LLVM unwinder is being requested. Differential Revision: https://reviews.llvm.org/D23228 llvm-svn: 278058
* COFF: handle /debugtype optionSaleem Abdulrasool2016-08-083-1/+39
| | | | | | | | | | Add the support infrastructure for the /debugtype option which takes a comma delimited list of debug info to generate. The defaults are based on other options potentially (/driver or /profile). This sets up the infrastructure to allow us to emit RSDS records to get "build id" equivalents on COFF (similar to binutils). llvm-svn: 278056
* Revert "[X86] Support the "ms-hotpatch" attribute."Charles Davis2016-08-0812-168/+22
| | | | | | | | This reverts commit r278048. Something changed between the last time I built this--it takes awhile on my ridiculously slow and ancient computer--and now that broke this. llvm-svn: 278053
* Revert "[Attr] Add support for the `ms_hook_prologue` attribute."Charles Davis2016-08-087-74/+11
| | | | | | | This reverts commit r278050. It depends on r278048, which will be reverted. llvm-svn: 278052
* [Driver] Enable CFI for WebAssemblyDerek Schuff2016-08-081-1/+3
| | | | | | | | | | | Since CFI support has landed in the WebAssembly backend, enable it in the frontend driver. Patch by Dominic Chen Differential Revision: https://reviews.llvm.org/D23244 llvm-svn: 278051
* [Attr] Add support for the `ms_hook_prologue` attribute.Charles Davis2016-08-087-11/+74
| | | | | | | | | | | | | | | | | | | | | | | Summary: Based on a patch by Michael Mueller. This attribute specifies that a function can be hooked or patched. This mechanism was originally devised by Microsoft for hotpatching their binaries (which they're constantly updating to stay ahead of crackers, script kiddies, and other ne'er-do-wells on the Internet), but it's now commonly abused by Windows programs that want to hook API functions. It is for this reason that this attribute was added to GCC--hence the name, `ms_hook_prologue`. Depends on D19908. Reviewers: rnk, aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D19909 llvm-svn: 278050
* InstCombine: Remove a redundant #ifdef NDEBUG. NFCJustin Bogner2016-08-081-2/+0
| | | | | | The DEBUG() macro already does this. llvm-svn: 278049
* [X86] Support the "ms-hotpatch" attribute.Charles Davis2016-08-0812-22/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Based on two patches by Michael Mueller. This is a target attribute that causes a function marked with it to be emitted as "hotpatchable". This particular mechanism was originally devised by Microsoft for patching their binaries (which they are constantly updating to stay ahead of crackers, script kiddies, and other ne'er-do-wells on the Internet), but is now commonly abused by Windows programs to hook API functions. This mechanism is target-specific. For x86, a two-byte no-op instruction is emitted at the function's entry point; the entry point must be immediately preceded by 64 (32-bit) or 128 (64-bit) bytes of padding. This padding is where the patch code is written. The two byte no-op is then overwritten with a short jump into this code. The no-op is usually a `movl %edi, %edi` instruction; this is used as a magic value indicating that this is a hotpatchable function. Reviewers: majnemer, sanjoy, rnk Subscribers: dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D19908 llvm-svn: 278048
* Refactor getMipsEFlags.Rui Ueyama2016-08-085-198/+221
| | | | | | | | | | | | | | | | | Previously, we incrementally updated the reuslting flag as we check file flags, so it was not very clear who is updating what flags. This patch makes them pure functions -- that has no side effect and don't update arguments to improve readability. Now each function construct a patial result, and all resutls are then bitwise-OR'ed to construct the final result. This patch also creates a new file, Mips.cpp, to move all these MIPS functions to a separate file. Differential Revision: https://reviews.llvm.org/D23249 llvm-svn: 278042
* [MemorySSA] Fix windows build breakage caused by r278028 (take 2)Geoff Berry2016-08-081-0/+5
| | | | | r278028: [MemorySSA] Ensure address stability of MemorySSA object. llvm-svn: 278041
* [Hexagon] Add pattern for 64-bit mulhsKrzysztof Parzyszek2016-08-083-11/+56
| | | | llvm-svn: 278040
* [GPGPU] Support Values referenced from both isl expr and llvm instructionsTobias Grosser2016-08-082-0/+69
| | | | | | | | | | | When adding code that avoids to pass values used in isl expressions and LLVM instructions twice, we forgot to make single variable passed to the kernel available in the ValueMap that makes it usable for instructions that are not replaced with isl ast expressions. This change adds the variable that is passed to the kernel to the ValueMap to ensure it is available for such use cases as well. llvm-svn: 278039
* [LoopUnroll] Simplify loops created by unrolling.Michael Zolotukhin2016-08-081-0/+19
| | | | | | | | | | | | | | Summary: Currently loop-unrolling doesn't preserve loop-simplified form. This patch fixes it by resimplifying affected loops. Reviewers: chandlerc, sanjoy, hfinkel Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23148 llvm-svn: 278038
* RefreshCallGraph does not modify the SCC, adding "const" to make it clear (NFC)Mehdi Amini2016-08-081-3/+3
| | | | llvm-svn: 278037
* Fix linking of omp_foreign_thread_team_reuse test on FreeBSDDimitry Andric2016-08-081-1/+1
| | | | | | | | | | | | | | | | | | | | | Summary: On FreeBSD, linking the misc_bugs/omp_foreign_thread_team_reuse.c test case fails with: /usr/local/bin/ld: /tmp/omp_foreign_thread_team_reuse-c5e71b.o: undefined reference to symbol 'pthread_create@@FBSD_1.0' This is because the program is linked without `-lpthread`. Since the %libomp-compile-and-run macro does not allow that option to be added to the compile command line, split it up and add the required `-lpthread` between %libomp-compile and %libomp-run. Reviewers: jlpeyton, hfinkel, Hahnfeld Subscribers: Hahnfeld, emaste, openmp-commits Differential Revision: https://reviews.llvm.org/D23084 llvm-svn: 278036
* [MemorySSA] Fix windows build breakage caused by r278028Geoff Berry2016-08-082-5/+12
| | | | | r278028: [MemorySSA] Ensure address stability of MemorySSA object. llvm-svn: 278035
* Re-add SystemZ SNaN testElliot Colp2016-08-081-0/+15
| | | | | | | The floating-point bug affecting ninja-x64-msvc-RA-centos6 is fixed (r277813) so this test should now pass llvm-svn: 278034
* [BuildingAJIT] Fix a couple of typos in the Chapter 3 draft.Lang Hames2016-08-081-6/+6
| | | | llvm-svn: 278033
* CMakeLists.txt cleanups: synchronize version with rest of LLVM, consistent ↵Eugene Zelenko2016-08-081-7/+6
| | | | | | | | spacing. Differential revision: https://reviews.llvm.org/D23091 llvm-svn: 278032
* [X86] Improve code size on X86 segment movesNirav Dave2016-08-083-2/+50
| | | | | | | | | | | | | | Moves of a value to a segment register from a 16-bit register is equivalent to one from it's corresponding 32-bit register. Match gas's behavior and rewrite instructions to the shorter of equivalent forms. Reviewers: rnk, ab Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D23166 llvm-svn: 278031
* CMakeLists.txt cleanups: synchronize version with rest of LLVM, consistent ↵Eugene Zelenko2016-08-081-5/+4
| | | | | | | | spacing. Differential revision: https://reviews.llvm.org/D23092 llvm-svn: 278030
* CMakeLists.txt cleanups: synchronize version and CMake minimum required ↵Eugene Zelenko2016-08-081-22/+21
| | | | | | | | version with rest of LLVM, consistent spacing. Differential revision: https://reviews.llvm.org/D23094 llvm-svn: 278029
* [MemorySSA] Ensure address stability of MemorySSA object.Geoff Berry2016-08-082-20/+17
| | | | | | | | | | | | | | | | | Summary: Ensure that the MemorySSA object never changes address when using the new pass manager since the walkers contained by MemorySSA cache pointers to it at construction time. This is achieved by wrapping the MemorySSAAnalysis result in a unique_ptr. Also add some asserts that check for this bug. Reviewers: george.burgess.iv, dberlin Subscribers: mcrosier, hfinkel, chandlerc, silvas, llvm-commits Differential Revision: https://reviews.llvm.org/D23171 llvm-svn: 278028
* [esan] Add iterator to esan's generic hashtableDerek Bruening2016-08-082-3/+179
| | | | | | | | | | | | Summary: Adds simple iterator support to the esan hashtable. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D22682 llvm-svn: 278027
* [GPGPU] Create code to verify run-time conditionsTobias Grosser2016-08-082-1/+67
| | | | llvm-svn: 278026
* Fix compilation in 'asserts' modeTobias Grosser2016-08-081-1/+1
| | | | llvm-svn: 278025
* [esan] Add generic resizing hashtableDerek Bruening2016-08-082-0/+384
| | | | | | | | | | | | | | | | | | | | | | Summary: Adds a new, generic, resizing hashtable data structure for use by esan tools. No existing sanitizer hashtable is suitable for the use case for most esan tools: we need non-fixed-size tables, parameterized keys and payloads, and write access to payloads. The new hashtable uses either simple internal or external mutex locking and supports custom hash and comparision operators. The focus is on functionality, not performance, to catalyze creation of a variety of tools. We can optimize the more successful tools later. Adds tests of the data structure. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D22681 llvm-svn: 278024
* [clang-tidy] enhance modernize-use-bool-literals to check ternary operatorKirill Bobyrev2016-08-083-16/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | modernize-use-bool-literals doesn't checks operands in ternary operator. For example: ``` c++ static int Value = 1; bool foo() { bool Result = Value == 1 ? 1 : 0; return Result; } bool boo() { return Value == 1 ? 1 : 0; } ``` This issue was reported in bug 28854. The patch fixes it. Reviewers: alexfh, aaron.ballman, Prazek Subscribers: Prazek, Eugene.Zelenko Differential Revision: https://reviews.llvm.org/D23243 llvm-svn: 278022
* [StreamExecutor] Add DeviceMemory and kernel arg packingJason Henline2016-08-084-0/+668
| | | | | | | | | | | | | | Summary: Add types for device memory and add the code that knows how to pack these device memory types if they are passed as arguments to kernel launches. Reviewers: jlebar, tra Subscribers: parallel_libs-commits Differential Revision: https://reviews.llvm.org/D23211 llvm-svn: 278021
* [analyzer] Change -analyze-function to accept qualified names.Artem Dergachev2016-08-085-49/+121
| | | | | | | | | | | | | | | Both -analyze-function and -analyzer-display-progress now share the same convention for naming functions, which allows discriminating between methods with the same name in different classes, C++ overloads, and also presents Objective-C instance and class methods in the convenient notation. This also allows looking up the name for the particular function you're trying to restrict analysis to in the -analyzer-display-progress output, in case it was not instantly obvious. Differential Revision: https://reviews.llvm.org/D22856 llvm-svn: 278018
* [IslNodeBuilder] Move run-time check generation to NodeBuilder [NFC]Tobias Grosser2016-08-083-22/+32
| | | | | | | This improves the structure of the code and allows us to reuse the runtime code generation in the PPCGCodeGeneration. llvm-svn: 278017
* [ARM] Command-line options for embedded position-independent codeOliver Stannard2016-08-085-1/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (with the corresponding ARM backend patch) adds support for some new relocation models: * Read-only position independence (ROPI): Code and read-only data is accessed PC-relative. The offsets between all code and RO data sections are known at static link time. * Read-write position independence (RWPI): Read-write data is accessed relative to a static base register. The offsets between all writeable data sections are known at static link time. These two modes are independent (they specify how different objects should be addressed), so they can be used individually or together. These modes are intended for bare-metal systems or systems with small real-time operating systems. They are designed to avoid the need for a dynamic linker, the only initialisation required is setting the static base register to an appropriate value for RWPI code. There is one C construct not currently supported by these modes: global variables initialised to the address of another global variable or function, where that address is not known at static-link time. There are a few possible ways to solve this: * Disallow this, and require the user to write their own initialisation function if they need variables like this. * Emit dynamic initialisers for these variables in the compiler, called from the .init_array section (as is currently done for C++ dynamic initialisers). We have a patch to do this, described in my original RFC email (http://lists.llvm.org/pipermail/llvm-dev/2015-December/093022.html), but the feedback from that RFC thread was that this is not something that belongs in clang. * Use a small dynamic loader to fix up these variables, by adding the difference between the load and execution address of the relevant section. This would require linker co-operation to generate a table of addresses that need fixing up. Differential Revision: https://reviews.llvm.org/D23196 llvm-svn: 278016
* [ARM] Add support for embedded position-independent codeOliver Stannard2016-08-0816-21/+551
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for some new relocation models to the ARM backend: * Read-only position independence (ROPI): Code and read-only data is accessed PC-relative. The offsets between all code and RO data sections are known at static link time. This does not affect read-write data. * Read-write position independence (RWPI): Read-write data is accessed relative to the static base register (r9). The offsets between all writeable data sections are known at static link time. This does not affect read-only data. These two modes are independent (they specify how different objects should be addressed), so they can be used individually or together. They are otherwise the same as the "static" relocation model, and are not compatible with SysV-style PIC using a global offset table. These modes are normally used by bare-metal systems or systems with small real-time operating systems. They are designed to avoid the need for a dynamic linker, the only initialisation required is setting r9 to an appropriate value for RWPI code. I have only added support to SelectionDAG, not FastISel, because FastISel is currently disabled for bare-metal targets where these modes would be used. Differential Revision: https://reviews.llvm.org/D23195 llvm-svn: 278015
* [CodeGeneration] Do not set insert position redundantlyTobias Grosser2016-08-081-1/+0
| | | | | | | | There is no need to reset the position of the builder, as we can just continue to insert code at the current position of the IRBuilder, which happens to be precisely the location we reset the builder to. llvm-svn: 278014
* [IslNodeBuilder] Directly use the insert location of our BuilderTobias Grosser2016-08-081-1/+14
| | | | | | | | | ... instead of adding instructions at the end of the basic block the builder is currently at. This makes it easier to reason about where IR is generated, as with the IRBuilder there is just a single location that specificies where IR is generated. llvm-svn: 278013
OpenPOWER on IntegriCloud