summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Adds fixit hints to the -Wrange-loop-analysisMark de Wever2020-01-012-3/+12
| | | | Differential Revision: https://reviews.llvm.org/D68913
* [NFC] Fixes -Wrange-loop-analysis warningsMark de Wever2020-01-014-4/+4
| | | | | | This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall. Differential Revision: https://reviews.llvm.org/D71857
* [MC][TargetMachine] Delete MCTargetOptions::MCPIECopyRelocationsFangrui Song2020-01-011-1/+0
| | | | | | | | | | | | clang/lib/CodeGen/CodeGenModule performs the -mpie-copy-relocations check and sets dso_local on applicable global variables. We don't need to duplicate the work in TargetMachine shouldAssumeDSOLocal. Verified that -mpie-copy-relocations can still emit PC relative relocations for external variable accesses. clang -target x86_64 -fpie -mpie-copy-relocations -c => R_X86_64_PC32 clang -target aarch64 -fpie -mpie-copy-relocations -c => R_AARCH64_ADR_PREL_PG_HI21+R_AARCH64_LDST64_ABS_LO12_NC
* Revert "[Diagnostic] Add ftabstop to -Wmisleading-indentation"Martin Storsjö2019-12-311-38/+3
| | | | | | | | | This reverts commit b47b35ff51b355a446483777155290541ab64fae. This caused failed asserts (Assertion `FIDAndOffset.second > ColNo && "Column number smaller than file offset?"' failed.) on a source file with a single line containing "int main (void) { for( int i = 0; i < 9; i++ ); return 0; }".
* [OPENMP]Emit artificial threprivate vars as threadlocal, if possible.Alexey Bataev2019-12-311-2/+7
| | | | It may improve performance for declare reduction constructs.
* [CodeGen] Emit conj/conjf/confjl libcalls as fneg instructions if possible.Craig Topper2019-12-311-1/+4
| | | | | | | We already recognize the __builtin versions of these, might as well recognize the libcall version. Differential Revision: https://reviews.llvm.org/D72028
* Match code following lambdas when ignoring invisible nodesStephen Kelly2019-12-311-1/+1
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71976
* [OpenCL] Remove redundant foreach in OpenCLBuiltins.td; NFCSven van Haastregt2019-12-311-76/+32
| | | | | Remove various `foreach` declarations where the iterator is used only once. This makes the .td file more compact.
* [CodeGen] Use IRBuilder::CreateFNeg for __builtin_conjCraig Topper2019-12-301-6/+1
| | | | | | This replaces the fsub -0.0 idiom with an fneg instruction. We didn't see to have a test that showed the current codegen. Just some tests for constant folding and a test that was only checking the declare lines for libcalls. The latter just checked that we did not have a declare for @conj when using __builtin_conj. Differential Revision: https://reviews.llvm.org/D72012
* [CodeGen] Use CreateFNeg in buildFMulAddCraig Topper2019-12-301-11/+4
| | | | | | We have an fneg instruction now and should use it instead of the fsub -0.0 idiom. Looks like we had no test that showed that we handled the negation cases here so I've added new tests. Differential Revision: https://reviews.llvm.org/D72010
* [OpenMP] Use the OpenMPIRBuilder for `omp parallel`Johannes Doerfert2019-12-301-0/+95
| | | | | | | | | | | | This allows to use the OpenMPIRBuilder for parallel regions. Code was extracted from D61953 and adapted to work with the new version (D70109). All but one feature should be supported. An update of this patch will provide test coverage and privatization other than shared. Reviewed By: fghanim Differential Revision: https://reviews.llvm.org/D70290
* [X86][AsmParser] re-introduce 'offset' operatorEric Astor2019-12-301-1/+6
| | | | | | | | | | | | | | | | | | | | | | | Summary: Amend MS offset operator implementation, to more closely fit with its MS counterpart: 1. InlineAsm: evaluate non-local source entities to their (address) location 2. Provide a mean with which one may acquire the address of an assembly label via MS syntax, rather than yielding a memory reference (i.e. "offset asm_label" and "$asm_label" should be synonymous 3. address PR32530 Based on http://llvm.org/D37461 Fix broken test where the break appears unrelated. - Set up appropriate memory-input rewrites for variable references. - Intel-dialect assembly printing now correctly handles addresses by adding "offset". - Pass offsets as immediate operands (using "r" constraint for offsets of locals). Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D71436
* [OpenCL] Add mipmap builtin functionsSven van Haastregt2019-12-301-0/+177
| | | | | | | Add the mipmap builtin functions from the OpenCL extension specification. Patch by Pierre Gondois and Sven van Haastregt.
* [Diagnostic] Add ftabstop to -Wmisleading-indentationTyker2019-12-301-3/+38
| | | | | | | | | | | | | | | Summary: this allow much better support of codebases like the linux kernel that mix tabs and spaces. -ftabstop=//Width// allow specifying how large tabs are considered to be. Reviewers: xbolva00, aaron.ballman, rsmith Reviewed By: aaron.ballman Subscribers: jyknight, riccibruno, rsmith, nathanchance Differential Revision: https://reviews.llvm.org/D71037
* Fix formatting in previous commitsStephen Kelly2019-12-291-1/+2
|
* Fix use of named values surrounded by newlines in clang-queryStephen Kelly2019-12-291-7/+8
|
* Fix handling of newlines in clang-queryStephen Kelly2019-12-291-3/+1
| | | | Replace assert with diagnostic for missing newline.
* Allow redeclaration of __declspec(uuid)Zachary Henkel2019-12-282-3/+9
| | | | | | | | | msvc allows a subsequent declaration of a uuid attribute on a struct/class. Mirror this behavior in clang-cl. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D71439
* Fix crash in getFullyQualifiedName for inline namespaceAlexey Bader2019-12-281-1/+1
| | | | | | | | | | | | | | Summary: The ICE happens when the most outer namespace is an inline namespace. Reviewers: bkramer, ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ebevhan, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71962
* Revert "CWG2352: Allow qualification conversions during reference binding."David Blaikie2019-12-273-164/+136
| | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit de21704ba96fa80d3e9402f12c6505917a3885f4. Regressed/causes this to error due to ambiguity: void f(const int * const &); void f(int *); int main() { int * x; f(x); } (in case it's important - the original case where this turned up was a member function overload in a class template with, essentially: f(const T1&) f(T2*) (where T1 == X const *, T2 == X)) It's not super clear to me if this ^ is expected behavior, in which case I'm sorry about the revert & happy to look into ways to fix the original code.
* [OpenCL] Fix inconsistency between opencl and c11 atomic fetch max/minYaxun (Sam) Liu2019-12-271-2/+2
| | | | | | | | | | | | There is some inconsistency between opencl and c11 atomic fetch max/min after https://reviews.llvm.org/D46386 https://reviews.llvm.org/D55562 It is not reasonable to have such inconsistencies. This patch fixes that. Differential Revision: https://reviews.llvm.org/D71725
* Allow newlines in AST Matchers in clang-query filesStephen Kelly2019-12-271-21/+55
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71842
* [OpenCL] Pretty print __private addr spaceAnastasia Stulova2019-12-272-2/+2
| | | | | | | | | | Add printing of __private address space to TypePrinter to allow it appears in diagnostics and AST dumps as all other language addr spaces. Tags: #clang Differential Revision: https://reviews.llvm.org/D71272
* Revert "Allow newlines in AST Matchers in clang-query files" + 1Evgenii Stepanov2019-12-261-55/+21
| | | | | | | | | Revert "Fix -Wunused-lambda-capture warnings." This reverts commit 2369560f4a7720b19edfbf9de14ef061307ff773. This reverts commit 522ee29a4fb3814db604b585c8637247477ec057. clang/lib/ASTMatchers/Dynamic/Parser.cpp:610:13: warning: implicit conversion turns string literal into bool: 'const char [35]' to 'bool' [-Wstring-conversion] assert(!"Newline should never be found here");
* Fix -Wunused-lambda-capture warnings.Eric Christopher2019-12-261-1/+1
|
* Allow newlines in AST Matchers in clang-query filesStephen Kelly2019-12-261-21/+55
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71842
* Revert "Allow newlines in AST Matchers in clang-query files"Stephen Kelly2019-12-261-55/+21
| | | | This reverts commit 6a3ecf4dc7ec299394e71b3124df2b3a34ed4ac3.
* Allow newlines in AST Matchers in clang-query filesStephen Kelly2019-12-261-21/+55
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71842
* [OpenMP][NFCI] Use the libFrontend ProcBindKind in ClangJohannes Doerfert2019-12-2610-52/+29
| | | | | | | | | | | | This removes the OpenMPProcBindClauseKind enum in favor of llvm::omp::ProcBindKind which lives in OpenMPConstants.h and was introduced in D70109. No change in behavior is expected. Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D70289
* [OpenMP][IR-Builder] Introduce the finalization stackJohannes Doerfert2019-12-251-15/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a permanent and generic solution to the problem of variable finalization (destructors, lastprivate, ...), this patch introduces the finalization stack. The objects on the stack describe (1) the (structured) regions the OpenMP-IR-Builder is currently constructing, (2) if these are cancellable, and (3) the callback that will perform the finalization (=cleanup) when necessary. As the finalization can be necessary multiple times, at different source locations, the callback takes the position at which code is currently generated. This position will also encode the destination of the "region exit" block *iff* the finalization call was issues for a region generated by the OpenMPIRBuilder. For regions generated through the old Clang OpenMP code geneneration, the "region exit" is determined by Clang inside the finalization call instead (see getOMPCancelDestination). As a first user, the parallel + cancel barrier interaction is changed. In contrast to the temporary solution before, the barrier generation in Clang does not need to be aware of the "CancelDestination" block. Instead, the finalization callback is and, as described above, later even that one does not need to be. D70109 will be updated to use this scheme. Reviewed By: ABataev Differential Revision: https://reviews.llvm.org/D70258
* [OPENMP]Add extra checks and initialization for clause modifier.Alexey Bataev2019-12-242-2/+15
| | | | | Added initialization of the extra modifier to silence sanitizer. Added extra checks to avoid such trouble in future.
* [OPENMP50]Basic support for conditional lastprivate.Alexey Bataev2019-12-247-53/+132
| | | | Added parsing/sema checks for conditional lastprivates.
* [NFC] Remove some dead code from CGBuiltin.cpp.Kevin P. Neal2019-12-241-14/+0
|
* [clang] [ast] CXXRecordDecl::getVisibleConversionFunctions() could be constWhisperity2019-12-241-12/+10
| | | | | | | | | | The function and its called static helpers don't modify the received CXXRecordDecl arguments at all as the method's result is put into an output parameter. Thus they can be const which allows for neatly grabbing the conversion methods in a context where we only have a const ASTUnit at hand. Differential Revision: https://reviews.llvm.org/D71805
* [CFG] Fix an assertion failure with static initializersGabor Horvath2019-12-231-1/+1
| | | | | | | | | | | | | The CFGBlock::getLastCondition was not prepared for static initializer branches. This patch also revamps CFG unit tests. Earlier the lifetime of the AST was smaller than the CFG. So all the AST pointers within the CFG blocks were dangling. This was OK, since none of the tests dereferenced those pointers. This was, however, a timed bomb. There were patches in the past that were reverted partially due to this problem. Differential revision: https://reviews.llvm.org/D71791
* [Sema][X86] Consider target attribute into the checks in validateOutputSize ↵Craig Topper2019-12-237-82/+98
| | | | | | | | | | | | | and validateInputSize. The validateOutputSize and validateInputSize need to check whether AVX or AVX512 are enabled. But this can be affected by the target attribute so we need to factor that in. This patch moves some of the code from CodeGen to create an appropriate feature map that we can pass to the function. Differential Revision: https://reviews.llvm.org/D68627
* [OPENMP50]Codegen for nontemporal clause.Alexey Bataev2019-12-239-23/+147
| | | | | | | | | | | | | | | | Summary: Basic codegen for the declarations marked as nontemporal. Also, if the base declaration in the member expression is marked as nontemporal, lvalue for member decl access inherits nonteporal flag from the base lvalue. Reviewers: rjmccall, hfinkel, jdoerfert Subscribers: guansong, arphaman, caomhin, kkwli0, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71708
* [NFC] Move OptionUtils from Basic to DriverYaxun (Sam) Liu2019-12-233-3/+2
| | | | Differential Revision: https://reviews.llvm.org/D71802
* [OpenCL] Add atomic builtin functionsSven van Haastregt2019-12-231-0/+79
| | | | | | Add atomic builtin functions from the OpenCL C specification. Patch by Pierre Gondois and Sven van Haastregt.
* [ItaniumCXXABI] Don't mark an extern_weak init function as dso_local on windowsMartin Storsjö2019-12-231-1/+3
| | | | | | | | | Since 6bf108d77a3c, we try to not mark extern_weak symbols as dso_local, to allow using COFF stubs for references to those symbols (as the symbol may be missing, resolving to an absolute address zero, outside of the current DSO). Differential Revision: https://reviews.llvm.org/D71716
* [Concepts] Constrained partial specializations and function overloads.Saar Raz2019-12-2310-85/+716
| | | | | | | Added support for constraint satisfaction checking and partial ordering of constraints in constrained partial specialization and function template overloads. Re-commit after fixing another crash (added regression test). Differential Revision: https://reviews.llvm.org/D41910
* [AST] Add missing MultiplexConsumer::CompleteExternalDeclarationReid Kleckner2019-12-221-0/+5
|
* reland "[DebugInfo] Support to emit debugInfo for extern variables"Yonghong Song2019-12-229-2/+65
| | | | | | | | | | | | | Commit d77ae1552fc21a9f3877f3ed7e13d631f517c825 ("[DebugInfo] Support to emit debugInfo for extern variables") added deebugInfo for extern variables for BPF target. The commit is reverted by 891e25b02d760d0de18c7d46947913b3166047e7 as the committed tests using %clang instead of %clang_cc1 causing test failed in certain scenarios as reported by Reid Kleckner. This patch fixed the tests by using %clang_cc1. Differential Revision: https://reviews.llvm.org/D71818
* Revert "[DebugInfo] Support to emit debugInfo for extern variables"Reid Kleckner2019-12-229-65/+2
| | | | | | | This reverts commit d77ae1552fc21a9f3877f3ed7e13d631f517c825. The tests committed along with this change do not pass, and should be changed to use %clang_cc1.
* Revert "[Concepts] Constrained partial specializations and function overloads."Reid Kleckner2019-12-2210-718/+85
| | | | | | This reverts commit d3f5769d5e93b30d4a8b4696381d5e4a304992fa. Causes crashes on Chromium. Have reproducer, will reduce and send along.
* [Analyzer] Fixes -Wrange-loop-analysis warningsMark de Wever2019-12-223-5/+6
| | | | | | This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall. Differential Revision: https://reviews.llvm.org/D71809
* [ms] [X86] Use "P" modifier on operands to call instructions in inline X86 ↵Eric Astor2019-12-221-0/+4
| | | | | | | | | | | | | | | | | | | | assembly. Summary: This is documented as the appropriate template modifier for call operands. Fixes PR44272, and adds a regression test. Also adds support for operand modifiers in Intel-style inline assembly. Reviewers: rnk Reviewed By: rnk Subscribers: merge_guards_bot, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71677
* [Sema] SequenceChecker: C++17 sequencing rules for built-in operators <<, ↵Bruno Ricci2019-12-221-25/+83
| | | | | | | | | | | >>, .*, ->*, =, op= Implement the C++17 sequencing rules for the built-in operators <<, >>, .*, ->*, = and op=. Differential Revision: https://reviews.llvm.org/D58297 Reviewed By: rsmith
* [Sema] SequenceChecker: Fix handling of operator ||, && and ?:Bruno Ricci2019-12-221-31/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | The current handling of the operators ||, && and ?: has a number of false positive and false negative. The issues for operator || and && are: 1. We need to add sequencing regions for the LHS and RHS as is done for the comma operator. Not doing so causes false positives in expressions like `((a++, false) || (a++, false))` (from PR39779, see PR22197 for another example). 2. In the current implementation when the evaluation of the LHS fails, the RHS is added to a worklist to be processed later. This results in false negatives in expressions like `(a && a++) + a`. Fix these issues by introducing sequencing regions for the LHS and RHS, and by not deferring the visitation of the RHS. The issues with the ternary operator ?: are similar, with the added twist that we should not warn on expressions like `(x ? y += 1 : y += 2)` since exactly one of the 2nd and 3rd expression is going to be evaluated, but we should still warn on expressions like `(x ? y += 1 : y += 2) = y`. Differential Revision: https://reviews.llvm.org/D57747 Reviewed By: rsmith
* [Sema] SequenceChecker: Add some comments + related small NFCsBruno Ricci2019-12-221-73/+122
| | | | | | | | | | | | NFCs factored out of the following patches: - Change all of the `Expr *` to `const Expr *` in SequenceChecker for const-correctness. SequenceChecker should not modify AST nodes. - Add some comments. - clang-format Differential Revision: https://reviews.llvm.org/D57659 Reviewed By: xbolva00
OpenPOWER on IntegriCloud