summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Enhance -Wc++14-compat for class template argument deduction to list theRichard Smith2018-09-103-8/+14
| | | | | | deduced type (if known). llvm-svn: 341858
* [clang-cl] Enable -march optionAlexandre Ganea2018-09-102-1/+2
| | | | | | | | This change allows usage of -march when using the clang-cl driver. This is similar to MSVC's /arch; however -march can target precisely all supported CPUs, while /arch has a more restricted set. Differential Revision: https://reviews.llvm.org/D51806 llvm-svn: 341847
* Remove all uses of DIFlagBlockByrefStructAdrian Prantl2018-09-103-23/+47
| | | | | | | | | | | | This patch removes the last reason why DIFlagBlockByrefStruct from Clang by directly implementing the drilling into the member type done in DwarfDebug::DbgVariable::getType() into the frontend. rdar://problem/31629055 Differential Revision: https://reviews.llvm.org/D51807 llvm-svn: 341842
* Prevent cpu-specific/cpu-dispatch from giong on a lambda.Erich Keane2018-09-102-0/+11
| | | | | | | It is non-sensical to use cpu-specific/cpu-dispatch multiversioning on a lambda, so prevent it when trying to add the attribute. llvm-svn: 341833
* [clang] Make sure codecompletion is called for calls even when inside a token.Kadir Cetinkaya2018-09-108-4/+88
| | | | | | | | | | | | | | | | | Summary: Currently CodeCompleteCall only gets called after a comma or parantheses. This patch makes sure it is called even at the cases like: ```foo(1^);``` Reviewers: ilya-biryukov, ioeric, hokein Reviewed By: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D51038 llvm-svn: 341824
* [Analyzer] Commit fix for rL341790/rC341790Adam Balogh2018-09-101-0/+175
| | | | | | Test file was accidentally not added for rL341790/rC341790 and subsequant patches. llvm-svn: 341795
* [Analyzer] Iterator Checker - Part 8: Support for assign, clear, insert, ↵Adam Balogh2018-09-104-3/+616
| | | | | | | | | | emplace and erase operations This patch adds support for the following operations in the iterator checkers: assign, clear, insert, insert_after, emplace, emplace_after, erase and erase_after. This affects mismatched iterator checks ("this" and parameter must match) and invalidation checks (according to the standard). Differential Revision: https://reviews.llvm.org/D32904 llvm-svn: 341794
* [Analyzer] Iterator Checker - Part 7: Support for push and pop operationsAdam Balogh2018-09-105-1/+550
| | | | | | | | This patch adds support for the following operations in the iterator checkers: push_back, push_front, emplace_back, emplace_front, pop_back and pop_front. This affects iterator range checks (range is extended after push and emplace and reduced after pop operations) and invalidation checks (according to the standard). Differential Revision: https://reviews.llvm.org/D32902 llvm-svn: 341793
* [Analyzer] Iterator Checker - Part 6: Mismatched iterator checker for ↵Adam Balogh2018-09-101-1/+60
| | | | | | | | | | constructors and comparisons Extension of the mismatched iterator checker for constructors taking range of first..last (first and last must be iterators of the same container) and also for comparisons of iterators of different containers (one does not compare iterators of different containers, since the set of iterators is partially ordered, there are no relations between iterators of different containers, except that they are always non-equal). Differential Revision: https://reviews.llvm.org/D32860 llvm-svn: 341792
* [Analyzer] Iterator Checker - Part 5: Move Assignment of ContainersAdam Balogh2018-09-101-6/+153
| | | | | | | | If a container is moved by its move assignment operator, according to the standard all their iterators except the past-end iterators remain valid but refer to the new container. This patch introduces support for this case in the iterator checkers. Differential Revision: https://reviews.llvm.org/D32859 llvm-svn: 341791
* [Analyzer] Iterator Checker - Part 4: Mismatched iterator checker for ↵Adam Balogh2018-09-104-5/+130
| | | | | | | | | | function parameters New check added to the checker which checks whether iterator parameters of template functions typed by the same template parameter refer to the same container. Differential Revision: https://reviews.llvm.org/D32845 llvm-svn: 341790
* ReleaseNotes: update links to use httpsHans Wennborg2018-09-101-9/+9
| | | | llvm-svn: 341786
* PR33222: Require the declared return type not the actual return type toRichard Smith2018-09-105-13/+88
| | | | | | | | | match when checking for redeclaration of a function template. This properly handles differences in deduced return types, particularly when performing redeclaration checks for a friend function template. llvm-svn: 341778
* Part of PR33222: defer enforcing return type mismatch for dependentRichard Smith2018-09-103-19/+85
| | | | | | friend function declarations of class templates. llvm-svn: 341775
* [OpenMP] Add support for nested 'declare target' directivesKelvin Li2018-09-107-23/+59
| | | | | | | | | | | Add the capability to nest multiple declare target directives - including header files within a declare target region. Differential Revision: https://reviews.llvm.org/D51378 Patch by Patrick Lyster llvm-svn: 341766
* [Sema] Make typo correction slightly more efficientFangrui Song2018-09-091-2/+2
| | | | | | edit_distance returns UpperBound+1 if the distance will exceed UpperBound. We can subtract 1 from UpperBound and change >= to > in the if condition. The threshold does not change but edit_distance will have more opportunity to bail out earlier. llvm-svn: 341763
* Fix build bots after a mistake in r341760Hamza Sood2018-09-091-1/+1
| | | | llvm-svn: 341761
* [Tooling] Improve handling of CL-style optionsHamza Sood2018-09-092-37/+149
| | | | | | | | | | | | | | | | | | This patch fixes the handling of clang-cl options in InterpolatingCompilationDatabase. They were previously ignored completely, which led to a lot of bugs: Additional options were being added with the wrong syntax. E.g. a file was specified as C++ by adding -x c++, which causes an error in CL mode. The args were parsed and then rendered, which means that the aliasing information was lost. E.g. /W4 was rendered to -Wall, which in CL mode means -Weverything. CL options were ignored when checking things like -std=, so a lot of logic was being bypassed. Differential Revision: https://reviews.llvm.org/D51321 llvm-svn: 341760
* Revert r341754.Akira Hatanaka2018-09-0930-335/+82
| | | | | | | | | The commit broke a couple of bots: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/12347 http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/7310 llvm-svn: 341757
* [Parser] Remove an unnecessary `mutable`Fangrui Song2018-09-091-1/+1
| | | | llvm-svn: 341756
* ms: Insert $$Z in mangling between directly consecutive parameter packs.Nico Weber2018-09-082-6/+35
| | | | | | | Fixes PR38783. Differential Revision: https://reviews.llvm.org/D51784 llvm-svn: 341755
* Distinguish `__block` variables that are captured by escaping blocksAkira Hatanaka2018-09-0830-82/+335
| | | | | | | | | | | | | | | | | | | | | | | | from those that aren't. This patch changes the way __block variables that aren't captured by escaping blocks are handled: - Since non-escaping blocks on the stack never get copied to the heap (see https://reviews.llvm.org/D49303), Sema shouldn't error out when the type of a non-escaping __block variable doesn't have an accessible copy constructor. - IRGen doesn't have to use the specialized byref structure (see https://clang.llvm.org/docs/Block-ABI-Apple.html#id8) for a non-escaping __block variable anymore. Instead IRGen can emit the variable as a normal variable and copy the reference to the block literal. Byref copy/dispose helpers aren't needed either. rdar://problem/39352313 Differential Revision: https://reviews.llvm.org/D51564 llvm-svn: 341754
* Do not use optimized atomic libcalls for misaligned atomics.Richard Smith2018-09-072-14/+47
| | | | | | | | | | | | | | | | | Summary: The optimized (__atomic_foo_<n>) libcalls assume that the atomic object is properly aligned, so should never be called on an underaligned object. This addresses one of several problems identified in PR38846. Reviewers: jyknight, t.p.northover Subscribers: jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D51817 llvm-svn: 341734
* [analyzer] [NFC] Move methods for dumping the coverage in HTMLDiagnostics ↵George Karpenkov2018-09-071-5/+12
| | | | | | | | into the class Differential Revision: https://reviews.llvm.org/D51513 llvm-svn: 341724
* [analyzer] [NFC] Use StringRef when returning a large string literal in ↵George Karpenkov2018-09-071-5/+6
| | | | | | | | | | HTMLDiagnostics (NB: could be a clang-tidy / analyzer check) Differential Revision: https://reviews.llvm.org/D51512 llvm-svn: 341723
* [analyzer] Remove the "postponed" hack, deal with derived symbols using an ↵George Karpenkov2018-09-073-22/+45
| | | | | | | | | | | | | | | | | | | | extra map The "derived" symbols indicate children fields of a larger symbol. As parents do not have pointers to their children, the garbage collection algorithm the analyzer currently uses adds such symbols into a "postponed" category, and then keeps running through the worklist until the fixed point is reached. The current patch rectifies that by instead using a helper map which stores pointers from parents to children, so that no fixed point calculation is necessary. The current patch yields ~5% improvement in running time on sqlite. Differential Revision: https://reviews.llvm.org/D51397 llvm-svn: 341722
* Revert "Revert "Revert "Revert "[analyzer] Add coverage information to plist ↵George Karpenkov2018-09-0772-13021/+14118
| | | | | | | | | | output, update tests"""" This reverts commit 2f5d71d9fa135be86bb299e7d773036e50bf1df6. Hopefully fixing tests on Windows. llvm-svn: 341719
* Make -Watomic-alignment say whether the atomic operation was oversizedRichard Smith2018-09-073-10/+14
| | | | | | or misaligned. llvm-svn: 341710
* PR38870: Add warning for zero-width unicode characters appearing inRichard Smith2018-09-073-3/+28
| | | | | | identifiers. llvm-svn: 341700
* [X86] Custom emit __builtin_rdtscp so we can emit an explicit store for the ↵Craig Topper2018-09-072-0/+15
| | | | | | | | | | out parameter This is the clang side of D51803. The llvm intrinsic now returns two results. So we need to emit an explicit store in IR for the out parameter. This is similar to addcarry/subborrow/rdrand/rdseed. Differential Revision: https://reviews.llvm.org/D51805 llvm-svn: 341699
* warn_stdlibcxx_not_found: suggest '-stdlib=libc++' instead of '-std'Alex Lorenz2018-09-072-2/+2
| | | | | | Addresses first post-commit feedback for r335081 from Nico llvm-svn: 341697
* [X86] Modify addcarry/subborrow builtins to emit an 2 result and intrinsic ↵Craig Topper2018-09-073-6/+59
| | | | | | | | | | and an store instruction. This is the clang side of D51769. The llvm intrinsics now return two results instead of using an out parameter. Differential Revision: https://reviews.llvm.org/D51771 llvm-svn: 341678
* Revert "[OPENMP][NVPTX] Disable runtime-type info for CUDA devices."Alexey Bataev2018-09-072-73/+0
| | | | | | Still need the RTTI for NVPTX target to pass sema checks. llvm-svn: 341668
* [CodeComplete] Clearly distinguish signature help and code completion.Ilya Biryukov2018-09-077-56/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Code completion in clang is actually a mix of two features: - Code completion is a familiar feature. Results are exposed via the CodeCompleteConsumer::ProcessCodeCompleteResults callback. - Signature help figures out if the current expression is an argument of some function call and shows corresponding signatures if so. Results are exposed via CodeCompleteConsumer::ProcessOverloadCandidates. This patch refactors the implementation to untangle those two from each other and makes some naming tweaks to avoid confusion when reading the code. The refactoring is required for signature help fixes, see D51038. The only intended behavior change is the order of callbacks. ProcessOverloadCandidates is now called before ProcessCodeCompleteResults. Reviewers: sammccall, kadircet Reviewed By: sammccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51782 llvm-svn: 341660
* [libclang] Return the proper pointee type for 'auto' deduced to pointerIvan Donchevskii2018-09-072-0/+10
| | | | | | | | Currently the resulting type is always invalid in such case. Differential Revision: https://reviews.llvm.org/D51281 llvm-svn: 341656
* Differential Revision: https://reviews.llvm.org/D50246Kristina Brooks2018-09-073-6/+65
| | | | | | | | | | [RISCV] Add support for computing sysroot for riscv32-unknown-elf Extends r338385 to allow the driver to compute the sysroot when an explicit path is not provided. This allows the linker to find C runtime files and the correct include directory for header files. Patch by lewis-revill (Lewis Revill) llvm-svn: 341655
* Reland r341390 clang-cl: Pass /Brepro to linker if it was passed to the compilerNico Weber2018-09-072-0/+21
| | | | | | | | | | The test was missing '--' on mac as pointed out by -Wslash-u-filename: <stdin>:5:69: note: possible intended match here clang: warning: '/Users/thakis/src/llvm-mono/clang/test/Driver/msvc-link.c' treated as the '/U' option [-Wslash-u-filename] Differential Revision: https://reviews.llvm.org/D51635 llvm-svn: 341654
* Revert "Revert "Revert "[analyzer] Add coverage information to plist output, ↵Simon Pilgrim2018-09-0772-14118/+13021
| | | | | | | | update tests""" Reverts analyzer tests from rL341627 again as they still broke windows buildbots llvm-svn: 341648
* Replaces __inline by __inline__ / C89 compatibleDiogo N. Sampaio2018-09-071-2/+2
| | | | llvm-svn: 341644
* [MSan] add KMSAN support to Clang driverAlexander Potapenko2018-09-0713-20/+93
| | | | | | | | | | | | | | | Boilerplate code for using KMSAN instrumentation in Clang. We add a new command line flag, -fsanitize=kernel-memory, with a corresponding SanitizerKind::KernelMemory, which, along with SanitizerKind::Memory, maps to the memory_sanitizer feature. KMSAN is only supported on x86_64 Linux. It's incompatible with other sanitizers, but supports code coverage instrumentation. llvm-svn: 341641
* [Sema] Check that the destructor for each element of class type isAkira Hatanaka2018-09-073-1/+160
| | | | | | | | | | accessible from the context where aggregate initialization occurs. rdar://problem/38168772 Differential Revision: https://reviews.llvm.org/D45898 llvm-svn: 341629
* Revert "Revert "[analyzer] Add coverage information to plist output, update ↵George Karpenkov2018-09-0772-13021/+14118
| | | | | | | | | | tests"" This reverts commit a39bcab414dd7ace7e490363ecdf01ecce7743fc. Reverting the revert, fixing tests. llvm-svn: 341627
* Revert "[analyzer] Add coverage information to plist output, update tests"George Karpenkov2018-09-0745-13935/+13128
| | | | | | | | This reverts commit 03d183b6b94eda27ce66a4f9b87a00b0a148cf9e. Temporary revert until the tests are fixed. llvm-svn: 341626
* [analyzer] Add coverage information to plist output, update testsGeorge Karpenkov2018-09-0745-13128/+13935
| | | | | | | | Split tests which were still using FileCheck to compare plists. Differential Revision: https://reviews.llvm.org/D51515 llvm-svn: 341621
* [analyzer] [NFC] Prefer passing around reference to std::unique_ptr&George Karpenkov2018-09-071-9/+9
| | | | | | | | When object is owned elsewhere Differential Revision: https://reviews.llvm.org/D51669 llvm-svn: 341620
* [analyzer] Executed lines: store file IDs, not hashes.George Karpenkov2018-09-073-5/+5
| | | | | | | | Raw FileIDs are needed for the PlistDiagnostics to produce stable filenames. Differential Revision: https://reviews.llvm.org/D51668 llvm-svn: 341619
* [analyzer] Do not add invalid source location to the coverage informationGeorge Karpenkov2018-09-072-0/+30
| | | | | | | | Invalid source locations may arise from generated code. Differential Revision: https://reviews.llvm.org/D51761 llvm-svn: 341618
* [analyzer] Push updating-the-executed-lines logic into the BugReporter.George Karpenkov2018-09-073-21/+22
| | | | | | | | So it can be reused across different consumers. Differential Revision: https://reviews.llvm.org/D51514 llvm-svn: 341617
* [analyzer] Skip printing trivial nodes in exploded graphGeorge Karpenkov2018-09-073-18/+58
| | | | | | | | | | | A node is considered to be trivial if it only has one successor, one predecessor, and a state equal to the predecessor. Can drastically (> 2x) reduce the size of the generated exploded graph. Differential Revision: https://reviews.llvm.org/D51665 llvm-svn: 341616
* [analyzer] [NFC] Move dumping program point into a separate functionGeorge Karpenkov2018-09-061-131/+132
| | | | | | Differential Revision: https://reviews.llvm.org/D51666 llvm-svn: 341603
OpenPOWER on IntegriCloud