summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [OPENMP50]Codegen support for scores in context selectors.Alexey Bataev2019-10-032-12/+84
| | | | | | | | If the context selector has associated score and several contexts selectors matches current context, the function with the highest score must be selected. llvm-svn: 373661
* [HIP] Use option -nogpulib to disable linking device libYaxun Liu2019-10-034-3/+19
| | | | | | Differential Revision: https://reviews.llvm.org/D68300 llvm-svn: 373649
* Check for qualified function types after substituting into the operandRichard Smith2019-10-035-1/+29
| | | | | | | | | | of 'typeid'. This is a rare place where it's valid for a function type to be substituted but not valid for a qualified function type to be substituted, so needs a special check. llvm-svn: 373648
* [clang-format] Add ability to wrap braces after multi-line control statementsPaul Hoad2019-10-037-60/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Change the BraceWrappingFlags' AfterControlStatement from a bool to an enum with three values: * "Never": This is the default, and does not do any brace wrapping after control statements. * "MultiLine": This only wraps braces after multi-line control statements (this really only happens when a ColumnLimit is specified). * "Always": This always wraps braces after control statements. The first and last options are backwards-compatible with "false" and "true", respectively. The new "MultiLine" option is useful for when a wrapped control statement's indentation matches the subsequent block's indentation. It makes it easier to see at a glance where the control statement ends and where the block's code begins. For example: ``` if ( foo && bar ) { baz(); } ``` vs. ``` if ( foo && bar ) { baz(); } ``` Short control statements (1 line) do not wrap the brace to the next line, e.g. ``` if (foo) { bar(); } else { baz(); } ``` Reviewers: sammccall, owenpan, reuk, MyDeveloperDay, klimek Reviewed By: MyDeveloperDay Subscribers: MyDeveloperDay, cfe-commits Patch By: mitchell-stellar Tags: #clang-format, #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D68296 llvm-svn: 373647
* PR43547: substitute into the type of a non-type template parameter ifRichard Smith2019-10-032-3/+13
| | | | | | | | it's instantiation-dependent, even if it's not dependent. There might be a SFINAE check in the parameter type. llvm-svn: 373643
* [HIP] Enable specifying different default gpu arch for HIP/CUDA.Michael Liao2019-10-032-3/+18
| | | | | | | | | | | | Reviewers: tra, yaxunl Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68394 llvm-svn: 373634
* DeclBase/DeclCXX/DeclTemplate - silence static analyzer getAs<> null ↵Simon Pilgrim2019-10-033-7/+7
| | | | | | | | dereference warnings. NFCI. 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: 373626
* [OPENMP]Fix emission of the declare target variables in device mode.Alexey Bataev2019-10-032-17/+12
| | | | | | | Declare target variables must be emitted in device mode, target triples can be empty in this case. llvm-svn: 373624
* [OPENMP]Improve diagnostics for not found declare target entries.Alexey Bataev2019-10-032-20/+33
| | | | | | | We can point to the target region + emit parent functions names/real var names if they were not found in host module during device codegen. llvm-svn: 373620
* [NFC] Added missing changes for rL373614David Bolvansky2019-10-031-0/+3
| | | | llvm-svn: 373616
* [Diagnostics] Bitwise negation of a boolean expr always evaluates to true; ↵David Bolvansky2019-10-032-1/+23
| | | | | | | | | warn with -Wbool-operation Requested here: http://lists.llvm.org/pipermail/cfe-dev/2019-October/063452.html llvm-svn: 373614
* Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.Simon Pilgrim2019-10-031-1/+1
| | | | llvm-svn: 373613
* ExprConstant - silence static analyzer getAs<> null dereference warnings. NFCI.Simon Pilgrim2019-10-031-11/+10
| | | | | | 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: 373612
* Remove duplicate P->getAs<PointerType>() call. NFCI.Simon Pilgrim2019-10-031-2/+2
| | | | llvm-svn: 373611
* [Alignment][NFC] Remove StoreInst::setAlignment(unsigned)Guillaume Chatelet2019-10-031-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, bollu, jdoerfert Subscribers: hiraditya, asbirlea, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D68268 llvm-svn: 373595
* [libTooling] Add various Stencil combinators for expressions.Yitzhak Mandelbaum2019-10-033-3/+143
| | | | | | | | | | | | | | | | | | | Summary: This revision adds three new Stencil combinators: * `expression`, which idiomatically constructs the source for an expression, including wrapping the expression's source in parentheses if needed. * `deref`, which constructs an idiomatic dereferencing expression. * `addressOf`, which constructs an idiomatic address-taking expression. Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68315 llvm-svn: 373593
* [Alignment][Clang][NFC] Add CharUnits::getAsAlignGuillaume Chatelet2019-10-0320-64/+69
| | | | | | | | | | | | | | | | | | Summary: This is a prerequisite to removing `llvm::GlobalObject::setAlignment(unsigned)`. 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, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68274 llvm-svn: 373592
* Silence static analyzer getAs<RecordType> null dereference warnings. NFCI.Simon Pilgrim2019-10-0332-83/+80
| | | | | | The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<RecordType> directly and if not assert will fire for us. llvm-svn: 373584
* [clang][NFC] Fix misspellings in ExternalASTMerger.hRaphael Isemann2019-10-031-4/+4
| | | | llvm-svn: 373577
* Fix driver tests when `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` is `ON`Serge Pavlov2019-10-032-7/+35
| | | | | | | | | | | | | | | | Some Driver tests relied on the default resource direcory having per-os per-arch subdirectory layout, and when clang is built with `-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON`, those test fail, because clang by default assumes per-target subdirectories. Explicitly set `-resource-dir` flag to point to a tree with per-os per-arch layout. See also: D45604, D62469 Differential Revision: https://reviews.llvm.org/D66981 Patch by Sergej Jaskiewicz <jaskiewiczs@icloud.com>. llvm-svn: 373565
* [HIP] Support -emit-llvm for device compilationYaxun Liu2019-10-032-2/+80
| | | | | | | | | | | Sometimes it is useful to compile HIP device code to LLVM BC. It is not convenient to use clang -cc1 since there are lots of options needed. This patch allows clang driver to compile HIP device code to LLVM BC with -emit-llvm -c. Differential Revision: https://reviews.llvm.org/D68284 llvm-svn: 373561
* Revert 373538 and follow-ups 373549 and 373552.Nico Weber2019-10-0332-340/+111
| | | | | | They break tests on (at least) macOS. llvm-svn: 373556
* PR43519: don't inject a diagnostic when constant-evaulation of aRichard Smith2019-10-032-2/+10
| | | | | | | | | | 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
* Fixing broken builds due to r373538, issues with filepath and hexagon toolchain.Puyan Lotfi2019-10-031-9/+16
| | | | | | | | It appears there are some issues with the hexagon toolchain, and also the file path for the library file. If this doesn't fix the remaining breakages I will attempt a revert. llvm-svn: 373552
* Fixing broken builds due to r373538 due to test that should have been deleted.Puyan Lotfi2019-10-031-14/+0
| | | | | | test/InterfaceStubs/object.cpp should have been deleted. llvm-svn: 373549
* Mark P0784R7 as complete and start defining its feature-test macro.Richard Smith2019-10-033-2/+6
| | | | | | | 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-034-34/+201
| | | | | | | | | 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-033-81/+374
| | | | | | std::allocator::{allocate,deallocate} in constant evaluation. llvm-svn: 373546
* [clang][ifs] Clang Interface Stubs ToolChain plumbing.Puyan Lotfi2019-10-0231-97/+333
| | | | | | | | | | | | | | | | | | | | | 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-029-15/+101
| | | | | | | | 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] relnotes for r373439Sam McCall2019-10-021-1/+9
| | | | llvm-svn: 373441
* [clang-rename] Better renaming the typedef decl.Haojian Wu2019-10-022-1/+19
| | | | | | | | | | | | | | Summary: when renaming a typedef decl, we used to rename the underlying decl of the typedef, we should rename the typedef itself. Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68322 llvm-svn: 373440
* [ClangFormat] Future-proof Standard option, allow floating or pinning to ↵Sam McCall2019-10-024-26/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0225-61/+61
| | | | | | | | 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-023-77/+68
| | | | | | | | 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-022-1/+10
| | | | | | | We got confused and thought we might be pseudo-destroying the pointee instead. llvm-svn: 373418
* Remove TypeNodes.def from the modulemap.John McCall2019-10-021-1/+0
| | | | | | | | | | | | | | | | | We currently just look for files named in the modulemap in its associated source directory. This means that we can't name generated files, like TypeNodes.def now is, which means we can't explicitly mark it as textual. But fortunately that's okay because (as I understand it) the most important purpose of naming the header in the modulemap is to ensure that it's not treated as public, and the search for public headers also only considers files in the associated source directory. This isn't an elegant solution, since among other things it means that a build which wrote the generated files directly into the source directory would result in something that wouldn't build as a module, but that's a problem for all our other generated files as well. llvm-svn: 373416
* Fix unused variable warning. NFCI.Michael Liao2019-10-021-4/+4
| | | | llvm-svn: 373410
* Emit TypeNodes.def with tblgen.John McCall2019-10-018-138/+340
| | | | | | | | | | | | | | | | | | The primary goal here is to make the type node hierarchy available to other tblgen backends, although it should also make it easier to generate more selective x-macros in the future. Because tblgen doesn't seem to allow backends to preserve the source order of defs, this is not NFC because it significantly re-orders IDs. I've fixed the one (fortunately obvious) place where we relied on the old order. Unfortunately, I wasn't able to share code with the existing AST-node x-macro generators because the x-macro schema we use for types is different in a number of ways. The main loss is that subclasses aren't ordered together, which doesn't seem important for types because the hierarchy is generally very shallow with little clustering. llvm-svn: 373407
OpenPOWER on IntegriCloud