summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [clangd] Implement LIMIT iteratorKirill Bobyrev2018-08-244-60/+101
| | | | | | | | | | | | | This patch introduces LIMIT iterator, which is very important for improving the quality of search query. LIMIT iterators can be applied on top of BOOST iterators to prevent populating query request with a huge number of low-quality symbols. Reviewed by: sammccall Differential Revision: https://reviews.llvm.org/D51029 llvm-svn: 340605
* [clangd] Speculative code completion index request before Sema is run.Eric Liu2018-08-248-19/+274
| | | | | | | | | | | | | | | | | | | | | | | | Summary: For index-based code completion, send an asynchronous speculative index request, based on the index request for the last code completion on the same file and the filter text typed before the cursor, before sema code completion is invoked. This can reduce the code completion latency (by roughly latency of sema code completion) if the speculative request is the same as the one generated for the ongoing code completion from sema. As a sequence of code completions often have the same scopes and proximity paths etc, this should be effective for a number of code completions. Trace with speculative index request:{F6997544} Reviewers: hokein, ilya-biryukov Reviewed By: ilya-biryukov Subscribers: javed.absar, jfb, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D50962 llvm-svn: 340604
* [XRay] Refactor loadTraceFile(...) into two (NFC)Dean Michael Berris2018-08-242-7/+15
| | | | | | | | | | This patch splits the file trace loading function into two versions, one that takes a filename and one that takes a `DataExtractor`. This change is a precursor to larger changes to increase test coverage for the trace loading implementation. llvm-svn: 340603
* Fix build bot after r340598.Eric Liu2018-08-241-8/+12
| | | | | | | Revert to the original behavior: only calculate real file path when file is opened and avoid using InterndPath for real path calculation. llvm-svn: 340602
* [clangd] Log memory usage of DexIndex and MemIndexKirill Bobyrev2018-08-249-0/+52
| | | | | | | | | | | | This patch prints information about built index size estimation to verbose logs. This is useful for optimizing memory usage of DexIndex and comparisons with MemIndex. Reviewed by: sammccall Differential Revision: https://reviews.llvm.org/D51154 llvm-svn: 340601
* [clangd] Allow to merge symbols on-the-fly in global-symbol-builderIlya Biryukov2018-08-241-35/+108
| | | | | | | | | | | | | | | | | | | | | | Summary: The new mode avoids serializing and deserializing YAML. This results in better performance and less memory usage. Reduce phase is now almost instant. The default is to use the old mode going through YAML serialization to allow migrating MapReduce clients that require the old mode to operate properly. After we migrate the clients, we can switch the default to the new mode. Reviewers: hokein, ioeric, kbobyrev, sammccall Reviewed By: ioeric Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D51155 llvm-svn: 340600
* [Tooling] Add a isSingleProcess() helper to ToolExecutorIlya Biryukov2018-08-244-0/+13
| | | | | | | | | | | | | | | | Summary: Used in clangd's symbol builder to optimize for the common shared-memory executor case. Reviewers: ioeric Reviewed By: ioeric Subscribers: kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D51164 llvm-svn: 340599
* [FileManager] Do not call 'real_path' in getFile().Eric Liu2018-08-241-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This partially rolls back the change in D48903: https://github.com/llvm-mirror/clang/commit/89aa7f45a1f728144935289d4ce69d8522999de0#diff-0025af005307891b5429b6a834823d5eR318 `real_path` can be very expensive on real file systems, and calling it on each opened file can slow down the compilation. This also slows down deserialized ASTs for which real paths need to be recalculated for each input files again. For clangd code completion latency (using preamble): Before {F7039629} After {F7039630} Reviewers: ilya-biryukov, simark Reviewed By: ilya-biryukov Subscribers: kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D51159 llvm-svn: 340598
* [PDB] Make variables.test to pass using a 32-bit compiler tooAleksandr Urakov2018-08-241-1/+1
| | | | | | | | | | | | | | | | | Summary: `variables.test` depends on mangled names, but the mangling depends on the bitness. This patch specifies the bitness explicitly, so mangled names doesn't differ when a 32-bit version of the compiler is used. Reviewers: stella.stamenova, asmith Reviewed By: stella.stamenova Tags: #lldb Differential Revision: https://reviews.llvm.org/D51158 llvm-svn: 340597
* [AVR] Fix inline asm calls now that the addrspace(0) there is explicit.Chandler Carruth2018-08-241-24/+24
| | | | | | | This updates the test case for r340519 so it should pass again. r340522 only got some of the AVR tests that needed an update. llvm-svn: 340596
* [RISCV] RISC-V using -fuse-init-array by defaultKito Cheng2018-08-242-1/+7
| | | | | | | | | | Reviewers: asb, apazos, mgrang Reviewed By: asb Differential Revision: https://reviews.llvm.org/D50043 llvm-svn: 340595
* [SDAG] Add versions of computeKnownBits that return a valueJustin Bogner2018-08-242-95/+95
| | | | | | | | | | | Having the KnownBits as an output parameter is kind of awkward to use and a holdover from when it was two separate APInts. Instead, just return a KnownBits object. I'm leaving the existing interface in place for now, since updating the callers all at once would be thousands of lines of diff. llvm-svn: 340594
* [hwasan] implement detection of realloc-after-freeKostya Serebryany2018-08-242-1/+33
| | | | llvm-svn: 340593
* Make llvm-profdata show -text work as advertised in the documentation.Richard Smith2018-08-242-2/+12
| | | | | | | | | | | | | | | | | | | Per LLVM's CommandGuide, llvm-profdata show -text is supposed to produce textual output that can be passed as input to further llvm-profdata invocations. This previously didn't work for two reasons: 1) -text was not sufficient to enable the machine-readable text format output; instead, -text was effectively ignored if -counts was not also specified. (With this patch, -counts is instead ignored if -text is specified, because the machine-readable text format always includes counts.) 2) When the input data was an IR-level profile, the :ir marker was missing from the output, resulting in a text format output that would not be usable as profiling data due to function hash mismatches. Differential Revision: https://reviews.llvm.org/D51188 llvm-svn: 340592
* [hwasan] implement detection of double-free (invalid-free)Kostya Serebryany2018-08-244-21/+87
| | | | llvm-svn: 340591
* Attempt to fix ELF/lto-plugin-ignore.s on Windows after r340487.Nico Weber2018-08-241-2/+2
| | | | | | | I removed the ".exe" regex in the wrong place. lld-link in front of the "error:" no longer has the suffix; the --plugin-opt diagnostic still has it. llvm-svn: 340590
* Add more pre-run asserts for the DirCompletionAbsolute testRaphael Isemann2018-08-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The DirCompletionAbsolute is still randomly failing on the nodes even after D50722, so this patch adds more asserts that verify certain properties on which the actual completion implementation relies on. The first assert checks that the directory we complete on actually exists. If the directory doesn't exist on the next CI failure, this assert should catch it and we know that the 0 matches come from a missing base directory. The second assert is just checking that we are below the PATH_MAX limit that the completion checks against. This check could randomly fail if the temporary directories we generate are sometimes longer than PATH_MAX, and the assert can tell us that this is the reason we failed (instead of the mysterious '0 matches'). (As a sidenote: We shouldn't be checking against PATH_MAX anyway in the code (as this is just wrong). Also the disk completion API really needs a better error mechanism than returning 0 on both error or no-results.) Reviewers: aprantl, friss Reviewed By: aprantl Subscribers: abidh Differential Revision: https://reviews.llvm.org/D51111 llvm-svn: 340589
* Make LLVM_ENABLE_CRASH_DUMPS set a variable defaultReid Kleckner2018-08-231-5/+4
| | | | | | | That way users can set the default to true, but then disable core dumps from certain apps that link support. llvm-svn: 340588
* [sanitizer] Don't call task_for_pid(mach_task_self). NFC.Kuba Mracek2018-08-232-14/+2
| | | | | | | | | | Calling task_for_pid with mach_task_self is just returning mach_task_self anyway, but it also triggers system warnings (task_for_pid is only supposed to be used by high-privileged executables). NFC. rdar://problem/39198248 Differential Revision: https://reviews.llvm.org/D51119 llvm-svn: 340587
* Fix typoStephen Kelly2018-08-231-1/+1
| | | | llvm-svn: 340586
* Reuse the SelectorTable from Clang's PreprocessorRaphael Isemann2018-08-232-5/+1
| | | | | | | | | | | | | | | | Summary: At the moment we create our own SelectorTable even though the Preprocessor always creates one for us that we can (and should) reuse. Reviewers: vsk Reviewed By: vsk Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D51185 llvm-svn: 340585
* DebugInfo: Improve debug location mergingDavid Blaikie2018-08-235-33/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a set of related bugs: * Considering two locations as equivalent when their lines are the same but their scopes are different causes erroneous debug info that attributes a commoned call to be attributed to one of the two calls it was commoned from. * The previous code to compute a new location's scope was inaccurate and would use the inlinedAt that was the /parent/ of the inlinedAt that is the nearest common one, and also used that parent scope instead of the nearest common scope. * Not generating new locations generally seemed like a lower quality choice There was some risk that generating more new locations could hurt object size by making more fine grained line table entries, but it looks like that was offset by the decrease in line table (& address & ranges) size caused by more accurately computing the scope - which likely lead to fewer range entries (more contiguous ranges) & reduced size that way. All up with these changes I saw minor reductions (-1.21%, -1.77%) in .rela.debug_ranges and .rela.debug_addr (in a fission, compressed debug info build) as well as other minor size changes (generally reductinos) across the board (-1.32% debug_info.dwo, -1.28% debug_loc.dwo). Measured in an optimized (-O2) build of the clang binary. If you are investigating a size regression in an optimized debug builds, this is certainly a patch to look into - and I'd be happy to look into any major regressions found & see what we can do to address them. llvm-svn: 340583
* [IDF] Make GraphDiff a const constructor argument.Alina Sbirlea2018-08-231-1/+1
| | | | llvm-svn: 340581
* Remove more const_casts by using ConstStmtVisitor [NFC]Aaron Puchert2018-08-231-32/+32
| | | | | | Again, this required adding some const specifiers. llvm-svn: 340580
* Revert r340552, "Driver: Enable address-significance tables by default when ↵Peter Collingbourne2018-08-232-3/+1
| | | | | | | | | targeting COFF." Received multiple reports of breakage due to undefined symbols suspected to be caused by this change. llvm-svn: 340579
* Restrict the set of plugins used for ProcessMinidumpLeonard Mosescu2018-08-232-8/+15
| | | | | | | | | | | | | | 1. The dynamic loaders should not be needed for loading minidumps and they may create problems (ex. the macOS loader resets the list of loaded sections, which for minidumps are already set up during minidump loading) 2. In general, the extra plugins can do extraneous work which hurts performance (ex. trying to set up implicit symbolic breakpoints, which in turn will trigger extra debug information loading) Differential Revision: https://reviews.llvm.org/D51176 llvm-svn: 340578
* [MemorySSA] Fix def optimization handlingGeorge Burgess IV2018-08-232-19/+166
| | | | | | | | | | | | | | | | | | | | | | In order for more complex updates of MSSA to happen (e.g. those in D45299), MemoryDefs need to be actual `Use`s of what they're optimized to. This patch makes that happen. In addition, this patch changes our optimization behavior for Defs slightly: we'll now consider a Def optimization invalid if the MemoryAccess it's optimized to changes. That we weren't doing this before was a bug, but given that we were tracking these with a WeakVH before, it was sort of difficult for that to matter. We're already have both of these behaviors for MemoryUses. The difference is that a MemoryUse's defining access is always its optimized access, and defining accesses are always `Use`s (in the LLVM sense). Nothing exploded when testing a stage3 clang+llvm locally, so... This also includes the test-case promised in r340461. llvm-svn: 340577
* [sanitizer] Change Mmap*NoAccess to return nullptr on errorKostya Kortchinsky2018-08-237-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: `MmapNoAccess` & `MmapFixedNoAccess` return directly the result of `internal_mmap`, as opposed to other Mmap functions that return nullptr. This inconsistency leads to some confusion for the callers, as some check for `~(uptr)0` (`MAP_FAILED`) for failure (while it can fail with `-ENOMEM` for example). Two potential solutions: change the callers, or make the functions return `nullptr` on failure to follow the precedent set by the other functions. The second option looked more appropriate to me. Correct the callers that were wrongly checking for `~(uptr)0` or `MAP_FAILED`. TODO for follow up CLs: - There are a couple of `internal_mmap` calls in XRay that check for MMAP_FAILED as a result as well (cc: @dberris); they should use `internal_iserror`; Reviewers: eugenis, alekseyshl, dberris, kubamracek Reviewed By: alekseyshl Subscribers: kristina, kubamracek, delcypher, #sanitizers, dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D50940 llvm-svn: 340576
* Remove unnecessary const_cast [NFC]Aaron Puchert2018-08-231-7/+7
| | | | | | | | This required adding a few const specifiers on functions. Also a minor formatting fix suggested in D49885. llvm-svn: 340575
* Change xfail to skipIf. The exact condition is really difficult to getAdrian Prantl2018-08-231-1/+1
| | | | | | right and doesn't add much signal. llvm-svn: 340574
* XFAIL test for older versions of clangAdrian Prantl2018-08-231-1/+1
| | | | llvm-svn: 340573
* [MIPS GlobalISel] Lower i8 and i16 argumentsPetar Jovanovic2018-08-233-55/+427
| | | | | | | | | | | | Lower integer arguments smaller than i32. Support both register and stack arguments. Define setLocInfo function for setting LocInfo field in ArgLocs vector. Patch by Petar Avramovic. Differential Revision: https://reviews.llvm.org/D51031 llvm-svn: 340572
* Fix broken builtin functions in the expression commandRaphael Isemann2018-08-233-4/+64
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Calling any non-libc builtin function in the expression command currently just causes Clang to state that the function is not known. The reason for this is that we actually never initialize the list of builtin functions in the Builtin::Context. This patch just calls the initializer for the builtins in the preprocessor. Also adds some tests for the new builtins. It also gets rid of the extra list of builtins in the ClangExpressionParser, as we can just reuse the existing list in the Preprocessor for the ASTContext. Having just one list of builtins around is also closer to the standard Clang behavior. Reviewers: #lldb, vsk Reviewed By: vsk Subscribers: sgraenitz, clayborg, vsk, lldb-commits Differential Revision: https://reviews.llvm.org/D50481 llvm-svn: 340571
* [llvm-mca] Fix parameter name. NFC.Walter Lee2018-08-231-2/+2
| | | | llvm-svn: 340570
* [WebAssembly] Prioritize splats over v128.constsThomas Lively2018-08-232-0/+37
| | | | | | | | | | | | | | Summary: Splats are fewer bytes than v128.consts, so use them when either could apply. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D51179 llvm-svn: 340569
* Revert "[PPC64] Fix DQ-form instruction handling and emit error for misalign..."Sean Fertile2018-08-234-119/+7
| | | | | | | | This reverts commit 5125b44dbb5d06b715213e4bec75c7346bfcc7d3. ppc64-dq.s and ppc64-error-missaligned-dq.s fail on several of the build-bots. Reverting to investigate. llvm-svn: 340568
* Remove the use of pair inside the tuple in concat_iterator.Alina Sbirlea2018-08-231-9/+12
| | | | | | | | | | | | | | Summary: Remove the use of pair inside the tuple in concat_iterator, and create separate begins and ends tuples instead. This fixes the failure for llvm <= 3.7 and libstd++ that broke the hexagon build. Reviewers: timshen Subscribers: sanjoy, jlebar, dexonsmith, kparzysz, llvm-commits Differential Revision: https://reviews.llvm.org/D51067 llvm-svn: 340567
* [llvm-mca] Set the Selection strategy to Default if nullptr is passed.Matt Davis2018-08-232-7/+20
| | | | | | * Set (not reset) the strategy in Scheduler::setCustomStrategyImpl() llvm-svn: 340566
* [x86] move/add tests for insertelement with variable index; NFCSanjay Patel2018-08-232-354/+677
| | | | | | | | The variable index pattern is different than the constant index cases as shown in D51125. We might want to splat regardless of whether the scalar is loaded from memory or transferred from GPR. llvm-svn: 340565
* [PPC64] Fix DQ-form instruction handling and emit error for misalignment.Sean Fertile2018-08-234-7/+119
| | | | | | | | | | | Fixes the handling of *_DS relocations used on DQ-form instructions where we were overwriting some of the extended opcode bits. Also adds an alignment check so that the user will receive a diagnostic error if the value we are writing is not properly aligned. Differential Revision: https://reviews.llvm.org/D51124 llvm-svn: 340564
* [LoopVectorize][NFCI] Use find instead of countDavid Bolvansky2018-08-231-42/+58
| | | | | | | | | | | | | | | | | Summary: Avoid "count" if possible -> use "find" to check for the existence of keys. Passed llvm test suite. Reviewers: fhahn, dcaballe, mkuper, rengolin Reviewed By: fhahn Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D51054 llvm-svn: 340563
* Fix format string issue introduced in r340548Walter Lee2018-08-231-1/+1
| | | | | | Make format string portable. llvm-svn: 340562
* Fixup AreCoreFilesPrevented() to consider first LLVM_ENABLE_CRASH_DUMPS and ↵Douglas Yung2018-08-231-1/+1
| | | | | | | | | secondly coreFilesPrevented. The previous change ignored the latter resulting in crash dumps being generated when LLVM_ENABLE_CRASH_DUMPS was set, but coreFilesPrevented was true. llvm-svn: 340561
* [cmake] Add option to skip building lldb-serverAlex Langford2018-08-233-2/+4
| | | | | | | | | | | | | | | Summary: There is currently a way to skip the debugserver build. See how the CMake variables SKIP_DEBUGSERVER and LLDB_CODESIGN_IDENTITY are used if you're interested in that. This allows us to skip building lldb-server as well. There is another debug server called ds2 that can be used with LLDB. If you choose to use ds2, this flag is very useful because it can cut down the build time of LLDB. Differential Revision: https://reviews.llvm.org/D49282 llvm-svn: 340560
* [docs] Regenerate ClangCommandLineReference.rstVedant Kumar2018-08-231-96/+192
| | | | llvm-svn: 340559
* [options] Document -(static|shared)-libsanVedant Kumar2018-08-231-2/+4
| | | | llvm-svn: 340558
* Fix check for dictionary entryAdrian Prantl2018-08-231-1/+1
| | | | llvm-svn: 340557
* [ValueTracking] Fix assert message and add test case for r340546 and PR38677.Craig Topper2018-08-232-1/+34
| | | | | | The bug was already fixed. This just adds a test case for it. llvm-svn: 340556
* COFF: Implement safe ICF on rodata using address-significance tables.Peter Collingbourne2018-08-237-2/+105
| | | | | | Differential Revision: https://reviews.llvm.org/D51050 llvm-svn: 340555
* [DEBUGINFO] Fix misprint in the name of DebugDirectivesOnly, NFC.Alexey Bataev2018-08-231-1/+1
| | | | llvm-svn: 340553
OpenPOWER on IntegriCloud