summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Revert 373538 and follow-ups 373549 and 373552.Nico Weber2019-10-0310-153/+40
| | | | | | They break tests on (at least) macOS. llvm-svn: 373556
* PR43519: don't inject a diagnostic when constant-evaulation of aRichard Smith2019-10-031-2/+5
| | | | | | | | | | pointer-to-member call can't determine a callee. We will have produced a diagnostic already if the callee is known to be unevaluatable, and diagnosing here rejects valid code during potential constant expression checking. llvm-svn: 373553
* Mark P0784R7 as complete and start defining its feature-test macro.Richard Smith2019-10-031-0/+1
| | | | | | | Note that this only covers the language side of this feature. (The library side has its own feature test macro.) llvm-svn: 373548
* For P0784R7: support placement new-expressions in constant evaluation.Richard Smith2019-10-032-19/+89
| | | | | | | | | For now, we restrict this support to use from within the standard library implementation, since we're required to make parts of the standard library that use placement new work, but not permitted to make uses of placement new from user code work. llvm-svn: 373547
* For P0784R7: allow direct calls to operator new / operator delete fromRichard Smith2019-10-031-79/+276
| | | | | | std::allocator::{allocate,deallocate} in constant evaluation. llvm-svn: 373546
* [clang][ifs] Clang Interface Stubs ToolChain plumbing.Puyan Lotfi2019-10-0210-40/+153
| | | | | | | | | | | | | | | | | | | | | This patch enables end to end support for generating ELF interface stubs directly from clang. Now the following: clang -emit-interface-stubs -o libfoo.so a.cpp b.cpp c.cpp will product an ELF binary with visible symbols populated. Visibility attributes and -fvisibility can be used to control what gets populated. * Adding ToolChain support for clang Driver IFS Merge Phase * Implementing a default InterfaceStubs Merge clang Tool, used by ToolChain * Adds support for the clang Driver to involve llvm-ifs on ifs files. * Adds -emit-merged-ifs flag, to tell llvm-ifs to emit a merged ifs text file instead of the final object format (normally ELF) Differential Revision: https://reviews.llvm.org/D63978 llvm-svn: 373538
* Fix uninitialized variable warning in CodeGenPGO constructor. NFCI.Simon Pilgrim2019-10-021-2/+2
| | | | llvm-svn: 373526
* ItaniumCXXABI - silence static analyzer getAs<RecordType> null dereference ↵Simon Pilgrim2019-10-021-11/+11
| | | | | | | | warnings. NFCI. The static analyzer is warning about potential null dereferences, but we should be able to use castAs<RecordType> directly and if not assert will fire for us. llvm-svn: 373525
* [Clang][Driver][NFC] Corrected DeviceActionBuilder methods' comments.Sergey Dmitriev2019-10-021-4/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D68355 llvm-svn: 373523
* CGObjCMac - silence static analyzer dyn_cast<>/getAs<> null dereference ↵Simon Pilgrim2019-10-021-6/+4
| | | | | | | | warnings. NFCI. The static analyzer is warning about potential null dereferences, but we should be able to use cast<>/castAs<> directly and if not assert will fire for us. llvm-svn: 373520
* [Stencil] Hide implementaion detai. NFC.Benjamin Kramer2019-10-021-1/+1
| | | | llvm-svn: 373504
* [OPENMP50]Add parsing/sema analysis for declare variant score.Alexey Bataev2019-10-023-3/+49
| | | | | | | | Context selectors may include optional score clause in format `score(<expr>):`, where `<expr>` must be a constant integer expression. Added parsing/sema analysis only. llvm-svn: 373502
* Type - silence static analyzer getAs<> null dereference warnings. NFCI.Simon Pilgrim2019-10-021-3/+3
| | | | | | The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. llvm-svn: 373480
* Silence static analyzer getAs<VectorType> null dereference warnings. NFCI.Simon Pilgrim2019-10-024-10/+10
| | | | | | The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<VectorType> directly and if not assert will fire for us. llvm-svn: 373478
* SemaOverload - silence static analyzer getAs<> null dereference warnings. NFCI.Simon Pilgrim2019-10-021-25/+25
| | | | | | The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. llvm-svn: 373475
* SemaInit - silence static analyzer getAs<> null dereference warnings. NFCI.Simon Pilgrim2019-10-021-16/+16
| | | | | | The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us. llvm-svn: 373474
* Log2_32 returns an unsigned. NFCI.Simon Pilgrim2019-10-021-1/+2
| | | | | | Silences clang static analyzer warning about out of bounds (negative) shifts. llvm-svn: 373451
* ASTContext - silence static analyzer getAs<> null dereference warnings. NFCI.Simon Pilgrim2019-10-021-21/+20
| | | | | | The static analyzer is warning about potential null dereferences, but we should be able to use castAs<> directly and if not assert will fire for us. llvm-svn: 373447
* [ClangFormat] Future-proof Standard option, allow floating or pinning to ↵Sam McCall2019-10-021-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arbitrary lang version Summary: The historical context: - clang-format was written when C++11 was current, and the main language-version concern was >> vs > > template-closers. An option was added to allow selection of the 03/11 behavior, or auto-detection. - there was no option to choose simply "latest standard" so anyone who didn't ever want 03 behavior or auto-detection specified Cpp11. - In r185149 this option started to affect lexer mode. - no options were added to cover c++14, as parsing/formatting didn't change that much. The usage of Cpp11 to mean "latest" became codified e.g. in r206263 - c++17 added some new constructs. These were mostly backwards-compatible and so not used in old programs, so having no way to turn them off was OK. - c++20 added some new constructs and keywords (e.g. co_*) that changed the meaning of existing programs, and people started to complain that the c++20 parsing couldn't be turned off. New plan: - Default ('Auto') behavior remains unchanged: parse as latest, format template-closers based on input. - Add new 'Latest' option that more clearly expresses the intent "use modern features" that many projects have chosen for their .clang-format files. - Allow pinning to *any* language version, using the same name as clang -std: c++03, c++11, c++14 etc. These set precise lexer options, and any clang-format code depending on these can use a >= check. - For backwards compatibility, `Cpp11` is an alias for `Latest`, not `c++11`. This matches the historical documented semantics of this option. This spelling (and `Cpp03`) are deprecated. Reviewers: klimek, modocache Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67541 llvm-svn: 373439
* Rename TypeNodes.def to TypeNodes.inc for consistency across allJohn McCall2019-10-0217-45/+45
| | | | | | | | our autogenerated files. NFC. As requested by Nico Weber. llvm-svn: 373425
* Revert r368237 - Update fix-it hints for std::move warnings.Richard Trieu2019-10-021-27/+24
| | | | | | | | r368237 attempted to improve fix-its for move warnings, but introduced some regressions to -Wpessimizing-move. Revert that change and add the missing test cases to the pessimizing move test to prevent future regressions. llvm-svn: 373421
* Fix crash on constant-evaluation of pseudo-destruction of a pointer.Richard Smith2019-10-021-1/+1
| | | | | | | We got confused and thought we might be pseudo-destroying the pointee instead. llvm-svn: 373418
* Fix unused variable warning. NFCI.Michael Liao2019-10-021-4/+4
| | | | llvm-svn: 373410
* [clang][OpenMP][NFC] #include GlobalDecl.h to avoid incomplete class typeJordan Rupprecht2019-10-011-1/+1
| | | | llvm-svn: 373400
* CGVTables - silence static analyzer getAs<FunctionProtoType> null ↵Simon Pilgrim2019-10-011-3/+2
| | | | | | | | dereference warnings. NFCI. The static analyzer is warning about potential null dereferences, but we should be able to use castAs<FunctionProtoType> directly and if not assert will fire for us. llvm-svn: 373398
* CGExprAgg - remove duplicate code. NFCI.Simon Pilgrim2019-10-011-1/+1
| | | | | | Remove duplicate getAs<> call, avoiding a clang static analyzer null dereference warning. llvm-svn: 373396
* [clang-format] [PR43372] - clang-format shows replacements in DOS files when ↵Paul Hoad2019-10-011-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | no replacement is needed Summary: This is a patch to fix PR43372 (https://bugs.llvm.org/show_bug.cgi?id=43372) - clang-format can't format file with includes, ( which really keep providing replacements for already sorted headers.) A similar issue was addressed by @krasimir in {D60199}, however, this seemingly only prevented the issue when the files being formatted did not contain windows line endings (\r\n) It's possible this is related to https://twitter.com/StephanTLavavej/status/1176722938243895296 given who @STL_MSFT works for! As people often used the existence of replacements to determine if a file needs clang-formatting, this is probably pretty important for windows users There may be a better way of comparing 2 strings and ignoring \r (which appear in both Results and Code), I couldn't choose between this idiom or the copy_if approach, but I'm happy to change it to whatever people consider more performant. Reviewers: krasimir, klimek, owenpan, ioeric Reviewed By: krasimir Subscribers: cfe-commits, STL_MSFT, krasimir Tags: #clang-format, #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D68227 llvm-svn: 373388
* [OPENMP50]Initial codegen for declare variant implementation vendor.Alexey Bataev2019-10-013-0/+150
| | | | | | | Initial implementation of global aliases emission for the declare variant pragma with implementation vendor context selector set. llvm-svn: 373387
* [OPENMP]Fix PR43330: OpenMP target: Mapping of partial arrays fails.Alexey Bataev2019-10-011-8/+27
| | | | | | Fixed calculation the size of the array sections. llvm-svn: 373374
* [ThinLTO] Enable index-only WPD from clangTeresa Johnson2019-10-011-6/+5
| | | | | | | | | | | | | | | | | | Summary: To trigger the index-only Whole Program Devirt support added to LLVM, we need to be able to specify -fno-split-lto-unit in conjunction with -fwhole-program-vtables. Keep the default for -fwhole-program-vtables as -fsplit-lto-unit, but don't error on that option combination. Reviewers: pcc Subscribers: mehdi_amini, inglorion, steven_wu, dexonsmith, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68029 llvm-svn: 373370
* [OPENMP]Fix PR43516: Compiler crash with collapse(2) on non-rectangularAlexey Bataev2019-10-011-5/+13
| | | | | | | | | loop. Missed check if the condition is also dependent when building final expressions for the collapsed loop directives. llvm-svn: 373348
* [clang] Make handling of unnamed template params similar to function paramsKadir Cetinkaya2019-10-013-15/+14
| | | | | | | | | | | | | | | | | | | | | Summary: Clang uses the location identifier should be inserted for declarator decls when a decl is unnamed. But for type template and template template paramaters it uses the location of "typename/class" keyword, which makes it hard for tooling to insert/change parameter names. This change tries to unify these two cases by making template parameter parsing and sourcerange operations similar to function params/declarator decls. Reviewers: ilya-biryukov Subscribers: arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68143 llvm-svn: 373340
* [clang][lldb][NFC] Encapsulate ExternalASTMerger::ImporterSourceRaphael Isemann2019-10-011-13/+14
| | | | | | NFC preparation work for upcoming ExternalASTMerger patches. llvm-svn: 373312
* Don't elide the use of the thread wrapper for a thread_local constinitRichard Smith2019-10-011-2/+3
| | | | | | | | | variable with non-trivial destruction. We still need to invoke the thread wrapper to trigger registration of the destructor call on thread shutdown. llvm-svn: 373289
* During constant evaluation, handle CXXBindTemporaryExprs forRichard Smith2019-10-011-7/+6
| | | | | | array-of-class types, not just for class types. llvm-svn: 373279
* [c++20] Fix crash when constant-evaluating an assignment with aRichard Smith2019-10-011-1/+3
| | | | | | reference member access on its left-hand side. llvm-svn: 373276
* Make function static that didn't need linkage.Erich Keane2019-09-301-1/+1
| | | | | | In r373247 I added a helper function, but neglected to make it static. llvm-svn: 373268
* Fix failure caused by r373247Erich Keane2019-09-301-1/+5
| | | | | | | | | | | I incorrectly thought that the 'isLambda' check never fired, so when splitting up a helper function, I lost the 'nullptr' return value. ClangD Hover functionality apparently uses this, so the Unittest caught that. This patch correctly propogates the nullptr from the helper function. llvm-svn: 373259
* [Diagnostics] Warn if enumeration type mismatch in conditional expressionDavid Bolvansky2019-09-301-0/+28
| | | | | | | | | | | | | | | | | | Summary: - Useful warning - GCC compatibility (GCC warns in C++ mode) Reviewers: rsmith, aaron.ballman Reviewed By: aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67919 llvm-svn: 373252
* Teach CallGraph to look into Generic Lambdas.Erich Keane2019-09-303-6/+22
| | | | | | | | | | | | | | | | | | | | CallGraph visited LambdaExpr by getting the Call Operator from CXXRecordDecl (LambdaExpr::getCallOperator calls CXXRecordDecl::getLambdaCallOperator), which replaced generic lambda call operators with the non-instantiated FunctionDecl. The result was that the CallGraph would only pick up non-dependent calls. This patch does a few things: 1- Extend CXXRecordDecl to have a getDependentLambdaCallOperator, which will get the FunctionTemplateDecl, rather than immediately getting the TemplateDecl. 2- Define getLambdaCallOperator and getDependentLambdaCallOperator in terms of a common function. 3- Extend LambdaExpr with a getDependentCallOperator, which just calls the above function. 4- Changes CallGraph to handle Generic LambdaExprs. llvm-svn: 373247
* [OPENMP50]Do not emit warning for the function with the currentlyAlexey Bataev2019-09-301-2/+3
| | | | | | | | | defined body. If the function is currently defined, we should not emit a warning that it might be emitted already because it was not really emitted. llvm-svn: 373243
* [Clang] Use -main-file-name for source filename if not setTeresa Johnson2019-09-301-2/+10
| | | | | | | | | | | | | | | | | | | -main-file-name is currently used to set the source name used in debug information. If the source filename is "-" and -main-file-name is set, then use the filename also for source_filename and ModuleID of the output. The argument is generally used outside the internal clang calls when running clang in a wrapper like icecc which gives the source via stdin but still wants to get a object file with the original source filename both in debug info and IR code. Patch by: the_jk (Joel Klinghed) Differential Revision: https://reviews.llvm.org/D67592 llvm-svn: 373217
* [OPENMP] Fix comment, NFC.Alexey Bataev2019-09-301-1/+1
| | | | llvm-svn: 373210
* [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)Guillaume Chatelet2019-09-304-5/+5
| | | | | | | | | | | | | | | | | Summary: This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Reviewers: courbet Subscribers: jholewinski, arsenm, jvesely, nhaehnle, eraman, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D68141 llvm-svn: 373207
* [Alignment][NFC] Remove LoadInst::setAlignment(unsigned)Guillaume Chatelet2019-09-301-1/+1
| | | | | | | | | | | | | | | | | Summary: This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Reviewers: courbet, jdoerfert Subscribers: hiraditya, asbirlea, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D68142 llvm-svn: 373195
* [lldb][clang][modern-type-lookup] Use ASTImporterSharedState in ↵Raphael Isemann2019-09-301-4/+8
| | | | | | | | | | | | | | | | | | ExternalASTMerger Summary: The ExternalASTMerger should use the ASTImporterSharedState. This allows it to handle std::pair in LLDB (but the rest of libc++ is still work in progress). Reviewers: martong, shafik, a.sidorin Subscribers: rnkovacs, christof, JDevlieghere, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68140 llvm-svn: 373193
* Don't crash if a variable with a constexpr destructor has aRichard Smith2019-09-291-1/+2
| | | | | | value-dependent initializer. llvm-svn: 373173
* [clang-format] Reference qualifiers in member templates causing extra ↵Paul Hoad2019-09-291-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | indentation. Summary: The following code ``` struct f { template <class T> void bar() && noexcept {} }; ``` will be formatted to the following with LLVM style, and `AlwaysBreakTemplateDeclarations: Yes` ``` struct f { template <class T> void bar() && noexcept {} }; ``` The indentation of the `void bar()` line is wrong. Reviewers: klimek, owenpan, krasimir, timwoj, MyDeveloperDay Reviewed By: klimek, MyDeveloperDay Subscribers: MyDeveloperDay, ilya-biryukov, llvm-commits, cfe-commits Patch By: AndWass Tags: #clang-format, #clang, #llvm Differential Revision: https://reviews.llvm.org/D68072 llvm-svn: 373165
* For now, disallow lifetime-extended temporaries with non-trivial (butRichard Smith2019-09-291-1/+9
| | | | | | | | | | | | constexpr) destructors from being used in the values of constexpr variables. The standard rules here are unclear at best, so rejecting the problematic cases seems prudent. Prior to this change, we would fail to run the destructors for these temporaries, even if they had side-effects, which is certainly not the right behavior. llvm-svn: 373161
* Fix checking for permitted results of constant expressions.Richard Smith2019-09-291-25/+54
| | | | | | | | | In the presence of mutable state, we need to check whether temporaries involved in a constant expression have permissible values at the end of the overall evaluation, rather than at the end of the evaluation of the initializer of the temporary. llvm-svn: 373160
OpenPOWER on IntegriCloud