summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [docs] fix the build by including ScudoHardenedAllocator into toc; mention ↵Kostya Serebryany2016-06-072-2/+7
| | | | | | SourceBasedCodeCoverage.html in libFuzzer docs llvm-svn: 272070
* Fix a memory leak in InstructionLLVMC where it held onto a strong reference ↵Greg Clayton2016-06-074-300/+394
| | | | | | | | | | | | | | | | | | | | | to the DisassemblerLLVMC which in turn had a vector of InstructionSP causing the strong cycle. This is fixed now. Rules are as follows for internal code using lldb::DisassemblerSP and lldb::InstructionSP: 1 - The disassembler needs to stay around as long as instructions do as the Instruction subclass now has a weak pointer to the disassembler 2 - The public API has been fixed so that if you get a SBInstruction, it will hold onto a strong reference to the disassembler in a new InstructionImpl class This will keep code like like: inst = lldb.target.ReadInstructions(frame.GetPCAddress(), 1).GetInstructionAtIndex(0) inst.GetMnemonic() Working as expected (not the SBInstructionList() that was returned by SBTarget.ReadInstructions() is gone, but "inst" has a strong reference inside of it to the disassembler and the instruction. All code inside the LLDB shared library was verified to correctly hold onto the disassembler instance in all places. <rdar://problem/24585496> llvm-svn: 272069
* Retry^4 "[llvm-profdata] Add option to ingest filepaths from a file"Vedant Kumar2016-06-073-6/+85
| | | | | | | | | | Changes since the initial commit: - Use echo instead of printf. This should side-step the character escaping issues on Windows. Differential Revision: http://reviews.llvm.org/D20980 llvm-svn: 272068
* [docs] Coverage: Explain how to avoid static initializersVedant Kumar2016-06-071-0/+16
| | | | llvm-svn: 272067
* [lit] Ignore errors when decoding redirected output.Daniel Dunbar2016-06-071-1/+1
| | | | llvm-svn: 272066
* Use FileCheck instead of grepping for patterns. NFC.Easwaran Raman2016-06-073-10/+11
| | | | llvm-svn: 272065
* [CFLAA] Kill dead code/fix comments in StratifiedSets.George Burgess IV2016-06-071-87/+23
| | | | | | | | Also use default/delete instead of hand-written ctors. Thanks to Jia Chen for bringing this stuff up. llvm-svn: 272064
* AMDGPU: Add amdgpu-ps-wqm-outputs function attributesNicolai Haehnle2016-06-072-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The presence of this attribute indicates that VGPR outputs should be computed in whole quad mode. This will be used by Mesa for prolog pixel shaders, so that derivatives can be taken of shader inputs computed by the prolog, fixing a bug. The generated code could certainly be improved: if a prolog pixel shader is used (which isn't common in modern OpenGL - they're used for gl_Color, polygon stipples, and forcing per-sample interpolation), Mesa will use this attribute unconditionally, because it has to be conservative. So WQM may be used in the prolog when it isn't really needed, and furthermore a silly back-and-forth switch is likely to happen at the boundary between prolog and main shader parts. Fixing this is a bit involved: we'd first have to add a mechanism by which LLVM writes the WQM-related input requirements to the main shader part binary, and then Mesa specializes the prolog part accordingly. At that point, we may as well just compile a monolithic shader... Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95130 Reviewers: arsenm, tstellarAMD, mareko Subscribers: arsenm, llvm-commits, kzhuravl Differential Revision: http://reviews.llvm.org/D20839 llvm-svn: 272063
* Revert "Make lldbinline.py regenerate the Makefile each time it builds."Pavel Labath2016-06-0710-91/+17
| | | | | | This reverts commit r272024 as it is not windows-compatible. llvm-svn: 272062
* [LibFuzzer] Split the fuzzer-oom.test into two tests.Dan Liew2016-06-073-1/+14
| | | | | | | | | | This is necessary because the existing fuzzer-oom.test was Linux specific due to its use of __sanitizer_print_memory_profile() which is only available on Linux right now and so the test would fail on OSX. Differential Revision: http://reviews.llvm.org/D20977 llvm-svn: 272061
* [X86][SSE4A] Regenerated SSE4A intrinsics testsSimon Pilgrim2016-06-072-16/+65
| | | | | | There are no VEX encoded versions of SSE4A instructions, make sure that AVX targets give the same output llvm-svn: 272060
* [pdb] Fix broken unit test compilation.Zachary Turner2016-06-071-4/+4
| | | | llvm-svn: 272059
* [pdb] Convert StringRefs to ArrayRef<uint8_t>s.Zachary Turner2016-06-074-12/+15
| | | | llvm-svn: 272058
* Add info to SourceLevelDebugging about CodeViewReid Kleckner2016-06-071-5/+78
| | | | | | | Adds some discussion of the nature of the format, and some developer docs on how to work with it in LLVM. llvm-svn: 272057
* Revert "Differential Revision: http://reviews.llvm.org/D20557"Eric Christopher2016-06-072-309/+18
| | | | | | | | | | | | | | | | Author: Wei Ding <wei.ding2@amd.com> Date: Tue Jun 7 19:04:44 2016 +0000 Differential Revision: http://reviews.llvm.org/D20557 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272044 91177308-0d34-0410-b5e6-96231b3b80d8 as it was breaking the bots. This reverts commit r272044. llvm-svn: 272056
* Reformat for some clarity and 80-columns. NFC.Eric Christopher2016-06-072-21/+32
| | | | llvm-svn: 272055
* [libfuzzer] custom crossover interface function.Mike Aizatsky2016-06-077-0/+107
| | | | | | Differential Revision: http://reviews.llvm.org/D21089 llvm-svn: 272054
* [stack-protection] Add support for MSVC buffer security checkEtienne Bergeron2016-06-0711-41/+668
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch is adding support for the MSVC buffer security check implementation The buffer security check is turned on with the '/GS' compiler switch. * https://msdn.microsoft.com/en-us/library/8dbf701c.aspx * To be added to clang here: http://reviews.llvm.org/D20347 Some overview of buffer security check feature and implementation: * https://msdn.microsoft.com/en-us/library/aa290051(VS.71).aspx * http://www.ksyash.com/2011/01/buffer-overflow-protection-3/ * http://blog.osom.info/2012/02/understanding-vs-c-compilers-buffer.html For the following example: ``` int example(int offset, int index) { char buffer[10]; memset(buffer, 0xCC, index); return buffer[index]; } ``` The MSVC compiler is adding these instructions to perform stack integrity check: ``` push ebp mov ebp,esp sub esp,50h [1] mov eax,dword ptr [__security_cookie (01068024h)] [2] xor eax,ebp [3] mov dword ptr [ebp-4],eax push ebx push esi push edi mov eax,dword ptr [index] push eax push 0CCh lea ecx,[buffer] push ecx call _memset (010610B9h) add esp,0Ch mov eax,dword ptr [index] movsx eax,byte ptr buffer[eax] pop edi pop esi pop ebx [4] mov ecx,dword ptr [ebp-4] [5] xor ecx,ebp [6] call @__security_check_cookie@4 (01061276h) mov esp,ebp pop ebp ret ``` The instrumentation above is: * [1] is loading the global security canary, * [3] is storing the local computed ([2]) canary to the guard slot, * [4] is loading the guard slot and ([5]) re-compute the global canary, * [6] is validating the resulting canary with the '__security_check_cookie' and performs error handling. Overview of the current stack-protection implementation: * lib/CodeGen/StackProtector.cpp * There is a default stack-protection implementation applied on intermediate representation. * The target can overload 'getIRStackGuard' method if it has a standard location for the stack protector cookie. * An intrinsic 'Intrinsic::stackprotector' is added to the prologue. It will be expanded by the instruction selection pass (DAG or Fast). * Basic Blocks are added to every instrumented function to receive the code for handling stack guard validation and errors handling. * Guard manipulation and comparison are added directly to the intermediate representation. * lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp * lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp * There is an implementation that adds instrumentation during instruction selection (for better handling of sibbling calls). * see long comment above 'class StackProtectorDescriptor' declaration. * The target needs to override 'getSDagStackGuard' to activate SDAG stack protection generation. (note: getIRStackGuard MUST be nullptr). * 'getSDagStackGuard' returns the appropriate stack guard (security cookie) * The code is generated by 'SelectionDAGBuilder.cpp' and 'SelectionDAGISel.cpp'. * include/llvm/Target/TargetLowering.h * Contains function to retrieve the default Guard 'Value'; should be overriden by each target to select which implementation is used and provide Guard 'Value'. * lib/Target/X86/X86ISelLowering.cpp * Contains the x86 specialisation; Guard 'Value' used by the SelectionDAG algorithm. Function-based Instrumentation: * The MSVC doesn't inline the stack guard comparison in every function. Instead, a call to '__security_check_cookie' is added to the epilogue before every return instructions. * To support function-based instrumentation, this patch is * adding a function to get the function-based check (llvm 'Value', see include/llvm/Target/TargetLowering.h), * If provided, the stack protection instrumentation won't be inlined and a call to that function will be added to the prologue. * modifying (SelectionDAGISel.cpp) do avoid producing basic blocks used for inline instrumentation, * generating the function-based instrumentation during the ISEL pass (SelectionDAGBuilder.cpp), * if FastISEL (not SelectionDAG), using the fallback which rely on the same function-based implemented over intermediate representation (StackProtector.cpp). Modifications * adding support for MSVC (lib/Target/X86/X86ISelLowering.cpp) * adding support function-based instrumentation (lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp, .h) Results * IR generated instrumentation: ``` clang-cl /GS test.cc /Od /c -mllvm -print-isel-input ``` ``` *** Final LLVM Code input to ISel *** ; Function Attrs: nounwind sspstrong define i32 @"\01?example@@YAHHH@Z"(i32 %offset, i32 %index) #0 { entry: %StackGuardSlot = alloca i8* <<<-- Allocated guard slot %0 = call i8* @llvm.stackguard() <<<-- Loading Stack Guard value call void @llvm.stackprotector(i8* %0, i8** %StackGuardSlot) <<<-- Prologue intrinsic call (store to Guard slot) %index.addr = alloca i32, align 4 %offset.addr = alloca i32, align 4 %buffer = alloca [10 x i8], align 1 store i32 %index, i32* %index.addr, align 4 store i32 %offset, i32* %offset.addr, align 4 %arraydecay = getelementptr inbounds [10 x i8], [10 x i8]* %buffer, i32 0, i32 0 %1 = load i32, i32* %index.addr, align 4 call void @llvm.memset.p0i8.i32(i8* %arraydecay, i8 -52, i32 %1, i32 1, i1 false) %2 = load i32, i32* %index.addr, align 4 %arrayidx = getelementptr inbounds [10 x i8], [10 x i8]* %buffer, i32 0, i32 %2 %3 = load i8, i8* %arrayidx, align 1 %conv = sext i8 %3 to i32 %4 = load volatile i8*, i8** %StackGuardSlot <<<-- Loading Guard slot call void @__security_check_cookie(i8* %4) <<<-- Epilogue function-based check ret i32 %conv } ``` * SelectionDAG generated instrumentation: ``` clang-cl /GS test.cc /O1 /c /FA ``` ``` "?example@@YAHHH@Z": # @"\01?example@@YAHHH@Z" # BB#0: # %entry pushl %esi subl $16, %esp movl ___security_cookie, %eax <<<-- Loading Stack Guard value movl 28(%esp), %esi movl %eax, 12(%esp) <<<-- Store to Guard slot leal 2(%esp), %eax pushl %esi pushl $204 pushl %eax calll _memset addl $12, %esp movsbl 2(%esp,%esi), %esi movl 12(%esp), %ecx <<<-- Loading Guard slot calll @__security_check_cookie@4 <<<-- Epilogue function-based check movl %esi, %eax addl $16, %esp popl %esi retl ``` Reviewers: kcc, pcc, eugenis, rnk Subscribers: majnemer, llvm-commits, hans, thakis, rnk Differential Revision: http://reviews.llvm.org/D20346 llvm-svn: 272053
* [lit] Fix an uninitialized var on Windows.Daniel Dunbar2016-06-071-1/+2
| | | | llvm-svn: 272052
* [scudo] trying to fix the bot: aligned_alloc is not known there; attempt 2Kostya Serebryany2016-06-071-2/+3
| | | | llvm-svn: 272051
* Added notes for a bunch of the issuesMarshall Clow2016-06-071-10/+10
| | | | llvm-svn: 272050
* [yaml] Add a ScalarTraits for mapping endian aware types.Zachary Turner2016-06-072-0/+133
| | | | | | | | | | This allows mapping of any endian-aware type whose underlying type (e.g. uint32_t) provides a ScalarTraits specialization. Reviewed by: majnemer Differential Revision: http://reviews.llvm.org/D21057 llvm-svn: 272049
* Revert r272045 since GCC doesn't know how to compile it.Krzysztof Parzyszek2016-06-071-449/+507
| | | | llvm-svn: 272048
* [asan] Turn LSan-related #if’s into regular if’s in ASan initializerKuba Brecka2016-06-072-8/+15
| | | | | | | | Removing some preprocessor #if’s in favor of regular if’s. However, we need to declare empty stub functions to avoid linker errors. Differential Revision: http://reviews.llvm.org/D20911 llvm-svn: 272047
* Remove break after return.Rui Ueyama2016-06-071-2/+0
| | | | llvm-svn: 272046
* [Hexagon] Modify HexagonExpandCondsets to handle subregistersKrzysztof Parzyszek2016-06-071-507/+449
| | | | | | | Also, switch to using functions from LiveIntervalAnalysis to update live intervals, instead of performing the updates manually. llvm-svn: 272045
* Differential Revision: http://reviews.llvm.org/D20557Wei Ding2016-06-072-18/+309
| | | | llvm-svn: 272044
* [pdb] Fix a potential overflow and remove unnecessary comments.Zachary Turner2016-06-072-3/+3
| | | | llvm-svn: 272043
* [Clang-tidy] Alphabetical checks order in release notes.Eugene Zelenko2016-06-072-8/+8
| | | | | | Highlight return statement in misc-unconventional-assign-operator documentation. llvm-svn: 272042
* Don't use SO_REUSEADDR for *client* socketsPavel Labath2016-06-071-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In the case of client sockets, we are not binding to a specific port, so we should be able to just request a new one. Disregarding refactors, this code has been here since the initial LLDB checkin, so I was unable to figure out whether it was added as a fix for a specific problem, or just for symmetry with server sockets, but I see no side-effect from removing it now. I was still able to create 10000 connections within a couple of seconds, so I think it's unlikely we will exhaust the port space (previously, I would get an error after a couple thousand connections). This fixes an occasional issue with connecting to the android debug bridge deamon on OSX when running the test suite, which would occasionaly fail with EADDRINUSE. My best guess is that this was happening because two processes were assigned the same client port number, and then things blew up because they were both trying to connect to the same ADB server port. I have not observed this issue happening on Linux or Windows. Reviewers: clayborg Subscribers: tberghammer, danalbert, lldb-commits Differential Revision: http://reviews.llvm.org/D21088 llvm-svn: 272041
* [CFLAA] Add AttrEscaped, remove bit twiddling functions.George Burgess IV2016-06-073-63/+76
| | | | | | | | | | | | | | | | | | | | | This patch does a few things: - Unifies AttrAll and AttrUnknown (since they were used for more or less the same purpose anyway). - Introduces AttrEscaped, an attribute that notes that a value escapes our analysis for a given set, but not that an unknown value flows into said set. - Removes functions that take bit indices, since we also had functions that took bitsets, and the use of both (with similar names) was unclear and bug-prone. Patch by Jia Chen. Differential Revision: http://reviews.llvm.org/D21000 llvm-svn: 272040
* [Clang-tidy] Documentation style consistency.Eugene Zelenko2016-06-072-11/+12
| | | | llvm-svn: 272038
* [scudo] trying to fix the bot: aligned_alloc is not known thereKostya Serebryany2016-06-071-0/+2
| | | | llvm-svn: 272037
* LLDB is leaking memory in Editline.cpp on MacOSX. Greg Clayton2016-06-071-43/+62
| | | | | | | | | | | | When USE_SETUPTERM_WORKAROUND is enabled, we were calling setupterm() multiple times and leaking memory on each subsequent call. This is now fixed by calling setupterm() once in the constructor and tracking if we have already setup a terminal for a file descriptor. Calls to "el_set (m_editline, EL_ADDFN, ..." were leaking memory. If we switch over to call el_wset with wide strings when LLDB_EDITLINE_USE_WCHAR is set, then we no longer leak memory each time we construct a new Editline object. The calls to "el_set (m_editline, EL_ADDFN, ..." were changed over to call "el_wset (m_editline, EL_ADDFN, ...". Note that when LLDB_EDITLINE_USE_WCHAR is not defined, then el_wset is #define'ed to el_set. All strings are wrapped in EditLineConstString which will use wide strings when needed, and normal C strings when LLDB_EDITLINE_USE_WCHAR is not defined. <rdar://problem/26677627> llvm-svn: 272036
* [libfuzzer] prune_corpus option for disabling pruning during the load.Mike Aizatsky2016-06-075-1/+19
| | | | | | | | | | Summary: The option is very useful for testing, plus I intend to measure its effect on fuzzer effectiveness. Differential Revision: http://reviews.llvm.org/D21084 llvm-svn: 272035
* Define a helper function to get a relocation name. NFC.Rui Ueyama2016-06-071-13/+11
| | | | llvm-svn: 272034
* Revert "Use CMAKE_INSTALL_BINDIR instead of hardcoding bin for tools install ↵Chris Bieneman2016-06-072-3/+3
| | | | | | | | paths" This reverts commit 0dc5a55f66ed06d7859c4e0474a87428d27775e6. llvm-svn: 272033
* Merge duplicate code. NFC.Rui Ueyama2016-06-071-9/+8
| | | | llvm-svn: 272032
* Use CMAKE_INSTALL_BINDIR instead of hardcoding bin for tools install pathsChris Bieneman2016-06-072-3/+3
| | | | | | | | | | | | | | Summary: This allows customizing the location executables and symlinks get installed to, as with --bindir in autotools. Reviewers: loladiro, beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D20934 llvm-svn: 272031
* Use StringSwitch. NFC.Rui Ueyama2016-06-071-25/+24
| | | | llvm-svn: 272030
* Added notes about the issues for OuluMarshall Clow2016-06-071-22/+22
| | | | llvm-svn: 272029
* Make isNoThrow and hasDynamicExceptionSpec polymorphic so they can be used ↵Aaron Ballman2016-06-074-13/+82
| | | | | | | | with both functionDecl and functionPrototype matchers. Patch by Don Hinton. llvm-svn: 272028
* Fixing a build bot issue with duplicate explicit instantiations.Aaron Ballman2016-06-071-1/+8
| | | | llvm-svn: 272027
* Adding a release note for the misc-misplaced-const check added in r272025.Aaron Ballman2016-06-071-0/+6
| | | | llvm-svn: 272026
* Add the misc-misplaced-const check to clang-tidy, which diagnoses when a ↵Aaron Ballman2016-06-078-1/+207
| | | | | | const-qualifier is applied to a typedef of pointer type rather than to the pointee type. llvm-svn: 272025
* Make lldbinline.py regenerate the Makefile each time it builds.Sean Callanan2016-06-0710-17/+91
| | | | | | | | | | | | | If a lldbinline test's source file changed language, then the Makefile wasn't updated. This was a problem if the Makefile was checked into the repository. Now lldbinline.py always regenerates the Makefile and asserts if the newly-generated version is not the same as the one already there. This ensures that the repository will never be out of date without a buildbot failing. http://reviews.llvm.org/D21032 llvm-svn: 272024
* Reapply [AArch64] Fix isLegalAddImmediate() to return true for valid ↵Geoff Berry2016-06-072-2/+51
| | | | | | | | negative values. Originally reviewed here: http://reviews.llvm.org/D17463 llvm-svn: 272023
* [utils/lit] Show available_features with --show-suites.Daniel Dunbar2016-06-071-0/+3
| | | | llvm-svn: 272022
* [lit] Improve logging with file redirection.Daniel Dunbar2016-06-074-9/+39
| | | | | | | | | - This will cause lit to automatically include the first 1K of data in redirected output files when a command fails (previously if the command failed, but the main point of the test was, say, a `FileCheck` later on, then the log wasn't helpful in showing why the command failed). llvm-svn: 272021
* [asan] make print_memory_profile_test more reliable by using large ↵Kostya Serebryany2016-06-071-6/+6
| | | | | | allocation sizes. Hoping to fix the llvm-clang-lld-x86_64-debian-fast bot llvm-svn: 272020
OpenPOWER on IntegriCloud