summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Support for DWARF-5 C++ language tags.Adrian Prantl2019-09-247-5/+38
| | | | | | | | | | | | This patch provides support for DW_LANG_C_plus_plus_11, DW_LANG_C_plus_plus_14 tags in the Clang C++ frontend. Patch by Sourabh Singh Tomar! Differential Revision: https://reviews.llvm.org/D67613 Reapplies r372663 after adapting a failing test in the LLDB testsuite. llvm-svn: 372681
* [static analyzer] Remove --analyze-autoJan Korous2019-09-242-4/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D67934 llvm-svn: 372680
* [static analyzer] Define __clang_analyzer__ macro in driverJan Korous2019-09-242-5/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D67938 llvm-svn: 372679
* Revert "Support for DWARF-5 C++ language tags."Jonas Devlieghere2019-09-237-38/+5
| | | | | | This reverts commit bf9c8ffb54943c6d77398adbedddf05ef9724007. llvm-svn: 372672
* [NFCI] Return PathSensitiveBugReport where appropriateAlex Langford2019-09-232-7/+10
| | | | | | | | | | Some compilers have trouble converting unique_ptr<PathSensitiveBugReport> to unique_ptr<BugReport> causing some functions to fail to compile. Changing the return type of the functions that fail to compile does not appear to have any issues. I ran into this issue building with clang 3.8 on Ubuntu 16.04. llvm-svn: 372668
* [Diagnostics] Warn for enum constants in bool context ↵David Bolvansky2019-09-231-1/+13
| | | | | | | | (-Wint-in-bool-context; GCC compatibility) Extracted from D63082. llvm-svn: 372664
* Support for DWARF-5 C++ language tags.Adrian Prantl2019-09-237-5/+38
| | | | | | | | | | This patch provides support for DW_LANG_C_plus_plus_11, DW_LANG_C_plus_plus_14 tags in the Clang C++ frontend. Patch by Sourabh Singh Tomar! Differential Revision: https://reviews.llvm.org/D67613 llvm-svn: 372663
* [Sema] Fix the atomic expr rebuilding order.Michael Liao2019-09-232-28/+68
| | | | | | | | | | | | | | | | Summary: - Rearrange the atomic expr order to the API order when rebuilding atomic expr during template instantiation. Reviewers: erichkeane Subscribers: jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67924 llvm-svn: 372640
* [OPENMP]Use standard parsing for 'match' clause, NFC.Alexey Bataev2019-09-236-5/+36
| | | | | | | Reused standard clauses parsing scheme for parsing/matching 'match' clause in 'declare variant' directive. llvm-svn: 372635
* [OPENMP]Fix PR43355: DO not emit target calls if only -fopenmp-targetsAlexey Bataev2019-09-231-0/+4
| | | | | | | | | is not provided. We should not emit any target-dependent code if only -fopenmp flag is used and device targets are not provided to prevent compiler crash. llvm-svn: 372623
* Fix __is_signed builtinZoe Carver2019-09-231-1/+3
| | | | | | | | | | | | | | Summary: This patch fixes the __is_signed builtin type trait to work with floating point types and enums. Now, the builtin will return true if it is passed a floating point type and false for an enum type. Reviewers: EricWF, rsmith, erichkeane, craig.topper, efriedma Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67897 llvm-svn: 372621
* [Diagnostics] Warn if '<<' in bool context with -Wint-in-bool-context (GCC ↵David Bolvansky2019-09-231-1/+10
| | | | | | | | compatibility) Extracted from D63082, addressed review comments related to a warning message. llvm-svn: 372612
* [OPENMP]Call __kmpc_push_tripcount in task context.Alexey Bataev2019-09-233-58/+71
| | | | | | | | | Runtime function __kmpc_push_tripcount better to call inside of the task context for target regions. Otherwise, the libomptarget is unable to link the provided tripcount value for nowait target regions and completely looses this information. llvm-svn: 372609
* [libTooling] Add `access` and `ifBound` combinators to Stencil library.Yitzhak Mandelbaum2019-09-231-17/+77
| | | | | | | | | | | | | | | | | | | | Summary: This revision add the `access` and `ifBound` combinators to the Stencil library: * `access` -- constructs an idiomatic expression for accessing a member (a `MemberExpr`). * `ifBound` -- chooses between two `StencilParts` based on the whether an id is bound in the match (corresponds to the combinator of the same name in RangeSelector). Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67633 llvm-svn: 372605
* [Diagnostics] Avoid -Wsizeof-array-div when dividing the size of a nested ↵David Bolvansky2019-09-231-1/+2
| | | | | | array by the size of the deepest base type llvm-svn: 372600
* [libTooling] Introduce new library of source-code builders.Yitzhak Mandelbaum2019-09-232-0/+161
| | | | | | | | | | | | | | | | | Summary: Introduces facilities for easily building source-code strings, including idiomatic use of parentheses and the address-of, dereference and member-access operators (dot and arrow) and queries about need for parentheses. Reviewers: gribozavr Subscribers: mgorny, cfe-commits, ilya-biryukov Tags: #clang Differential Revision: https://reviews.llvm.org/D67632 llvm-svn: 372595
* [Alignment] fix buildGuillaume Chatelet2019-09-231-5/+6
| | | | llvm-svn: 372562
* For P0784R7: add support for constexpr destructors, and call them asRichard Smith2019-09-237-142/+563
| | | | | | | | | | | appropriate during constant evaluation. Note that the evaluator is sometimes invoked on incomplete expressions. In such cases, if an object is constructed but we never reach the point where it would be destroyed (and it has non-trivial destruction), we treat the expression as having an unmodeled side-effect. llvm-svn: 372538
* [Diagnostics] Warn if ?: with integer constants always evaluates to trueDavid Bolvansky2019-09-221-0/+41
| | | | | | Extracted from D63082. GCC has this warning under -Wint-in-bool-context, but as noted in the D63082's review, we should put it under TautologicalConstantCompare. llvm-svn: 372531
* [CLANG][BPF] permit any argument type for __builtin_preserve_access_index()Yonghong Song2019-09-221-11/+1
| | | | | | | | | | | | | | | | | | | | Commit c15aa241f821 ("[CLANG][BPF] change __builtin_preserve_access_index() signature") changed the builtin function signature to PointerT __builtin_preserve_access_index(PointerT ptr) with a pointer type as the argument/return type, where argument and return types must be the same. There is really no reason for this constraint. The builtin just presented a code region so that IR builtins __builtin_{array, struct, union}_preserve_access_index can be applied. This patch removed the pointer type restriction to permit any argument type as long as it is permitted by the compiler. Differential Revision: https://reviews.llvm.org/D67883 llvm-svn: 372516
* Clang-format: Add Whitesmiths indentation stylePaul Hoad2019-09-223-0/+25
| | | | | | | | | | | | | | | | | | | | | Summary: This patch adds support for the Whitesmiths indentation style to clang-format. It’s an update to a patch submitted in 2015 (D6833), but reworks it to use the newer API. There are still some issues with this patch, primarily around `switch` and `case` support. The added unit test won’t currently pass because of the remaining issues. Reviewers: mboehme, MyDeveloperDay, djasper Reviewed By: MyDeveloperDay Subscribers: krasimir, MyDeveloperDay, echristo, cfe-commits Patch By: @timwoj (Tim Wojtulewicz) Tags: #clang Differential Revision: https://reviews.llvm.org/D67627 llvm-svn: 372497
* Move classes into anonymous namespaces. NFC.Benjamin Kramer2019-09-221-2/+2
| | | | llvm-svn: 372495
* NFC: Change ObjCQualified*TypesAreCompatible to takeJames Y Knight2019-09-213-44/+31
| | | | | | | | | ObjCObjectPointerType arguments. All callers already had one, just creating a QualType to pass, after which the function cast it right back. llvm-svn: 372492
* Attempt to fix a windows buildbot failureKristof Umann2019-09-211-2/+2
| | | | llvm-svn: 372462
* [Clang Interpreter] Fixed Bug 43362, build failure on GCCNandor Licker2019-09-211-0/+1
| | | | | | free() was not directly included in InterpStack.cpp, added include now. llvm-svn: 372455
* Fix bad APInt compare.Richard Trieu2019-09-211-1/+2
| | | | | | | APInt comparison require both to have the same bitwidth. Since only the value is needed, use the compare function APInt::isSameValue instead. llvm-svn: 372454
* Merge and improve code that detects same value in comparisons.Richard Trieu2019-09-213-35/+134
| | | | | | | | | | | | -Wtautological-overlap-compare and self-comparison from -Wtautological-compare relay on detecting the same operand in different locations. Previously, each warning had it's own operand checker. Now, both are merged together into one function that each can call. The function also now looks through member access and array accesses. Differential Revision: https://reviews.llvm.org/D66045 llvm-svn: 372453
* Revert assertion added by r372394Yaxun Liu2019-09-211-1/+0
| | | | | | | | The assertion added by r372394 causes CUDA test in test-suite to assert. The assertion was not there originally, so revert it. llvm-svn: 372452
* Improve -Wtautological-overlap-compareRichard Trieu2019-09-212-6/+40
| | | | | | | | | Allow this warning to detect a larger number of constant values, including negative numbers, and handle non-int types better. Differential Revision: https://reviews.llvm.org/D66044 llvm-svn: 372448
* [clang-scan-deps] strip the --serialize-diagnostics argumentAlex Lorenz2019-09-211-0/+16
| | | | | | | This ensures that clang-scan-deps won't write out diagnostics when scanning dependencies. llvm-svn: 372444
* Remove outdated FIXME.Richard Smith2019-09-201-4/+0
| | | | llvm-svn: 372438
* Fix assertion failure when constant evaluation of a switch jumps over anRichard Smith2019-09-201-0/+27
| | | | | | uninitialized variable in an init-statement of a 'for' or 'if'. llvm-svn: 372437
* [SystemZ] Support z15 processor nameUlrich Weigand2019-09-201-1/+1
| | | | | | | | | | The recently announced IBM z15 processor implements the architecture already supported as "arch13" in LLVM. This patch adds support for "z15" as an alternate architecture name for arch13. Corrsponding LLVM support was committed as rev. 372435. llvm-svn: 372436
* Ensure AtomicExpr goes through SEMA checking after TreeTransformErich Keane2019-09-202-55/+59
| | | | | | | | | | | RebuildAtomicExpr was skipping doing semantic analysis which broke in the cases where the expressions were not dependent. This resulted in the ImplicitCastExpr from an array to a pointer being lost, causing a crash in IR CodeGen. Differential Revision: https://reviews.llvm.org/D67854 llvm-svn: 372422
* Fix a documentation errorKristof Umann2019-09-201-1/+1
| | | | llvm-svn: 372419
* Reland '[analyzer][MallocChecker][NFC] Document and reorganize some functions'Kristof Umann2019-09-201-463/+720
| | | | | | Differential Revision: https://reviews.llvm.org/D54823 llvm-svn: 372414
* [libTooling] Add `ifBound`, `elseBranch` RangeSelector combinators.Yitzhak Mandelbaum2019-09-201-0/+24
| | | | | | | | | | | | | | | | | | Summary: Adds two new combinators and corresponding tests to the RangeSelector library. * `ifBound` -- conditional evaluation of range-selectors, based on whether a given node id is bound in the match. * `elseBranch` -- selects the source range of the else and its statement. Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67621 llvm-svn: 372410
* [CUDA][HIP] Fix hostness of defaulted constructorYaxun Liu2019-09-201-12/+27
| | | | | | | | | | | Clang does not respect the explicit device host attributes of defaulted special members. Also clang does not respect the hostness of special members determined by their first declarations. Clang also adds duplicate implicit device or host attributes in certain cases. This patch fixes that. Differential Revision: https://reviews.llvm.org/D67509 llvm-svn: 372394
* Finish building the full-expression for a static_assert expressionRichard Smith2019-09-201-9/+18
| | | | | | | | | | | | | | before evaluating it rather than afterwards. This is groundwork for C++20's P0784R7, where non-trivial destructors can be constexpr, so we need ExprWithCleanups markers in constant expressions. No significant functionality change intended (though this fixes a bug only visible through libclang / -ast-dump / tooling: we now store the converted condition on the StaticAssertDecl rather than the original). llvm-svn: 372368
* [Consumed] Treat by-value class arguments as consuming by default, like ↵Nicholas Allegra2019-09-191-3/+3
| | | | | | | | rvalue refs. Differential Revision: https://reviews.llvm.org/D67743 llvm-svn: 372361
* Fix for stringized function-macro args continued across linesAlex Lorenz2019-09-191-2/+5
| | | | | | | | | | | In case of certain #define'd macros, there's a space just before line continuation that the minimized-source lexer was missing to include, resulting in invalid stringize. Patch by: kousikk (Kousik Kumar) Differential Revision: https://reviews.llvm.org/D67635 llvm-svn: 372360
* Model converted constant expressions as full-expressions.Richard Smith2019-09-194-44/+66
| | | | | | | | | | This is groundwork for C++20's P0784R7, where non-trivial destructors can be constexpr, so we need ExprWithCleanups markers in constant expressions. No functionality change intended. llvm-svn: 372359
* [CUDA][HIP] Re-apply part of r372318.Michael Liao2019-09-191-2/+4
| | | | | | | | | | - r372318 causes violation of `use-of-uninitialized-value` detected by MemorySanitizer. Once `Viable` field is set to false, `FailureKind` needs setting as well as it will be checked during destruction if `Viable` is not true. - Revert the part trying to skip `std::vector` erasing. llvm-svn: 372356
* Revert "[CUDA][HIP] Fix typo in `BestViableFunction`"Mitch Phillips2019-09-191-9/+7
| | | | | | | | Broke the msan buildbots (see comments on rL372318 for more details). This reverts commit eb231d15825ac345b546f4c99372d1cac8f14f02. llvm-svn: 372353
* Revert r372325 - Reverting r372323 because it broke color tests on Linux.Aaron Ballman2019-09-191-2/+1
| | | | | | This corrects the testing issues. llvm-svn: 372334
* Reverting r372323 because it broke color tests on Linux.Aaron Ballman2019-09-191-1/+2
| | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/17919 llvm-svn: 372325
* Remove an unsafe member variable that wasn't needed; NFC.Aaron Ballman2019-09-191-2/+1
| | | | | | People use the AST dumping interface while debugging, so it's not safe to assume that a declaration will be dumped before a constant expression is dumped. This means the Context member may not get set properly and problems would happen. Rather than rely on the interface that requires the ASTContext, call the generic dump() interface instead; this allows us to remove the Context member variable. llvm-svn: 372323
* [OpenCL] Add version handling and add vector ld/st builtinsSven van Haastregt2019-09-192-16/+152
| | | | | | | | | | | | | | | | | | | Allow setting a MinVersion, stating from which OpenCL version a builtin function is available, and a MaxVersion, stating from which OpenCL version a builtin function should not be available anymore. Guard some definitions of the "work-item" builtin functions according to the OpenCL versions from which they are available. Add the "vector data load and store" builtin functions (e.g. vload/vstore), whose signatures differ before and after OpenCL 2.0 in the pointer argument address spaces. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D63504 llvm-svn: 372321
* [CUDA][HIP] Fix typo in `BestViableFunction`Michael Liao2019-09-191-7/+9
| | | | | | | | | | | | | | | | | | | Summary: - Should consider viable ones only when checking SameSide candidates. - Replace erasing with clearing viable flag to reduce data moving/copying. - Add one and revise another one as the diagnostic message are more relevant compared to previous one. Reviewers: tra Subscribers: cfe-commits, yaxunl Tags: #clang Differential Revision: https://reviews.llvm.org/D67730 llvm-svn: 372318
* [CLANG][BPF] change __builtin_preserve_access_index() signatureYonghong Song2019-09-191-1/+11
| | | | | | | | | | | | | | | | | | | | | | | The clang intrinsic __builtin_preserve_access_index() currently has signature: const void * __builtin_preserve_access_index(const void * ptr) This may cause compiler warning when: - parameter type is "volatile void *" or "const volatile void *", or - the assign-to type of the intrinsic does not have "const" qualifier. Further, this signature does not allow dereference of the builtin result pointer as it is a "const void *" type, which adds extra step for the user to do type casting. Let us change the signature to: PointerT __builtin_preserve_access_index(PointerT ptr) such that the result and argument types are the same. With this, directly dereferencing the builtin return value becomes possible. Differential Revision: https://reviews.llvm.org/D67734 llvm-svn: 372294
OpenPOWER on IntegriCloud