summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Use EXPECT_FALSE instead of EXPECT_EQ(false, ...Momchil Velikov2018-02-141-1/+1
| | | | | | | | | | | | | | Commit https://reviews.llvm.org/rL324489 added EXPECT_EQ(false, N->isUnsigned()); which older GCC versions dislike for some reason. Anyway, it looks like the proper GTest way is to use EXPECT_FALSE, etc. Differential Revision: https://reviews.llvm.org/D43233 llvm-svn: 325121
* [AST] Refine the condition for element-dependent array fillersIvan A. Kosarev2018-02-142-2/+32
| | | | | | | | | | | | This patch fixes clang to not consider braced initializers for aggregate elements of arrays to be potentially dependent on the indices of the initialized elements. Resolves bug 18978: initialize a large static array = clang oom? https://bugs.llvm.org/show_bug.cgi?id=18978 Differential Revision: https://reviews.llvm.org/D43187 llvm-svn: 325120
* [Utils] Salvage the debug info of DCE'ed 'and' instructionsPetar Jovanovic2018-02-144-0/+15
| | | | | | | | | | Preserve debug info from a dead 'and' instruction with a constant. Patch by Djordje Todorovic. Differential Revision: https://reviews.llvm.org/D43163 llvm-svn: 325119
* Quick fix for 325116 buildbots: move template specialization into namespaceAleksei Sidorin2018-02-141-27/+29
| | | | llvm-svn: 325118
* [Sema] Fix decltype of static data membersMikhail Maltsev2018-02-142-3/+9
| | | | | | | | | | | | | | | | | | | | | | | Summary: According to the C++11 standard [dcl.type.simple]p4: The type denoted by decltype(e) is defined as follows: - if e is an unparenthesized id-expression or an unparenthesized class member access (5.2.5), decltype(e) is the type of the entity named by e. Currently Clang handles the 'member access' case incorrectly for static data members (decltype returns T& instead of T). This patch fixes the issue. Reviewers: faisalv, rsmith, rogfer01 Reviewed By: rogfer01 Subscribers: rogfer01, cfe-commits Differential Revision: https://reviews.llvm.org/D42969 llvm-svn: 325117
* [ASTImporter] Fix lexical DC for templated decls; support ↵Aleksei Sidorin2018-02-144-64/+161
| | | | | | | | | | VarTemplatePartialSpecDecl Also minor refactoring in related functions was done. Differential Revision: https://reviews.llvm.org/D43012 llvm-svn: 325116
* Revert r325107 (case folding DJB hash) and subsequent build fixPavel Labath2018-02-148-1055/+1
| | | | | | | The "knownValuesUnicode" test in the patch fails on ppc64 and arm64 bots. Reverting while I investigate. llvm-svn: 325115
* [clangd] Explicitly initialize all primitive fields in Protocol.hIlya Biryukov2018-02-146-68/+85
| | | | | | | | | | | | | | | | | | Summary: Some of the existing structs had primimtive fields that were not explicitly initialized on construction. After this commit every struct consistently sets a defined value for every field when default-initialized. Reviewers: hokein, ioeric, sammccall Reviewed By: sammccall Subscribers: klimek, cfe-commits, jkorous-apple Differential Revision: https://reviews.llvm.org/D43230 llvm-svn: 325113
* [IRMover] Move type name extraction to a separate function. NFCEugene Leviant2018-02-141-6/+11
| | | | llvm-svn: 325110
* Fix build broken by r325107Pavel Labath2018-02-141-23/+23
| | | | | | | Older gcc versions need an extra pair of {}s to convert a string literal into llvm::StringLiteral. llvm-svn: 325109
* Implement a case-folding version of DJB hashPavel Labath2018-02-148-1/+1055
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements a variant of the DJB hash function which folds the input according to the algorithm in the Dwarf 5 specification (Section 6.1.1.4.5), which in turn references the Unicode Standard (Section 5.18, "Case Mappings"). To achieve this, I have added a llvm::sys::unicode::foldCharSimple function, which performs this mapping. The implementation of this function was generated from the CaseMatching.txt file from the Unicode spec using a python script (which is also included in this patch). The script tries to optimize the function by coalescing adjecant mappings with the same shift and stride (terms I made up). Theoretically, it could be made a bit smarter and merge adjecant blocks that were interrupted by only one or two characters with exceptional mapping, but this would save only a couple of branches, while it would greatly complicate the implementation, so I deemed it was not worth it. Since we assume that the vast majority of the input characters will be US-ASCII, the folding hash function has a fast-path for handling these, and only whips out the full decode+fold+encode logic if we encounter a character outside of this range. It might be possible to implement the folding directly on utf8 sequences, but this would also bring a lot of complexity for the few cases where we will actually need to process non-ascii characters. Reviewers: JDevlieghere, aprantl, probinson, dblaikie Subscribers: mgorny, hintonda, echristo, clayborg, vleschuk, llvm-commits Differential Revision: https://reviews.llvm.org/D42740 llvm-svn: 325107
* Test commit accessHenry Wong2018-02-141-1/+1
| | | | llvm-svn: 325103
* Adding a width of the GEP index to the Data Layout.Elena Demikhovsky2018-02-1430-131/+1630
| | | | | | | | | | | | | | | | | | Making a width of GEP Index, which is used for address calculation, to be one of the pointer properties in the Data Layout. p[address space]:size:memory_size:alignment:pref_alignment:index_size_in_bits. The index size parameter is optional, if not specified, it is equal to the pointer size. Till now, the InstCombiner normalized GEPs and extended the Index operand to the pointer width. It works fine if you can convert pointer to integer for address calculation and all registered targets do this. But some ISAs have very restricted instruction set for the pointer calculation. During discussions were desided to retrieve information for GEP index from the Data Layout. http://lists.llvm.org/pipermail/llvm-dev/2018-January/120416.html I added an interface to the Data Layout and I changed the InstCombiner and some other passes to take the Index width into account. This change does not affect any in-tree target. I added tests to cover data layouts with explicitly specified index size. Differential Revision: https://reviews.llvm.org/D42123 llvm-svn: 325102
* [SelectionDAG] Remove duplicate code from TargetLowering::SimplifySetCC.Craig Topper2018-02-141-4/+0
| | | | | | This exact code already exists a little further up. llvm-svn: 325101
* Use delete[] instead of freeSerge Pavlov2018-02-141-2/+2
| | | | llvm-svn: 325100
* Use delete[] to deallocate array of charsSerge Pavlov2018-02-141-2/+2
| | | | llvm-svn: 325099
* Refactor DisassembleInfo in MachODump.cppSerge Pavlov2018-02-141-83/+23
| | | | | | | | | The change implements constructor of DisassembleInfo to avoid duplication of initialization code and gets rid of malloc/free where possible. Differential Revision: https://reviews.llvm.org/D43003 llvm-svn: 325098
* [clangd] Configure clangd tracing with CLANGD_TRACE env instead of -trace flagSam McCall2018-02-142-11/+9
| | | | llvm-svn: 325097
* Fix a couple of places where we assumed that non-type template parameters ↵Richard Smith2018-02-146-8/+26
| | | | | | are always rvalues. llvm-svn: 325095
* Use a stricter return type in buildSectionOrder. NFC.Rafael Espindola2018-02-141-9/+10
| | | | | | | | | | We sort inside output sections, so all the sections we see should be InputSectionBase. I noticed the patch adding callgraph based section ordering used this type and changing this separately makes the merge easier. llvm-svn: 325094
* [demangler] Support for exception specifications on function types.Erik Pilkington2018-02-142-4/+96
| | | | llvm-svn: 325093
* [demangler] Simplify the AST for function types, NFC.Erik Pilkington2018-02-141-92/+66
| | | | llvm-svn: 325092
* Fix incorrect indentation.Bruce Mitchener2018-02-141-1/+1
| | | | | | | | | | Reviewers: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D43167 llvm-svn: 325087
* [X86] Remove dead code from retpoline thunk generationReid Kleckner2018-02-141-26/+0
| | | | | | Follow-up to r325049 llvm-svn: 325085
* Implement function attribute artificialErich Keane2018-02-146-1/+37
| | | | | | | | | | | | Added support in clang for GCC function attribute 'artificial'. This attribute is used to control stepping behavior of debugger with respect to inline functions. Patch By: Elizabeth Andrews (eandrews) Differential Revision: https://reviews.llvm.org/D43259 llvm-svn: 325081
* [gold] Fix error report in thinlto_emit_linked_objects.ll testVitaly Buka2018-02-143-2/+9
| | | | | | | | | Summary: It's just cleanup after r323818 to avoid irrelevant error message inside the test. Existing version of test passed but generated unrelated error report about symbol redefinition. llvm-svn: 325080
* [analyzer] [tests] Update CmpRuns to write to stdout correctly in ↵George Karpenkov2018-02-132-14/+18
| | | | | | multithreaded environment llvm-svn: 325070
* Fix off-by-one in set_thread_name which causes truncation to fail on LinuxSam McCall2018-02-131-1/+2
| | | | llvm-svn: 325069
* [cmake] Darwin: Copy in the system debugserver if neededVedant Kumar2018-02-134-13/+26
| | | | | | | This makes the built debugger functional on Darwin when compiling without code signing (as documented in docs/code-signing.txt). llvm-svn: 325068
* [globalisel][legalizerinfo] Follow up on post-commit review comments after ↵Daniel Sanders2018-02-133-3/+106
| | | | | | | | | | | | | | r323681 * Document most API's * Delete a useless function call * Fix a discrepancy between the single and multi-opcode variants of getActionDefinitions(). The multi-opcode variant now requires that more than one opcode is requested. Previously it acted much like the single-opcode form but unnecessarily enforced the requirements of the multi-opcode form. llvm-svn: 325067
* [InstCombine] put tests of mul with neg operand(s) together; NFCSanjay Patel2018-02-134-58/+64
| | | | llvm-svn: 325066
* Use toString to stringize sections and files.Rui Ueyama2018-02-1311-36/+34
| | | | | | Differential Revision: https://reviews.llvm.org/D43251 llvm-svn: 325065
* Use LLVM's SetVector insteead of unordered_set.Rui Ueyama2018-02-131-3/+2
| | | | | | | | | SetVector guarantees ordering, so with that we can get a deterministic output for error messages. Differential Revision: https://reviews.llvm.org/D43254 llvm-svn: 325064
* [GVN] Salvage debug info from dead instsVedant Kumar2018-02-133-2/+13
| | | | | | | | | | This preserves an additional 581 unique source variables in a stage2 build of clang (according to `llvm-dwarfdump --statistics`). It increases the size of the .debug_loc section by 0.1% (or 87139 bytes). Differential Revision: https://reviews.llvm.org/D43255 llvm-svn: 325063
* [InstCombine] (lshr X, 31) * Y --> (ashr X, 31) & YSanjay Patel2018-02-132-29/+17
| | | | | | | | | | | This replaces the bit-tracking based fold that did the same thing, but it only worked for scalars and not directly. There is no evidence in existing regression tests that the greater power of bit-tracking was needed here, but we should be aware of this potential loss of optimization. llvm-svn: 325062
* amdgpu/half_recip: Switch implementation to native_recipJan Vesely2018-02-132-0/+7
| | | | | | Reviewer: Tom Stellard <tstellar@redhat.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 325061
* amdgpu/half_log2: Switch implementation to native_log2Jan Vesely2018-02-132-0/+7
| | | | | | Reviewer: Tom Stellard <tstellar@redhat.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 325060
* amdgpu/half_log10: Switch implementation to native_log10Jan Vesely2018-02-132-0/+7
| | | | | | Reviewer: Tom Stellard <tstellar@redhat.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 325059
* amdgpu/half_log: Switch implementation to native_logJan Vesely2018-02-132-0/+7
| | | | | | Reviewer: Tom Stellard <tstellar@redhat.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 325058
* amdgpu/half_exp2: Switch implementation to native_exp2Jan Vesely2018-02-132-0/+7
| | | | | | Reviewer: Tom Stellard <tstellar@redhat.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 325057
* amdgpu/half_exp10: Switch implementation to native_exp10Jan Vesely2018-02-132-0/+7
| | | | | | Reviewer: Tom Stellard <tstellar@redhat.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 325056
* amdgpu/half_exp: Switch implementation to native_expJan Vesely2018-02-132-0/+7
| | | | | | Reviewer: Tom Stellard <tstellar@redhat.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 325055
* amdgpu/half_sqrt: Switch implementation to native_sqrtJan Vesely2018-02-132-0/+7
| | | | | | Reviewer: Tom Stellard <tstellar@redhat.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 325054
* amdgpu/half_rsqrt: Switch implementation to native_rsqrtJan Vesely2018-02-133-0/+18
| | | | | | Reviewer: Tom Stellard <tstellar@redhat.com> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 325053
* Teach Wreturn-type, Wunreachable-code, and alpha.deadcode.UnreachableCode to ↵Nico Weber2018-02-138-6/+57
| | | | | | | | | treat __assume(0) like __builtin_unreachable. Fixes PR29134. https://reviews.llvm.org/D43221 llvm-svn: 325052
* [InstCombine] add vector tests, fix comments; NFCSanjay Patel2018-02-131-8/+53
| | | | | | | | The scalar folds are done indirectly and use potentially expensive value tracking calls. That can be improved along with the enhancement to support vector types. llvm-svn: 325051
* [libFuzzer] Set -experimental_len_control=1000 as default.Matt Morehouse2018-02-134-6/+9
| | | | | | | | | | | | | | | | | | | | Summary: Experiments using https://github.com/google/fuzzer-test-suite/tree/master/engine-comparison show a significant increase in coverage and reduction in corpus size with this option enabled. Addresses https://llvm.org/pr36371. Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D42932 llvm-svn: 325050
* [X86] Use EDI for retpoline when no scratch regs are leftReid Kleckner2018-02-134-72/+76
| | | | | | | | | | | | | | | | | | | | Summary: Instead of solving the hard problem of how to pass the callee to the indirect jump thunk without a register, just use a CSR. At a call boundary, there's nothing stopping us from using a CSR to hold the callee as long as we save and restore it in the prologue. Also, add tests for this mregparm=3 case. I wrote execution tests for __llvm_retpoline_push, but they never got committed as lit tests, either because I never rewrote them or because they got lost in merge conflicts. Reviewers: chandlerc, dwmw2 Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D43214 llvm-svn: 325049
* [InstCombine] (bool X) * Y --> X ? Y : 0Sanjay Patel2018-02-132-3/+21
| | | | | | | | | This is both a functional improvement for vectors and an efficiency improvement for scalars. The existing code below the new folds does the same thing for scalars, but in an indirect and expensive way. llvm-svn: 325048
* [LLD] Implement /guard:[no]longjmpReid Kleckner2018-02-1311-28/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This protects calls to longjmp from transferring control to arbitrary program points. Instead, longjmp calls are limited to the set of registered setjmp return addresses. This also implements /guard:nolongjmp to allow users to link in object files that call setjmp that weren't compiled with /guard:cf. In this case, the linker will approximate the set of address taken functions, but it will leave longjmp unprotected. I used the following program to test, compiling it with different -guard flags: $ cl -c t.c -guard:cf $ lld-link t.obj -guard:cf #include <setjmp.h> #include <stdio.h> jmp_buf buf; void g() { printf("before longjmp\n"); fflush(stdout); longjmp(buf, 1); } void f() { if (setjmp(buf)) { printf("setjmp returned non-zero\n"); return; } g(); } int main() { f(); printf("hello world\n"); } In particular, the program aborts when the code is compiled *without* -guard:cf and linked with -guard:cf. That indicates that longjmps are protected. Reviewers: ruiu, inglorion, amccarth Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D43217 llvm-svn: 325047
OpenPOWER on IntegriCloud