summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [clang] Add the exclude_from_explicit_instantiation attributeLouis Dionne2018-10-0411-7/+369
| | | | | | | | | | | | | | | | | | | | | | Summary: This attribute allows excluding a member of a class template from being part of an explicit template instantiation of that class template. This also makes sure that code using such a member will not take for granted that an external instantiation exists in another translation unit. The attribute was discussed on cfe-dev at [1] and is primarily motivated by the removal of always_inline in libc++ to control what's part of the ABI (see links in [1]). [1]: http://lists.llvm.org/pipermail/cfe-dev/2018-August/059024.html rdar://problem/43428125 Reviewers: rsmith Subscribers: dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D51789 llvm-svn: 343790
* [Index] Respect "IndexFunctionLocals" option for type loc.Haojian Wu2018-10-042-1/+8
| | | | | | | | | | | | | | | | Summary: Previously, clang index ignored local symbols defined in the function body even IndexFunctionLocals is true. Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, ioeric, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52877 llvm-svn: 343767
* [constexpr] Fix ICE when memcpy() is given a pointer to an incomplete arrayPetr Pavlu2018-10-044-0/+51
| | | | | | | | | | Fix code for constant evaluation of __builtin_memcpy() and __builtin_memmove() that would attempt to divide by zero when given two pointers to an incomplete array. Differential Revision: https://reviews.llvm.org/D51855 llvm-svn: 343761
* [AArch64][ARM] Context sensitive meaning of cryptoSjoerd Meijer2018-10-044-0/+235
| | | | | | | | | | | | | | For AArch64, crypto means: - sm4 + sha3 + sha2 + aes for Armv8.4-A and up, and - sha2 + aes for Armv8.3-A and earlier. For AArch32: Crypto means sha2 + aes, because the Armv8.2-A crypto instructions were added to AArch64 only. Differential Revision: https://reviews.llvm.org/D50179 llvm-svn: 343758
* [analyzer] [quickfix] Temporarily disabling a failing test.George Karpenkov2018-10-041-0/+3
| | | | llvm-svn: 343747
* [llvm-nm] Update clang tests based on changed llvm-nm outputJordan Rupprecht2018-10-031-1/+2
| | | | llvm-svn: 343744
* [SEMA] split ExtWarn dupl-decl-spec's into Extension and ExtWarnNick Desaulniers2018-10-034-4/+27
| | | | | | | | | | | | | | | | | | | | | | | Summary: For types deduced from typedef's and typeof's, don't warn for duplicate declaration specifiers in C90 unless -pedantic. Create a third diagnostic type for duplicate declaration specifiers. Previously, we had an ExtWarn and a Warning. This change adds a third, Extension, which only warns when -pedantic is set, staying silent otherwise. Fixes PR32985. Reviewers: rsmith Reviewed By: rsmith Subscribers: srhines, cfe-commits Differential Revision: https://reviews.llvm.org/D52849 llvm-svn: 343740
* Revert "[ASTMatchers] Fix DynamicASTMatchersTests again"Fangrui Song2018-10-031-0/+1
| | | | | | | | This reverts commit 8a6631a983ec9c1d22cc77c5f55a524a651740f0. The last fix seems good in Debug mode. llvm-svn: 343738
* [analyzer] [tests] [quickfix] Make more test more resilient for non-defaut -std.Artem Dergachev2018-10-033-3/+3
| | | | | | | It is important to specify the version of the standard because tests should test the same thing regardless of the current default version of the standard. llvm-svn: 343736
* [analyzer] Do not crash if the assumption added in TrustNonNullChecker is ↵George Karpenkov2018-10-032-8/+36
| | | | | | | | | | enough to make the state unfeasible rdar://43541814 Differential Revision: https://reviews.llvm.org/D52848 llvm-svn: 343735
* [ASTMatchers] Fix DynamicASTMatchersTests againFangrui Song2018-10-031-1/+0
| | | | llvm-svn: 343722
* [test] Fix -Wunused-variable in rC343665Fangrui Song2018-10-031-1/+1
| | | | llvm-svn: 343721
* Remove stray character from docsStephen Kelly2018-10-031-1/+1
| | | | llvm-svn: 343720
* Update documentation for correctnessStephen Kelly2018-10-031-5/+5
| | | | llvm-svn: 343719
* Add matchers missing from dynamic AST registryStephen Kelly2018-10-031-0/+7
| | | | llvm-svn: 343717
* Sort list of matchersStephen Kelly2018-10-031-14/+14
| | | | llvm-svn: 343716
* [analyzer] [tests] [quickfix] Make the test more resilient for a non-defaut ↵George Karpenkov2018-10-031-1/+1
| | | | | | std configuration llvm-svn: 343715
* [OPENMP] Add reverse_offload clause to requires directivePatrick Lyster2018-10-0317-1/+93
| | | | llvm-svn: 343711
* Add template type and value parameter metadata nodes to template variable ↵Matthew Voss2018-10-033-6/+84
| | | | | | | | | | | | | | | | | | specializations Summary: Add an optional attribute referring to a tuple of type and value template parameter nodes to the DIGlobalVariable node. This allows us to record the parameters of template variable specializations. Reviewers: dblaikie, aprantl, probinson, JDevlieghere, clayborg, jingham Reviewed By: JDevlieghere Subscribers: cfe-commits Tags: #debug-info Differential Revision: https://reviews.llvm.org/D52058 llvm-svn: 343707
* [test] Use --sysroot instead of -B in print-multi-directory.cMartin Storsjo2018-10-031-2/+2
| | | | | | | | | | This avoids finding a similar matching GCC installation outside of the test directory tree in the surrounding environment, which would make the test fail. (This happened on Ubuntu 16.04.) Differential Revision: https://reviews.llvm.org/D52533 llvm-svn: 343702
* [COFF, ARM64] Add _ReadWriteBarrier intrinsicMandeep Singh Grang2018-10-033-0/+13
| | | | | | | | | | | | Reviewers: rnk, mstorsjo, compnerd, TomTan, haripul, javed.absar Reviewed By: rnk Subscribers: kristof.beyls, chrib, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D52809 llvm-svn: 343699
* Thread safety analysis: Unwrap __builtin_expect in getTrylockCallExprAaron Puchert2018-10-032-1/+20
| | | | | | | | | | | | | | | | | | Summary: When people are really sure they'll get the lock they sometimes use __builtin_expect. It's also used by some assertion implementations. Asserting that try-lock succeeded is basically the same as asserting that the lock is not held by anyone else (and acquiring it). Reviewers: aaron.ballman, delesley Reviewed By: aaron.ballman Subscribers: kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D52398 llvm-svn: 343681
* Allow comments with '#' in dynamic AST MatchersStephen Kelly2018-10-032-2/+21
| | | | | | | | | | | | | | Summary: This is necessary for clang-query to be able to handle comments. Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52751 llvm-svn: 343665
* [Frontend] Delete -print-decl-contextsFangrui Song2018-10-039-360/+0
| | | | | | | | | | | | | | Summary: Its job is covered by -ast-dump. The option is rarely used and lacks many AST nodes which will lead to llvm_unreachable() crash. Reviewers: rsmith, arphaman Reviewed By: rsmith Subscribers: jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D52529 llvm-svn: 343660
* OpenCL: Mark printf format string argumentMatt Arsenault2018-10-032-1/+14
| | | | | | Fixes not warning on format string errors. llvm-svn: 343653
* [CMake][Fuchsia] Use libc++ ABIv2 for Fuchsia toolchainPetr Hosek2018-10-031-0/+4
| | | | | | | | We don't need to provide stable ABI and hence we can use the v2. Differential Revision: https://reviews.llvm.org/D52660 llvm-svn: 343652
* [analyzer] [tests] Hotfix: missing spaceGeorge Karpenkov2018-10-021-1/+1
| | | | llvm-svn: 343643
* Remove spurious assertion in -WdocumentationReid Kleckner2018-10-022-1/+9
| | | | | | | | | | | Some code in OpenCV uses interesting doxygen directives that make it so we don't see any tokens inside a @note, despite there definitely being non-whitespace characters there. The consistency check isn't needed. ParagraphComment supports receiving an empty list of comments. Fixes PR39007 llvm-svn: 343641
* [analyzer] [tests] Allow specifying entire -analyze-config on the command ↵George Karpenkov2018-10-021-14/+16
| | | | | | | | line, make sure it's always propagated Differential Revision: https://reviews.llvm.org/D52801 llvm-svn: 343636
* [analyzer] Fix crash in exploded graph dumpingGeorge Karpenkov2018-10-022-6/+3
| | | | | | | | By allocating new DeclStmt to ASTContext Differential Revision: https://reviews.llvm.org/D52756 llvm-svn: 343635
* [analyzer] Promote StdCLibraryFunctionsChecker to the apiModeling category.Artem Dergachev2018-10-025-24/+22
| | | | | | | | | | | Because all our languages are C-based, there's no reason to enable this checker only on UNIX targets. Patch by Donát Nagy! Differential Revision: https://reviews.llvm.org/D52722 llvm-svn: 343632
* [analyzer] Fix symbol discovery in nonloc::LocAsInteger values.Artem Dergachev2018-10-022-3/+2
| | | | | | | | | Doesn't do much despite sounding quite bad, but fixes an exotic test case where liveness of a nonloc::LocAsInteger array index is now evaluated correctly. Differential Revision: https://reviews.llvm.org/D52667 llvm-svn: 343631
* [cl-compat] Change /JMC from unsupported to ignored.Zachary Turner2018-10-021-1/+1
| | | | | | | | | A tracking bug for actually implementing this in clang-cl is at https://bugs.llvm.org/show_bug.cgi?id=39156. Differential Revision: https://reviews.llvm.org/D52798 llvm-svn: 343629
* [analyzer][NFC] Refactor functions in PlistDiagnostics to take ↵Kristof Umann2018-10-021-23/+34
| | | | | | | | | | | | | AnalyzerOptions as parameter I intend to add a new flag macro-expnasions-as-events, and unfortunately I'll only be able to convert the macro piece into an event one once I'm about to emit it, due to the lack of an avaible Preprocessor object in the BugReporter. Differential Revision: https://reviews.llvm.org/D52787 llvm-svn: 343620
* [OpenMP][NVPTX] Simplify codegen for orphaned parallel, NFCI.Jonas Hahnfeld2018-10-022-33/+7
| | | | | | | | | | | Worker threads fork off to the compiler generated worker function directly after entering the kernel function. Hence, there is no need to check whether the current thread is the master if we are outside of a parallel region (neither SPMD nor parallel_level > 0). Differential Revision: https://reviews.llvm.org/D52732 llvm-svn: 343618
* [OpenMP] Simplify code for reductions on distribute directives, NFC.Jonas Hahnfeld2018-10-021-14/+1
| | | | | | | | | | Only need to care about the 'distribute simd' case, all other composite directives are handled elsewhere. This was already reflected in the outer 'if' condition, so all other inner conditions could never be true. Differential Revision: https://reviews.llvm.org/D52731 llvm-svn: 343617
* [HIP] Support early finalization of device code for -fno-gpu-rdcYaxun Liu2018-10-0220-105/+370
| | | | | | | | | | | | | | | | | | | | | | | | This patch renames -f{no-}cuda-rdc to -f{no-}gpu-rdc and keeps the original options as aliases. When -fgpu-rdc is off, clang will assume the device code in each translation unit does not call external functions except those in the device library, therefore it is possible to compile the device code in each translation unit to self-contained kernels and embed them in the host object, so that the host object behaves like usual host object which can be linked by lld. The benefits of this feature is: 1. allow users to create static libraries which can be linked by host linker; 2. amortized device code linking time. This patch modifies HIP action builder to insert actions for linking device code and generating HIP fatbin, and pass HIP fatbin to host backend action. It extracts code for constructing command for generating HIP fatbin as a function so that it can be reused by early finalization. It also modifies codegen of HIP host constructor functions to embed the device fatbin when it is available. Differential Revision: https://reviews.llvm.org/D52377 llvm-svn: 343611
* clang-format: better handle statement macrosFrancois Ferrand2018-10-029-7/+102
| | | | | | | | | | | | | | | | | | | | | | Summary: Some macros are used in the body of function, and actually contain the trailing semicolon: they should thus be automatically followed by a new line, and not get merged with the next line. This is for example the case with Qt's Q_UNUSED macro: void foo(int a, int b) { Q_UNUSED(a) return b; } This patch deals with these cases by introducing a new option to specify list of statement macros. This re-uses the system already in place for foreach macros, to ensure there is no impact on performance. Reviewers: krasimir, djasper, klimek Reviewed By: krasimir Subscribers: acoomans, mgrang, alexfh, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D33440 llvm-svn: 343602
* [Preprocesssor] Filename should fall back to the written name when typo ↵Haojian Wu2018-10-021-8/+12
| | | | | | | | | | | | | | | | | | correction fails. Summary: The test is added in Testcase is at https://reviews.llvm.org/D52775. I tried to add the test to clang's code completion test, it doesn't reproduce the crash. Reviewers: sammccall, kristina Reviewed By: sammccall Subscribers: kristina, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52774 llvm-svn: 343592
* [Preprocessor] Hide include typo correction behind SpellChecking.Haojian Wu2018-10-021-1/+1
| | | | | | | | | | | | | | Summary: Similar to Sema typo correction, the Preprocessor typo correction should also be hidden behind the SpellChecking flag. Reviewers: sammccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52778 llvm-svn: 343591
* [OpenCL] Add block argument CodeGen testSven van Haastregt2018-10-021-0/+20
| | | | | | | | | | | | r326937 ("[OpenCL] Remove block invoke function from emitted block literal struct", 2018-03-07) broke block argument handling. In particular the commit was causing a crash during code generation, see the discussion in https://reviews.llvm.org/D43783 . The offending commit has just been reverted; add a test to avoid breaking this again in the future. llvm-svn: 343583
* Revert r326937 "[OpenCL] Remove block invoke function from emitted block ↵Sven van Haastregt2018-10-027-136/+180
| | | | | | | | | | | literal struct" This reverts r326937 as it broke block argument handling in OpenCL. See the discussion on https://reviews.llvm.org/D43783 . The next commit will add a test case that revealed the issue. llvm-svn: 343582
* [analyzer] Improvements to the SMT APIMikhail R. Gadelha2018-10-025-77/+42
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Several improvements in preparation for the new backends. Refactoring: - Removed duplicated methods `fromBoolean`, `fromAPSInt`, `fromInt` and `fromAPFloat`. The methods `mkBoolean`, `mkBitvector` and `mkFloat` are now used instead. - The names of the functions that convert BVs to FPs were swapped (`mkSBVtoFP`, `mkUBVtoFP`, `mkFPtoSBV`, `mkFPtoUBV`). - Added a couple of comments in function calls. Crosscheck encoding: - Changed how constraints are encoded in the refutation manager so it doesn't start with (false OR ...). This change introduces one duplicated line (see file `BugReporterVisitors.cpp`, the `SMTConv::getRangeExpr is called twice, so I can remove this change if the duplication is a problem. Reviewers: george.karpenkov, NoQ Reviewed By: george.karpenkov Subscribers: xazax.hun, szepet, a.sidorin, Szelethus Differential Revision: https://reviews.llvm.org/D52365 llvm-svn: 343581
* [AST] Pack the bit-fields of FunctionProtoType into Type.Bruno Ricci2018-10-023-241/+331
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the bit-fields of FunctionProtoType into FunctionTypeBitfields. This cuts the size of FunctionProtoType by a pointer. Additionally use llvm::TrailingObjects instead of manually doing the casts + arithmetic. This patch is bigger then what could be expected for the following reasons: 1. As discussed before in D50631 it would be nice if there was some space left in FunctionTypeBitfields for future additions. This patch introduces an extra structure FunctionTypeExtraBitfields which is supposed to hold uncommon bits and is stored in a trailing object. The number of exception types NumExceptions is moved to this struct. As of this patch this trailing struct will only be allocated if we have > 0 types in a dynamic exception specification. 2. TrailingObjects cannot handle repeated types. Therefore the QualType representing an exception type is wrapped in a struct ExceptionType. The ExceptionType * is then reinterpret_cast'd to QualType *. 3. TrailingObjects needs the definition of the various trailing classes. Therefore ExtParameterInfo, ExceptionType and FunctionTypeExtraBitfields are put in FunctionType. Differential Revision: https://reviews.llvm.org/D52738 Reviewed By: rjmccall llvm-svn: 343579
* [CodeComplete] Re-fix accessibilty of protected members from base class.Eric Liu2018-10-023-9/+23
| | | | | | | | | | | | | | | 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-023-2/+142
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* [AArch64][v8.5A] Test clang option for the Memory Tagging ExtensionOliver Stannard2018-10-021-0/+13
| | | | | | | | | | | The implementation of this is in TargetParser, so we only need to add a test for it in clang. Patch by Pablo Barrio! Differential revision: https://reviews.llvm.org/D52493 llvm-svn: 343566
* Added warning for unary minus used with unsigned typeDavid Bolvansky2018-10-023-0/+39
| | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud