summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Stop abusing SuppressAllDiagnostics when speculatively determiningRichard Smith2019-08-163-17/+15
| | | | | | whether an expression would be valid during error recovery. llvm-svn: 369145
* Fix typos in LibASTImporter.rstGabor Marton2019-08-161-2/+2
| | | | llvm-svn: 369099
* [ASTImporter] Import ctor initializers after setting flags.Balazs Keri2019-08-164-17/+33
| | | | | | | | | | | | | | | | | | | | Summary: Code to import "ctor initializers" at import of functions is moved to be after the flags in the newly created function are imported. This fixes an error when the already created but incomplete (flags are not set) function declaration is accessed. Reviewers: martong, shafik, a_sidorin, a.sidorin Reviewed By: shafik Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65935 llvm-svn: 369098
* [RISCV] Add inline asm constraint A for RISC-VLewis Revill2019-08-162-0/+10
| | | | | | | | | | | | This allows the constraint A to be used in inline asm for RISC-V, which allows an address held in a register to be used. This patch adds the minimal amount of code required to get operands with the right constraints to compile. Differential Revision: https://reviews.llvm.org/D54295 llvm-svn: 369093
* [analyzer] Analysis: Silence checkersCsaba Dabis2019-08-1612-58/+190
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch introduces a new `analyzer-config` configuration: `-analyzer-config silence-checkers` which could be used to silence the given checkers. It accepts a semicolon separated list, packed into quotation marks, e.g: `-analyzer-config silence-checkers="core.DivideZero;core.NullDereference"` It could be used to "disable" core checkers, so they model the analysis as before, just if some of them are too noisy it prevents to emit reports. This patch also adds support for that new option to the scan-build. Passing the option `-disable-checker core.DivideZero` to the scan-build will be transferred to `-analyzer-config silence-checkers=core.DivideZero`. Reviewed By: NoQ, Szelethus Differential Revision: https://reviews.llvm.org/D66042 llvm-svn: 369078
* [Rewrite][NFC] Add FIXMEs and tests for RemoveLineIfEmpty bugJoel E. Denny2019-08-153-5/+90
| | | | | | | | | | | | | | | | | | | | I'd like to add these comments to warn others of problems I encountered when trying to use `RemoveLineIfEmpty`. I originally tried to fix the problem, but I realized I could implement the functionality more easily and efficiently in my calling code where I can make the simplifying assumption that there are no prior edits to the line from which text is being removed. While I've lost the motivation to write a fix, which doesn't look easy, I figure a warning to others is better than silence. I've added a unit test to demonstrate the problem. I don't know how to mark it as an expected failure, so I just marked it disabled. Reviewed By: jkorous Differential Revision: https://reviews.llvm.org/D61466 llvm-svn: 369049
* Mark the test as unsupported on darwin, NFC.Alexey Bataev2019-08-151-1/+1
| | | | | | The bundler may fail on darwin, mark the test as not compatible. llvm-svn: 369044
* [Sema] Implement DR2386 for C++17 structured bindingReid Kleckner2019-08-153-8/+26
| | | | | | | | | | | | | | | | | | Allow implementations to provide complete definitions of std::tuple_size<T>, but to omit the 'value' member to signal that T is not tuple-like. The Microsoft standard library implements std::tuple_size<const T> this way. If the value member exists, clang still validates that it is an ICE, but if it does not, then the type is considered to not be tuple-like. Fixes PR33236 Reviewers: rsmith Differential Revision: https://reviews.llvm.org/D66040 llvm-svn: 369043
* [WebAssembly] Correctly handle va_arg of zero-sized structuresGuanzhong Chen2019-08-152-20/+61
| | | | | | | | | | | | | | | | | | | | | Summary: D66168 passes size 0 structs indirectly, while the wasm backend expects it to be passed directly. This causes subsequent variadic arguments to be read incorrectly. This diff changes it so that size 0 structs are passed directly. Reviewers: dschuff, tlively, sbc100 Reviewed By: dschuff Subscribers: jgravelle-google, aheejin, sunfish, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66255 llvm-svn: 369042
* Rename this file from cx2.c to c2x.c; NFC.Aaron Ballman2019-08-151-0/+0
| | | | llvm-svn: 369035
* Allow standards-based attributes to have leading and trailing underscores.Aaron Ballman2019-08-155-2/+13
| | | | | | This gives library implementers a way to use standards-based attributes that do not conflict with user-defined macros of the same name. Attributes in C2x require this behavior normatively (C2x 6.7.11p4), but there's no reason to not have the same behavior in C++, especially given that such attributes may be used by a C library consumed by a C++ compilation. llvm-svn: 369033
* Fix the test, NFC.Alexey Bataev2019-08-151-1/+1
| | | | llvm-svn: 369028
* Test commit #2.George Karpenkov2019-08-151-0/+1
| | | | llvm-svn: 369020
* [Driver][Bundler] Improve bundling of object files.Alexey Bataev2019-08-152-29/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, object files were bundled using partial linking. It resulted in the following structure of the bundled objects: ``` <host_code> clang-offload-bundle __CLANG_OFFLOAD_BUNDLE__<target> <target_code> ``` But when we tried to unbundle object files, it worked correctly only for the target objects. The host object remains bundled. It produced a lot of junk sections in the host object files and in some cases may caused incorrect linking. Patch improves bundling of the object files. After this patch the bundled object looks like this: ``` <host_code> clang-offload-bundle __CLANG_OFFLOAD_BUNDLE__<target> <target_code> __CLANG_OFFLOAD_BUNDLE__<host> <host_code> ``` With this structure we are able to unbundle the host object files too so that after unbundling they are the same as were before. The host section is bundled twice. The bundled section is used to unbundle the original host section. Reviewers: yaxunl, tra, jlebar, hfinkel, jdoerfert Subscribers: caomhin, kkwli0, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65819 llvm-svn: 369019
* [BUNDLER]Improve the test, NFC.Alexey Bataev2019-08-152-57/+60
| | | | | | | | | | | | | | | | Summary: Make the test more portable and do not rely on the pre-bundled object file. Reviewers: Hahnfeld, hfinkel, jdoerfert Subscribers: caomhin, kkwli0, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66296 llvm-svn: 369015
* Replace llvm::integer_sequence and friends with the C++14 standard versionBenjamin Kramer2019-08-154-10/+10
| | | | | | The implementation in libc++ takes O(1) compile time, ours was O(n). llvm-svn: 368990
* Revert rL368939 "Remove LVALUE / RVALUE workarounds"Russell Gallop2019-08-151-1/+1
| | | | | | | | This reverts commit cad8356d699b36c73abb267f65db575ddacbd652. To unbreak Windows bots llvm-svn: 368985
* [analyzer] Warn about -analyzer-configs being meant for development purposes ↵Kristof Umann2019-08-152-6/+18
| | | | | | | | | | | | only This is more of a temporary fix, long term, we should convert AnalyzerOptions.def into the universally beloved (*coughs*) TableGen format, where they can more easily be separated into developer-only, alpha, and user-facing configs. Differential Revision: https://reviews.llvm.org/D66261 llvm-svn: 368980
* [analyzer] Add docs for cplusplus.InnerPointerKristof Umann2019-08-151-2/+27
| | | | | | Differential Revision: https://reviews.llvm.org/D60281 llvm-svn: 368979
* [clang] Loop pragma parsing. NFC.Sjoerd Meijer2019-08-151-18/+13
| | | | | | | | Just a refactoring and a tidy up. Differential Revision: https://reviews.llvm.org/D64564 llvm-svn: 368976
* [Clang] Pragma vectorize_predicate implies vectorizeSjoerd Meijer2019-08-152-6/+56
| | | | | | | | | | New pragma "vectorize_predicate(enable)" now implies "vectorize(enable)", and it is ignored when vectorization is disabled with e.g. "vectorize(disable) vectorize_predicate(enable)". Differential Revision: https://reviews.llvm.org/D65776 llvm-svn: 368970
* [X86] Add test cases for _mm_movepi64_pi64 and _mm_movpi64_epi64.Craig Topper2019-08-151-0/+17
| | | | llvm-svn: 368969
* [Tooling] Add a hack to work around issues with matcher binding in r368681.David L. Jones2019-08-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | The change in r368681 contains a (probably unintentional) behavioral change for rewrite rules with a single matcher. Previously, the single matcher would not need to be bound (`joinCaseMatchers` returned it directly), even though a final DynTypeMatcher was created and bound by `buildMatcher`. With the new change, a single matcher will be bound, in addition to the final binding (which is now in `buildMatchers`, but happens roughly at the same point in the overall flow). This patch simply duplicates the "final matcher" trick: it creates an extra DynTypedMatcher for each rewrite rule case matcher, and unconditionally makes it bindable. This is probably not the right long-term fix, but it does allow existing code to continue to work with this interface. Subscribers: cfe-commits, gribozavr, ymandel Tags: #clang Differential Revision: https://reviews.llvm.org/D66273 llvm-svn: 368958
* [NFC] Update doc comment to fix warning.Jonas Devlieghere2019-08-151-2/+0
| | | | | | | This fixes the warning: parameter 'EnableNullFPSuppression' not found in the function declaration [-Wdocumentation] llvm-svn: 368954
* [NFCI] Always initialize BugReport const fieldsAlex Langford2019-08-151-2/+4
| | | | | | | | | | | | | | | | | Summary: Some compilers require that const fields of an object must be explicitly initialized by the constructor. I ran into this issue building with clang 3.8 on Ubuntu 16.04. Reviewers: compnerd, Szelethus, NoQ Subscribers: cfe-commits, llvm-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66265 llvm-svn: 368950
* [Clang] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-14259-831/+831
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368942
* [www] Update DR status page to match latest version of CWG issues list.Richard Smith2019-08-141-32/+134
| | | | llvm-svn: 368941
* Fix handling of class member access into a vector type.Richard Smith2019-08-147-12/+55
| | | | | | | | | | | | | | | | | | | | | | When handling a member access into a non-class, non-ObjC-object type, we would perform a lookup into the surrounding scope as if for an unqualified lookup. If the member access was followed by a '<' and this lookup (or the typo-correction for it) found a template name, we'd treat the member access as naming that template. Now we treat such accesses as never naming a template if the type of the object expression is of vector type, so that vector component accesses are never misinterpreted as naming something else. This is not entirely correct, since it is in fact valid to name a template from the enclosing scope in this context, when invoking a pseudo-destructor for the vector type via an alias template, but that's very much a corner case, and this change leaves that case only as broken as the corresponding case for Objective-C types is. This incidentally adds support for dr2292, which permits a 'template' keyword at the start of a member access naming a pseudo-destructor. llvm-svn: 368940
* Remove LVALUE / RVALUE workaroundsJF Bastien2019-08-141-1/+1
| | | | | | | | | | | | Summary: LLVM_HAS_RVALUE_REFERENCE_THIS and LLVM_LVALUE_FUNCTION shouldn't be needed anymore because the minimum compiler versions support them. Subscribers: jkorous, dexonsmith, cfe-commits, llvm-commits, hans, thakis, chandlerc, rnk Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D66240 llvm-svn: 368939
* [LifetimeAnalysis] Support std::stack::top() and std::optional::value()Matthias Gehre2019-08-142-5/+24
| | | | | | | | | | | | | | Summary: Diagnose dangling pointers that come from std::stack::top() and std::optional::value(). Reviewers: gribozavr Subscribers: cfe-commits, xazax.hun Tags: #clang Differential Revision: https://reviews.llvm.org/D66164 llvm-svn: 368929
* [AMDGPU] Do not assume a default GCN targetStanislav Mekhanoshin2019-08-142-4/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D66246 llvm-svn: 368917
* [OPENMP]Support for non-rectangular loops.Alexey Bataev2019-08-149-100/+828
| | | | | | | | Added basic support for non-rectangular loops. It requires an additional analysis of min/max boundaries for non-rectangular loops. Since only linear dependency is allowed, we can do this analysis. llvm-svn: 368903
* [CFG] Introduce CFGElementRef, a wrapper that knows it's position in a CFGBlockKristof Umann2019-08-143-2/+310
| | | | | | | | | | | | | | | | Previously, collecting CFGElements in a set was practially impossible, because both CFGBlock::operator[] and both the iterators returned it by value. One workaround would be to collect the iterators instead, but they don't really capture the concept of an element, and elements from different iterator types are incomparable. This patch introduces CFGElementRef, a wrapper around a (CFGBlock, Index) pair, and a variety of new iterators and iterator ranges to solve this problem. I guess you could say that this patch took a couple iterations to get right :^) Differential Revision: https://reviews.llvm.org/D65196 llvm-svn: 368883
* [NFC][clang] Moving argument handling: Driver::BuildActions -> handleArgumentsPuyan Lotfi2019-08-142-114/+127
| | | | | | | | | | This patch simply moves code that already exists into a new function. Specifically I think it will make the BuildActions code for building a clang job pipeline easier to read and work with. Differential Revision: https://reviews.llvm.org/D66058 llvm-svn: 368881
* [Sema][ObjC] Fix a -Wformat false positive with localizedStringForKeyErik Pilkington2019-08-146-16/+127
| | | | | | | | | | | | Only honour format_arg attributes on -[NSBundle localizedStringForKey] when its argument has a format specifier in it, otherwise its likely to just be a key to fetch localized strings. Fixes rdar://23622446 Differential revision: https://reviews.llvm.org/D27165 llvm-svn: 368878
* [NFC] Updated tests after r368875David Bolvansky2019-08-141-7/+7
| | | | llvm-svn: 368876
* Document clang-cpp in the release notes for clangChris Bieneman2019-08-141-1/+9
| | | | | | This patch adds a line in the release notes about the new clang-cpp library and the CMake option to force clang to link against it. llvm-svn: 368874
* [LifetimeAnalysis] Fix false negatives of statement local lifetime analysis ↵Gabor Horvath2019-08-142-28/+53
| | | | | | | | for some STL implementation Differential Revision: https://reviews.llvm.org/D66152 llvm-svn: 368871
* [NFC] Fix testcase for ARMsDavid Bolvansky2019-08-141-3/+3
| | | | llvm-svn: 368863
* [libTooling] Fix code to avoid unused-function warning after r368681.Yitzhak Mandelbaum2019-08-141-0/+2
| | | | llvm-svn: 368862
* [analyzer][NFC] Prove that we only track the evaluated part of the conditionKristof Umann2019-08-141-0/+35
| | | | | | | | | ...because we're working with a BugReporterVisitor, and the non-evaluated part of the condition isn't in the bugpath. Differential Revision: https://reviews.llvm.org/D65290 llvm-svn: 368853
* [Tooling] Added DeclStmtClass to ExtractionSemicolonPolicyShaurya Gupta2019-08-142-1/+13
| | | | | | | Since the DeclStmt range includes the semicolon, it doesn't need a semicolon at the end during extraction llvm-svn: 368850
* [analyzer][CFG] Don't track the condition of assertsKristof Umann2019-08-146-100/+365
| | | | | | | | | | | | | | Well, what is says on the tin I guess! Some more changes: * Move isInevitablySinking() from BugReporter.cpp to CFGBlock's interface * Rename and move findBlockForNode() from BugReporter.cpp to ExplodedNode::getCFGBlock() Differential Revision: https://reviews.llvm.org/D65287 llvm-svn: 368836
* Removed ToolExecutor::isSingleProcess, it is not used by anythingDmitri Gribenko2019-08-144-13/+0
| | | | | | | | | | Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66212 llvm-svn: 368832
* [NFC] Make test more robustDavid Bolvansky2019-08-141-27/+5
| | | | | | Currently fails on ARMs llvm-svn: 368828
* Improved the doc comment for getCommentsInFileDmitri Gribenko2019-08-141-1/+2
| | | | | | | | | | Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66209 llvm-svn: 368827
* [clang] - An update after LLVM change.George Rimar2019-08-142-2/+9
| | | | | | SectionRef::getName() was changed to return Expected<> (D66089) llvm-svn: 368825
* Fix _WIN32 / _WIN64 Wundef warningsSven van Haastregt2019-08-141-1/+1
| | | | | | | | For these macros it is the definedness that matters rather than the value. Make new uses of these macros consistent with existing uses. llvm-svn: 368822
* [ASTImporter] Import default expression of param before creating the param.Balazs Keri2019-08-145-19/+86
| | | | | | | | | | | | | | | | | | | | | Summary: The default expression of a parameter variable should be imported before the parameter variable object is created. Otherwise the function is created with an incomplete parameter variable (default argument is nullptr) and in this intermediary state the expression is imported. This import can have a reference to the incomplete parameter variable that causes crash. Reviewers: martong, a.sidorin, shafik Reviewed By: martong Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65577 llvm-svn: 368818
* [analyzer] Note last writes to a condition only in a nested stackframeKristof Umann2019-08-143-31/+61
| | | | | | | | | Exactly what it says on the tin! The comments in the code detail this a little more too. Differential Revision: https://reviews.llvm.org/D64272 llvm-svn: 368817
OpenPOWER on IntegriCloud