summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert Implement sys::fs::copy_file using the macOS copyfile(3) API to ↵Adrian Prantl2019-04-182-53/+0
| | | | | | | | | support APFS clones. This reverts r358628 (git commit 91a06bee788262a294527b815354f380d99dfa9b) while investigating a crash reproducer bot failure. llvm-svn: 358634
* Split out modules-specific declaration handling from SemaDecl.cpp into aRichard Smith2019-04-183-465/+486
| | | | | | new SemaModule.cpp. llvm-svn: 358633
* Add '#pragma clang __debug module_map module.name' to dump the moduleRichard Smith2019-04-182-1/+19
| | | | | | map being used for the module 'module.name'. llvm-svn: 358632
* [c++2a] Improve diagnostic for use of declaration from another TU'sRichard Smith2019-04-184-22/+156
| | | | | | | | | | global module fragment. We know that the declaration in question should have been introduced by a '#include', so try to figure out which one and suggest it. Don't suggest importing the global module fragment itself! llvm-svn: 358631
* [clang-format] Remove unused Environment constructor.Alexander Kornienko2019-04-181-4/+0
| | | | llvm-svn: 358630
* [lldb] Don't filter variable list when doing a lookup by mangled name in ↵Kuba Mracek2019-04-184-1/+66
| | | | | | | | SymbolFileDWARF::FindGlobalVariables Differential Revision: https://reviews.llvm.org/D60737 llvm-svn: 358629
* Implement sys::fs::copy_file using the macOS copyfile(3) APIAdrian Prantl2019-04-182-0/+53
| | | | | | | | | | | | | | | to support APFS clones. This patch adds a Darwin-specific implementation of llvm::sys::fs::copy_file() that uses the macOS copyfile(3) API to support APFS copy-on-write clones, which should be faster and much more space efficient. https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/APFS_Guide/ToolsandAPIs/ToolsandAPIs.html Differential Revision: https://reviews.llvm.org/D60802 llvm-svn: 358628
* Move the implementation of getInnermostBlockDecl to the .cpp file to fixAkira Hatanaka2019-04-182-11/+13
| | | | | | failing bots. llvm-svn: 358627
* Fix test on PS4 which defaults to gnu99 which does not emit the expected ↵Douglas Yung2019-04-181-3/+15
| | | | | | warnings. llvm-svn: 358626
* [Cmake] Add missing dependency for running tests.Davide Italiano2019-04-171-0/+3
| | | | | | | This is needed now that we marked lldb-test as EXCLUDE_ALL, to make sure `ninja lldb-test-deps` doesn't fail. llvm-svn: 358625
* [Sema][ObjC] Don't warn about an implicitly retained self if theAkira Hatanaka2019-04-177-23/+97
| | | | | | | | | | | | | | | | | retaining block and all of the enclosing blocks are non-escaping. If the block implicitly retaining self doesn't escape, there is no risk of creating retain cycles, so clang shouldn't diagnose it and force users to add self-> to silence the diagnostic. Also, fix a bug where clang was failing to diagnose an implicitly retained self inside a c++ lambda nested inside a block. rdar://problem/25059955 Differential Revision: https://reviews.llvm.org/D60736 llvm-svn: 358624
* Fix formatting. NFCAkira Hatanaka2019-04-171-90/+88
| | | | llvm-svn: 358623
* [x86] try to widen 'shl' as part of LEA formationSanjay Patel2019-04-172-8/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | The test file has pairs of tests that are logically equivalent: https://rise4fun.com/Alive/2zQ %t4 = and i8 %t1, 8 %t5 = zext i8 %t4 to i16 %sh = shl i16 %t5, 2 %t6 = add i16 %sh, %t0 => %t4 = and i8 %t1, 8 %sh2 = shl i8 %t4, 2 %z5 = zext i8 %sh2 to i16 %t6 = add i16 %z5, %t0 ...so if we can fold the shift op into LEA in the 1st pattern, then we should be able to do the same in the 2nd pattern (unnecessary 'movzbl' is a separate bug I think). We don't want to do this any sooner though because that would conflict with generic transforms that try to narrow the width of the shift. Differential Revision: https://reviews.llvm.org/D60789 llvm-svn: 358622
* [clang-tidy] Don't issue cppcoreguidelines-macro-usage on builtin macrosAlexander Kornienko2019-04-172-2/+3
| | | | | | | | | | | | | | | | | Before the patch calling clang-tidy with -header-filter=.* -system-headers would result in a few hundred useless warnings: warning: macro '_GNU_SOURCE' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage] warning: macro '_LP64' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage] warning: macro '__ATOMIC_ACQUIRE' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage] warning: macro '__ATOMIC_ACQ_REL' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage] warning: macro '__ATOMIC_CONSUME' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage] warning: macro '__ATOMIC_RELAXED' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage] warning: macro '__ATOMIC_RELEASE' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage] warning: macro '__ATOMIC_SEQ_CST' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage] warning: macro '__BIGGEST_ALIGNMENT__' used to declare a constant; consider using a 'constexpr' constant [cppcoreguidelines-macro-usage] ... and so on llvm-svn: 358621
* [clang-tidy] Add a check for [super self] in initializers 🔍Stephane Moore2019-04-178-0/+273
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This check aims to address a relatively common benign error where Objective-C subclass initializers call -self on their superclass instead of invoking a superclass initializer, typically -init. The error is typically benign because libobjc recognizes that improper initializer chaining is common¹. One theory for the frequency of this error might be that -init and -self have the same return type which could potentially cause inappropriate autocompletion to -self instead of -init. The equal selector lengths and triviality of common initializer code probably contribute to errors like this slipping through code review undetected. This check aims to flag errors of this form in the interests of correctness and reduce incidence of initialization failing to chain to -[NSObject init]. [1] "In practice, it will be hard to rely on this function. Many classes do not properly chain -init calls." From _objc_rootInit in https://opensource.apple.com/source/objc4/objc4-750.1/runtime/NSObject.mm.auto.html. Test Notes: Verified via `make check-clang-tools`. Subscribers: mgorny, xazax.hun, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59806 llvm-svn: 358620
* Test commit by Denis BakhvalovDenis Bakhvalov2019-04-171-1/+1
| | | | | Change-Id: I4d85123a157d957434902fb14ba50926b2d56212 llvm-svn: 358619
* [AsmPrinter] hoist %a output template to base class for ARM+Aarch64Nick Desaulniers2019-04-173-18/+11
| | | | | | | | | | | | | | | | | | | | | Summary: X86 is quite complicated; so I intend to leave it as is. ARM+Aarch64 do basically the same thing (Aarch64 did not correctly handle immediates, ARM has a test llvm/test/CodeGen/ARM/2009-04-06-AsmModifier.ll that uses %a with an immediate) for a flag that should be target independent anyways. Reviewers: echristo, peter.smith Reviewed By: echristo Subscribers: javed.absar, eraman, kristof.beyls, hiraditya, llvm-commits, srhines Tags: #llvm Differential Revision: https://reviews.llvm.org/D60841 llvm-svn: 358618
* Add a getSizeInBits() accessor to MachineMemOperand. NFC.Amara Emerson2019-04-175-11/+20
| | | | | | | | Cleans up a bunch of places where we do getSize() * 8. Differential Revision: https://reviews.llvm.org/D60799 llvm-svn: 358617
* [libc++][CMake] Remove unnecessary conditional for defining new handlersLouis Dionne2019-04-171-1/+1
| | | | | | | | | | | It turns out that whether the new handlers should be provided is orthogonal to whether new/delete are provided in libc++ or libc++abi. The reason why I initially added this conditional is because of an incorrect understanding of the path we're taking when building on Apple platforms. In fact, we always build libc++ on top of libc++abi on Apple platforms, so we take the branch for `LIBCXX_BUILDING_LIBCXXABI` there. llvm-svn: 358616
* [crashlog] Use the right path for dsymforUUID and remove an unnecessary import.Davide Italiano2019-04-171-6/+1
| | | | | | <rdar://problem/49925960> llvm-svn: 358615
* [CMake] Split linked libraries for shared and static libc++Petr Hosek2019-04-172-19/+13
| | | | | | | | | | | | | Some linker libraries are only needed for shared libc++, some only for static libc++, combining these together in LIBCXX_LIBRARIES and LIBCXX_INTERFACE_LIBRARIES can introduce unnecessary dependencies. This changes splits those up into LIBCXX_SHARED_LIBRARIES and LIBCXX_STATIC_LIBRARIES matching what libc++abi already does. Differential Revision: https://reviews.llvm.org/D57872 llvm-svn: 358614
* [GlobalISel] Add legalization support for non-power-2 loads and storesAmara Emerson2019-04-175-31/+152
| | | | | | | | | | Legalize things like i24 load/store by splitting them into smaller power of 2 operations. This matches how SelectionDAG handles these operations. Differential Revision: https://reviews.llvm.org/D59971 llvm-svn: 358613
* [clangd] Strip the ' [some-check-name]' suffix from clang-tidy diagnostics. ↵Sam McCall2019-04-173-8/+17
| | | | | | | | | | | | | | The check name is reported in Diagnostic.code. Reviewers: kadircet Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60819 llvm-svn: 358612
* [clangd] Use shorter, more recognizable codes for diagnostics.Sam McCall2019-04-1710-16/+26
| | | | | | | | | | | | | | | | | | | | | Summary: - for warnings, use the flag the warning is controlled by (-Wfoo) - for errors, keep using the internal name (there's nothing better) but drop the err_ prefix This comes at the cost of uniformity, it's no longer totally obvious exactly what the code field contains. But the -Wname flags are so much more useful to end-users than the internal warn_foo that this seems worth it. Reviewers: kadircet Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60822 llvm-svn: 358611
* [libc++] (Take 2) Add a test that uses the debug database from multiple threadsLouis Dionne2019-04-171-0/+72
| | | | | | | | | | | | In r358591, I added a test that uses the debug database from multiple threads and that helped us uncover the problem that was fixed in r355367. However, the test broke the tsan CI bots, and I think the problem is the test allocator that was used in the test (which is not thread safe). I'm committing again without using the test allocator, and in a separate test file. llvm-svn: 358610
* [analyzer] PR41185: Fix regression where __builtin_* functions weren't ↵Kristof Umann2019-04-174-9/+53
| | | | | | | | | | | | | | | | | | | | | recognized For the following code snippet: void builtin_function_call_crash_fixes(char *c) { __builtin_strncpy(c, "", 6); __builtin_memset(c, '\0', (0)); __builtin_memcpy(c, c, 0); } security.insecureAPI.DeprecatedOrUnsafeBufferHandling caused a regression, as it didn't recognize functions starting with __builtin_. Fixed exactly that. I wanted to modify an existing test file, but the two I found didn't seem like perfect candidates. While I was there, I prettified their RUN: lines. Differential Revision: https://reviews.llvm.org/D59812 llvm-svn: 358609
* [libc++][CMake] Allow building neither the shared nor the static libraryLouis Dionne2019-04-171-4/+0
| | | | | | It's possible to build just the headers, and we actually do it. llvm-svn: 358608
* Add basic loop fusion pass.Kit Barton2019-04-1713-0/+2286
| | | | | | | | | | | | | | | | | | | | This patch adds a basic loop fusion pass. It will fuse loops that conform to the following 4 conditions: 1. Adjacent (no code between them) 2. Control flow equivalent (if one loop executes, the other loop executes) 3. Identical bounds (both loops iterate the same number of iterations) 4. No negative distance dependencies between the loop bodies. The pass does not make any changes to the IR to create opportunities for fusion. Instead, it checks if the necessary conditions are met and if so it fuses two loops together. The pass has not been added to the pass pipeline yet, and thus is not enabled by default. It can be run stand alone using the -loop-fusion option. Differential Revision: https://reviews.llvm.org/D55851 llvm-svn: 358607
* [clangd] Recognize "don't include me directly" pattern, and suppress include ↵Sam McCall2019-04-173-49/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | insertion. Summary: Typically used with umbrella headers, e.g. GTK: #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) #error "Only <gtk/gtk.h> can be included directly." #endif Heuristic is fairly conservative, a quick code search over github showed a fair number of hits and few/no false positives. (Not all were umbrella headers, but I'd be happy avoiding include insertion for all of them). We may want to relax the heuristic later to catch more cases. Reviewers: ioeric Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60815 llvm-svn: 358605
* [CMake] Remove Apple-specific version logic.Frederic Riss2019-04-173-38/+1
| | | | | | | | | | | | We were using the LLDB-Info.plist as the canonical holder of the version number, but there is really no good reason to do this. If anything the plist should be generated using the information provided to CMake. For now just remove the logic extracting the version from the plist and rely on LLDB_VERSION_STRING. llvm-svn: 358604
* [AsmPrinter] defer %c to base class for ARM, PPC, and Hexagon. NFCNick Desaulniers2019-04-177-12/+58
| | | | | | | | | | | | | | | | | | | Summary: None of these derived classes do anything that the base class cannot. If we remove these case statements, then the base class can handle them just fine. Reviewers: peter.smith, echristo Reviewed By: echristo Subscribers: nemanjai, javed.absar, eraman, kristof.beyls, hiraditya, kbarton, jsji, llvm-commits, srhines Tags: #llvm Differential Revision: https://reviews.llvm.org/D60803 llvm-svn: 358603
* [libc++] Use the no_destroy attribute to avoid destroying debug DB staticsLouis Dionne2019-04-172-2/+8
| | | | | | | | | | | | | | | | | Summary: Otherwise, we can run into problems when the program has static variables that need to use the debug database during their deinitialization, if the debug DB has already been deinitialized. Reviewers: EricWF Subscribers: christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D60830 llvm-svn: 358602
* [ThinLTO] Fix ThinLTOCodegenerator to export llvm.used symbolsSteven Wu2019-04-1726-109/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Reapply r357931 with fixes to ThinLTO testcases and llvm-lto tool. ThinLTOCodeGenerator currently does not preserve llvm.used symbols and it can internalize them. In order to pass the necessary information to the legacy ThinLTOCodeGenerator, the input to the code generator is rewritten to be based on lto::InputFile. Now ThinLTO using the legacy LTO API will requires data layout in Module. "internalize" thinlto action in llvm-lto is updated to run both "promote" and "internalize" with the same configuration as ThinLTOCodeGenerator. The old "promote" + "internalize" option does not produce the same output as ThinLTOCodeGenerator. This fixes: PR41236 rdar://problem/49293439 Reviewers: tejohnson, pcc, kromanova, dexonsmith Reviewed By: tejohnson Subscribers: ormris, bd1976llvm, mehdi_amini, inglorion, eraman, hiraditya, jkorous, dexonsmith, arphaman, dang, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60421 llvm-svn: 358601
* [InstCombine] Factor out unreachable inst idiom creation [NFC]Philip Reames2019-04-173-13/+15
| | | | | | | | In InstCombine, we use an idiom of "store i1 true, i1 undef" to indicate we've found a path which we've proven unreachable. We can't actually insert the unreachable instruction since that would require changing the CFG. We leave that to simplifycfg later. This just factors out that idiom creation so we don't duplicate the same mostly undocument idiom creation in multiple places. llvm-svn: 358600
* [LVI][CVP] Constrain values in with.overflow branchesNikita Popov2019-04-172-28/+41
| | | | | | | | | | | | If a branch is conditional on extractvalue(op.with.overflow(%x, C), 1) then we can constrain the value of %x inside the branch based on makeGuaranteedNoWrapRegion(). We do this by extending the edge-value handling in LVI. This allows CVP to then fold comparisons against %x, as illustrated in the tests. Differential Revision: https://reviews.llvm.org/D60650 llvm-svn: 358597
* [AMDGPU][MC] Corrected handling of "-" before expressionsDmitry Preobrazhensky2019-04-172-39/+74
| | | | | | | | | | See bug 41156: https://bugs.llvm.org/show_bug.cgi?id=41156 Reviewers: artem.tamazov, arsenm Differential Revision: https://reviews.llvm.org/D60622 llvm-svn: 358596
* [OPENMP][NVPTX]Run combined constructs with if clause in SPMD mode.Alexey Bataev2019-04-177-91/+140
| | | | | | | | All target-parallel-based constructs can be run in SPMD mode from now on. Even if num_threads clauses or if clauses are used, such constructs can be executed in SPMD mode. llvm-svn: 358595
* [ARM] tighten test checks; NFCSanjay Patel2019-04-171-12/+12
| | | | llvm-svn: 358594
* Revert "[libc++] Add a test that uses the debug database from multiple threads"Louis Dionne2019-04-171-34/+0
| | | | | | | | This reverts r358591, which seems to have uncovered an actual bug and causes the tsan CI to fail. We need to fix the bug and re-commit the test. llvm-svn: 358593
* AMDGPU: Force skip over SMRD, VMEM and s_waitcnt instructionsRhys Perry2019-04-175-0/+15
| | | | | | | | | | | | | | | | Summary: This fixes a large Dawn of War 3 performance regression with RADV from Mesa 19.0 to master which was caused by creating less code in some branches. Reviewers: arsen, nhaehnle Reviewed By: nhaehnle Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60824 llvm-svn: 358592
* [libc++] Add a test that uses the debug database from multiple threadsLouis Dionne2019-04-171-0/+34
| | | | | | | This test helped us concurrently discover the problem that was fixed in r355367. llvm-svn: 358591
* Remove --show-includes flag in crash reduce scriptAmy Huang2019-04-171-0/+4
| | | | llvm-svn: 358590
* [clang-tidy] Fix invalid location in readability-misleading-indentation ↵Alexander Kornienko2019-04-172-3/+16
| | | | | | | | | | diagnostic Before this patch readability-misleading-indentation could issue diagnostics with an invalid location, which would lead to an assertion failure in ClangTidyContext::diag() llvm-svn: 358589
* [libc++][NFC] Make size of allocation more self-documentingLouis Dionne2019-04-171-2/+2
| | | | llvm-svn: 358588
* [ARM] make test checks more thorough; NFCSanjay Patel2019-04-171-4/+16
| | | | | | | | | | This will change with the proposal in D60214. Unfortunately, the triple is not supported for auto-generation via script, and the multiple RUN lines have diffs on this test, but I can't tell exactly what is required by this test. PR7162 was an assert/crash, so hopefully, this is good enough. llvm-svn: 358587
* [LoopUnroll] Allow unrolling if the unrolled size does not exceed loop size.Florian Hahn2019-04-172-2/+184
| | | | | | | | | | | | | | | | | | | | Summary: In the following cases, unrolling can be beneficial, even when optimizing for code size: 1) very low trip counts 2) potential to constant fold most instructions after fully unrolling. We can unroll in those cases, by setting the unrolling threshold to the loop size. This might highlight some cost modeling issues and fixing them will have a positive impact in general. Reviewers: vsk, efriedma, dmgreen, paquette Reviewed By: paquette Differential Revision: https://reviews.llvm.org/D60265 llvm-svn: 358586
* [DAGCombine] Add SimplifyDemandedBits helper that handles demanded elts mask ↵Simon Pilgrim2019-04-171-4/+13
| | | | | | | | as well The other SimplifyDemandedBits helpers become wrappers to this new demanded elts variant. llvm-svn: 358585
* [Support] Add LEB128 support to BinaryStreamReader/Writer.Lang Hames2019-04-175-1/+142
| | | | | | | | | | | | | | | | | | | Summary: This patch adds support for ULEB128 and SLEB128 encoding and decoding to BinaryStreamWriter and BinaryStreamReader respectively. Support for ULEB128/SLEB128 will be used for eh-frame parsing in the JITLink library currently under development (see https://reviews.llvm.org/D58704). Reviewers: zturner, dblaikie Subscribers: kristina, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60810 llvm-svn: 358584
* [ScheduleDAGRRList] Recompute topological ordering on demand.Florian Hahn2019-04-173-24/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently there is a single point in ScheduleDAGRRList, where we actually query the topological order (besides init code). Currently we are recomputing the order after adding a node (which does not have predecessors) and then we add predecessors edge-by-edge. We can avoid adding edges one-by-one after we added a new node. In that case, we can just rebuild the order from scratch after adding the edges to the DAG and avoid all the updates to the ordering. Also, we can delay updating the DAG until we query the DAG, if we keep a list of added edges. Depending on the number of updates, we can either apply them when needed or recompute the order from scratch. This brings down the geomean compile time for of CTMark with -O1 down 0.3% on X86, with no regressions. Reviewers: MatzeB, atrick, efriedma, niravd, paquette Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D60125 llvm-svn: 358583
* Explicitly say we don't define new/delete in libc++ during Apple stage1 ↵Louis Dionne2019-04-171-0/+3
| | | | | | | | | bootstrap This is not necessary in stage2 because we don't even build libc++.dylib there. llvm-svn: 358582
OpenPOWER on IntegriCloud