summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [CodeComplete] Re-fix accessibilty of protected members from base class.Eric Liu2018-10-022-7/+21
| | | | | | | | | | | | | | | Summary: The initial fix (r337453) had bug and was partially reverted (r338255). This simplies the original fix by explicitly passing the naming class to the completion consumer. Reviewers: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52647 llvm-svn: 343575
* Revert untintentionally commited changesEric Liu2018-10-021-3/+3
| | | | llvm-svn: 343574
* [Lex] TokenConcatenation now takes const PreprocessorEric Liu2018-10-021-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D52502 llvm-svn: 343573
* [clang] Implement Override Suggestions in Sema.Kadir Cetinkaya2018-10-021-2/+99
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: In clangd we had a new type of completion suggestions for cpp class/struct/unions that will show override signatures for virtual methods in base classes. This patch implements it in sema because it is hard to deduce more info about completion token outside of Sema and handle itchy cases. See the patch D50898 for more info on the functionality. In addition to above patch this one also converts the suggestion into a CK_Pattern with whole insertion text as the name of the suggestion and factors out CodeCompletionString generation for declerations so that it can be re-used by others. Reviewers: ioeric, ilya-biryukov Reviewed By: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52225 llvm-svn: 343568
* Added warning for unary minus used with unsigned typeDavid Bolvansky2018-10-021-0/+13
| | | | | | | | | | | | | | | | | Summary: Inspired by MSVC, which found some occurrences of this expression on our code base. Fixes PR38950 Reviewers: rsmith, craig.topper, spatel, RKSimon, aaron.ballman, thakis Reviewed By: rsmith Subscribers: joerg, Quuxplusone, lebedev.ri, craig.topper, RKSimon, cfe-commits Differential Revision: https://reviews.llvm.org/D52137 llvm-svn: 343560
* [CodeGen] Before entering the loop that copies a non-trivial array fieldAkira Hatanaka2018-10-021-0/+2
| | | | | | | | | | | | of a non-trivial C struct, copy the preceding trivial fields that haven't been copied. This commit fixes a bug where the instructions used to copy the preceding trivial fields were emitted inside the loop body. rdar://problem/44185064 llvm-svn: 343556
* Distinguish `__block` variables that are captured by escaping blocksAkira Hatanaka2018-10-0112-64/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. This reapplies r343518 after fixing a use-after-free bug in function Sema::ActOnBlockStmtExpr where the BlockScopeInfo was dereferenced after it was popped and deleted. rdar://problem/39352313 Differential Revision: https://reviews.llvm.org/D51564 llvm-svn: 343542
* [MinGW] Allow using ASanMartin Storsjo2018-10-013-4/+31
| | | | | | | | | | | | | | | | | | Linking to ASan for MinGW is similar to MSVC, but MinGW always links the MSVCRT dynamically, so there is only one of the MSVC cases to consider. When linking to a shared compiler runtime library on MinGW, the suffix of the import library is .dll.a. The existing case of .dll as suffix for windows in general doesn't seem correct (since this is used for linking). As long as callers never actually set the Shared flag, the default static suffix of .lib also worked fine for import libraries as well. Differential Revision: https://reviews.llvm.org/D52538 llvm-svn: 343537
* Revert r343518.Akira Hatanaka2018-10-0112-116/+57
| | | | | | | | | Bots are still failing. http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/24420 http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/12958 llvm-svn: 343531
* Distinguish `__block` variables that are captured by escaping blocksAkira Hatanaka2018-10-0112-57/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. This reapplies r341754, which was reverted in r341757 because it broke a couple of bots. r341754 was calling markEscapingByrefs after the call to PopFunctionScopeInfo, which caused the popped function scope to be cleared out when the following code was compiled, for example: $ cat test.m struct A { id data[10]; }; void foo() { __block A v; ^{ (void)v; }; } This commit calls markEscapingByrefs before calling PopFunctionScopeInfo to prevent that from happening. rdar://problem/39352313 Differential Revision: https://reviews.llvm.org/D51564 llvm-svn: 343518
* [clang-format] Update comment, NFCIKrasimir Georgiev2018-10-011-4/+0
| | | | | | | | The initializer of `ParameterCount` was updated from 1 to 0 in r175165, but the comment was never touched: https://github.com/llvm-mirror/clang/commit/9fc56f2636137fcde8acb38865555ed6c7b84dfd llvm-svn: 343517
* [clang-format] Fix typo in comment, NFCIKrasimir Georgiev2018-10-011-1/+1
| | | | llvm-svn: 343513
* [analyzer][NFC] Refactor functions in PlistDiagnostics to take Preproc as ↵Kristof Umann2018-10-011-71/+72
| | | | | | | | | | parameter This is patch is a preparation for the proposed inclusion of macro expansions in the plist output. Differential Revision: https://reviews.llvm.org/D52735 llvm-svn: 343511
* [OPENMP][NVPTX] Handle `requires datasharing` flag correctly withAlexey Bataev2018-10-011-1/+27
| | | | | | | | lightweight runtime. The datasharing flag must be set to `1` when executing SPMD-mode compatible directive with reduction|lastprivate clauses. llvm-svn: 343492
* [OPENMP] Simplify code, NFC.Alexey Bataev2018-10-011-2/+0
| | | | llvm-svn: 343483
* [Preprocessor] Fix a crash when handling non-alpha include header.Haojian Wu2018-10-011-7/+10
| | | | | | | | | | | | | Summary: the crash is casued by an assertion in StringRef. (llvm::StringRef::front() const: Assertion `!empty()' failed.) Reviewers: sammccall Subscribers: jsji, cfe-commits Differential Revision: https://reviews.llvm.org/D52721 llvm-svn: 343481
* [OPENMP] Fix enum identifier, NFC.Alexey Bataev2018-10-011-1/+1
| | | | llvm-svn: 343479
* Add support for unified_shared_memory clause on requires directivePatrick Lyster2018-10-0110-0/+43
| | | | llvm-svn: 343472
* [CodeComplete] #include completion treats -I as non-system (require ↵Sam McCall2018-10-011-1/+1
| | | | | | header-like extension). llvm-svn: 343457
* Use the container form llvm::sort(C, ...)Fangrui Song2018-09-307-26/+23
| | | | | | | | | There are a few leftovers of rC343147 that are not (\w+)\.begin but in the form of ([-[:alnum:]>.]+)\.begin or spanning two lines. Change them to use the container form in this commit. The 12 occurrences have been inspected manually for safety. llvm-svn: 343425
* Fix linkage error on ProgramPoint's dump method.Eric Fiselier2018-09-301-0/+4
| | | | | | | | | | | | Currently, ProgramPoint::dump calls the out-of-line function ProgramPoint::print. This causes libraries which include ProgramPoint.h to become dependent on libclangAnalysis, which in turn causes missing symbol link error when building with -DBUILD_SHARED_LIBS=ON -DLLVM_ENABLE_MODULES=ON. The breakage was introduced in r343160. This patch fixes the issues by moving ProgramPoint::dump's declaration out of line. llvm-svn: 343420
* [X86] Add more of the icc unaligned load/store to/from 128 bit vector intrinsicsCraig Topper2018-09-291-1/+106
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds _mm_loadu_si32 _mm_loadu_si16 _mm_storeu_si64 _mm_storeu_si32 _mm_storeu_si16 We already had _mm_load_si64. Reviewers: spatel, RKSimon Reviewed By: RKSimon Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52665 llvm-svn: 343388
* Support enums with a fixed underlying type in all language modes.Erik Pilkington2018-09-281-13/+11
| | | | | | | | | | Previously we supported these in C++, ObjC, and C with -fms-extensions. rdar://43831380 Differential revision: https://reviews.llvm.org/D52339 llvm-svn: 343360
* [OPENMP]Fix PR39084: Check datasharing attributes of reduction variables only.Alexey Bataev2018-09-281-60/+58
| | | | | | | | According to OpenMP, the reduction item must be shared in parent region. But the item can be an array section or array subscript. In this case, we should not check for the datasharing of the base declaration. llvm-svn: 343356
* [analyzer] [NFC] Remove unused parameters, as found by -Wunused-parameterGeorge Karpenkov2018-09-2828-175/+104
| | | | | | Differential Revision: https://reviews.llvm.org/D52640 llvm-svn: 343353
* [analyzer] Provide an option to dump generated exploded graphs to a given file.George Karpenkov2018-09-283-5/+34
| | | | | | | | | | | Dumping graphs instead of opening them is often very useful, e.g. for transfer or converting to SVG. Basic sanity check for generated exploded graphs. Differential Revision: https://reviews.llvm.org/D52637 llvm-svn: 343352
* [cxx2a] P0614R1: Support init-statements in range-based for loops.Richard Smith2018-09-2815-125/+247
| | | | | | | We don't yet support this for the case where a range-based for loop is implicitly rewritten to an ObjC for..in statement. llvm-svn: 343350
* [X86] Add the movbe instruction intrinsics from icc.Craig Topper2018-09-282-0/+62
| | | | | | | | | | These intrinsics exist in icc. They can be found on the Intel Intrinsics Guide website. All the backend support is in place to pattern match a load+bswap or a bswap+store pattern to the MOVBE instructions. So we just need to get the frontend to emit the correct IR. The pointer arguments in icc are declared as void so I had to jump through a packed struct to forcing a specific alignment on the load/store. Same trick we use in the unaligned vector load/store intrinsics Differential Revision: https://reviews.llvm.org/D52586 llvm-svn: 343343
* AST: add missing ObjC extensions to MS style name decorationSaleem Abdulrasool2018-09-281-3/+30
| | | | | | | | | | | | | | | | | | | | | | | Add support for encoding type arguments for lightweight generics in Objective-C++ mode. Additionally, add support for the `__kindof` modifier. This should complete the coverage of the ObjC extensions that clang currently supports under the MS style name decoration scheme. This is implemented similar to the Objective-C lifetime qualifiers decoration: a template specialization in the `__ObjC` namespace so that we can interoperate with Microsoft's tools as well as ensure that we do not accidentally collide with new features in the Microsoft implementation. Since the `__kindof` appertains to the type and not the pointer, we apply the template specialization to the underlying type instead of the pointer type. Unfortunately, until D52581 is resolved, the generated name is not really compatible with the MS tools as well as breaks interoperability with Objective-C++ and C++. This resolves PR37754! llvm-svn: 343338
* [DRIVER][OFFLOAD] Do not invoke unbundler on unsupported file types.Alexey Bataev2018-09-281-0/+18
| | | | | | | | | clang-offload-bundler should not be invoked with the unbundling action when the input file type does not match the action type. For example, .so files should be unbundled during linking phase and should be linked only with the host code. llvm-svn: 343335
* [ARM] Prevent DSP and SIM32 being set for v6mSam Parker2018-09-281-1/+1
| | | | | | | | | My previous change (rL340911) set the two features for architectures >= 6, which wrongly includes v6m. Now set to >= 6 and not Cortex-M. Differential Revision: https://reviews.llvm.org/D52644 llvm-svn: 343309
* [ClangFormat] 'try' of function-try-block doesn't obey BraceWrappingOwen Pan2018-09-281-0/+2
| | | | | | | | It should respond to AfterFunction, not AfterControlStatement. Fixes PR39067 llvm-svn: 343305
* Handle dependent class template names in class template argumentRichard Smith2018-09-281-1/+4
| | | | | | deduction for new-expressions. llvm-svn: 343293
* [cxx2a] P0641R2: (Some) type mismatches on defaulted functions onlyRichard Smith2018-09-281-13/+46
| | | | | | | | | | | | | | | | render the function deleted instead of rendering the program ill-formed. This change also adds an enabled-by-default warning for the case where an explicitly-defaulted special member function of a non-template class is implicitly deleted by the type checking rules. (This fires either due to this language change or due to pre-C++20 reasons for the member being implicitly deleted). I've tested this on a large codebase and found only bugs (where the program means something that's clearly different from what the programmer intended), so this is enabled by default, but we should revisit this if there are problems with this being enabled by default. llvm-svn: 343285
* [cxx2a] P0624R2: Lambdas with no capture-default areRichard Smith2018-09-273-1/+31
| | | | | | default-constructible and assignable. llvm-svn: 343279
* [analyzer] Hotfix for the bug in exploded graph printingGeorge Karpenkov2018-09-271-0/+2
| | | | llvm-svn: 343276
* NFC: Fix some darwin linker warnings introduced in r338385Erik Pilkington2018-09-274-8/+8
| | | | | | | | | | The darwin linker was complaining about Toolchains/RISCV.cpp and Toolchains/Arch/RISCV.cpp had the same name. Fix is to just rename Toolchains/RISCV.cpp to Toolchains/RISCVToolchain.cpp. Differential revision: https://reviews.llvm.org/D52574 llvm-svn: 343263
* [OpenMP] Make default parallel for schedule in NVPTX target regions in SPMD ↵Gheorghe-Teodor Bercea2018-09-274-1/+27
| | | | | | | | | | | | | | | | mode achieve coalescing Summary: Set default schedule for parallel for loops to schedule(static, 1) when using SPMD mode on the NVPTX device offloading toolchain to ensure coalescing. Reviewers: ABataev, Hahnfeld, caomhin Reviewed By: ABataev Subscribers: jholewinski, guansong, cfe-commits Differential Revision: https://reviews.llvm.org/D52629 llvm-svn: 343260
* Test commit. NFCPatrick Lyster2018-09-271-1/+1
| | | | llvm-svn: 343258
* [OpenMP] Make default distribute schedule for NVPTX target regions in SPMD ↵Gheorghe-Teodor Bercea2018-09-274-0/+27
| | | | | | | | | | | | | | | | mode achieve coalescing Summary: For the OpenMP NVPTX toolchain choose a default distribute schedule that ensures coalescing on the GPU when in SPMD mode. This significantly increases the performance of offloaded target code and reduces the number of registers used on the GPU side. Reviewers: ABataev, caomhin, Hahnfeld Reviewed By: ABataev, Hahnfeld Subscribers: Hahnfeld, jholewinski, guansong, cfe-commits Differential Revision: https://reviews.llvm.org/D52434 llvm-svn: 343253
* [analyzer] Highlight nodes which have error reports in them in red in ↵George Karpenkov2018-09-271-25/+65
| | | | | | | | exploded graph Differential Revision: https://reviews.llvm.org/D52584 llvm-svn: 343239
* [OpenMP] Improve search for libomptarget-nvptxJonas Hahnfeld2018-09-271-6/+14
| | | | | | | | | | | | | | | When looking for the bclib Clang considered the default library path first while it preferred directories in LIBRARY_PATH when constructing the invocation of nvlink. The latter actually makes more sense because during development it allows using a non-default runtime library. So change the search for the bclib to start looking in directories given by LIBRARY_PATH. Additionally add a new option --libomptarget-nvptx-path= which will be searched first. This will be handy for testing purposes. Differential Revision: https://reviews.llvm.org/D51686 llvm-svn: 343230
* [Tooling] Get rid of uses of llvm::Twine::str which is slow. NFCEric Liu2018-09-271-4/+5
| | | | llvm-svn: 343224
* Revert untintentionally commited changesKristof Umann2018-09-271-3/+3
| | | | llvm-svn: 343205
* [Lex] TokenConcatenation now takes const PreprocessorKristof Umann2018-09-272-5/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D52502 llvm-svn: 343204
* [Sema] Handle __va_start for Windows/ARM64 in the same way as for ARMMartin Storsjo2018-09-271-0/+1
| | | | | | | | This fixes PR39090. Differential Revision: https://reviews.llvm.org/D52571 llvm-svn: 343184
* Revert "[DebugInfo] Generate debug information for labels."Vitaly Buka2018-09-273-39/+0
| | | | | | | | This reverts commit r343148. It crashes on sanitizer-x86_64-linux-autoconf. llvm-svn: 343183
* clang-format: [JS] conditional types.Martin Probst2018-09-272-0/+8
| | | | | | | | | | | | | | | | | | | | | Summary: This change adds some rudimentary support for conditional types. Specifically it avoids breaking before `extends` and `infer` keywords, which are subject to Automatic Semicolon Insertion, so breaking before them creates incorrect syntax. The actual formatting of the type expression is odd, but there is as of yet no clear idea on how to format these. See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#conditional-types. Reviewers: krasimir Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52536 llvm-svn: 343179
* [driver][mips] Adjust target triple accordingly to provided ABI nameSimon Atanasyan2018-09-271-0/+10
| | | | | | | | | | | | | Explicitly selected MIPS ABI using the `-mabi` option implies corresponding target triple. For 'O32' ABI it's a 32-bit target triple like `mips-linux-gnu`. For 'N32' and 'N64' ABIs it's a 64-bit target triple like `mips64-linux-gnu`. This patch adjusts target triple accordingly these rules like we do for pseudo-target flags '-m64', '-m32' etc already. Differential revision: https://reviews.llvm.org/D52290 llvm-svn: 343169
* [analyzer] [NFC] Move the code for dumping the program point to ProgramPointGeorge Karpenkov2018-09-272-179/+172
| | | | | | | | So we can dump them outside of viewing the exploded grpah. Differential Revision: https://reviews.llvm.org/D52583 llvm-svn: 343160
OpenPOWER on IntegriCloud