summaryrefslogtreecommitdiff
path: root/lib/AST/Stmt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang] Ensure that statements, expressions and types are trivially destructibleBruno Ricci2019-08-271-0/+11
| | | | | | | | | | | | | | | Since statements, expressions and types are allocated with the BumpPtrAllocator from ASTContext their destructor is not executed. Two classes are currently exempted from the check : InitListExpr due to its ASTVector and ConstantArrayType due to its APInt. No functional changes. Differential Revision: https://reviews.llvm.org/D66646 Reviewed By: lebedev.ri, gribozavr git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370044 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-check in clang support gun asm goto after fixing tests.Jennifer Yu2019-06-031-6/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362410 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "clang support gnu asm goto."Erich Keane2019-05-301-23/+6
| | | | | | | | | | | This reverts commit 954ec09aed4f2be04bb5f4e10dbb4ea8bd19ef9a. Reverting due to test failures as requested by Jennifer Yu. Conflicts: clang/test/CodeGen/asm-goto.c git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362106 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] asm goto labels don't have constraints, don't try to copy them.Benjamin Kramer2019-05-301-4/+6
| | | | | | Found by asan. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362062 91177308-0d34-0410-b5e6-96231b3b80d8
* clang support gnu asm goto.Jennifer Yu2019-05-301-6/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Syntax: asm [volatile] goto ( AssemblerTemplate : : InputOperands : Clobbers : GotoLabels) https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html New llvm IR is "callbr" for inline asm goto instead "call" for inline asm For: asm goto("testl %0, %0; jne %l1;" :: "r"(cond)::label_true, loop); IR: callbr void asm sideeffect "testl $0, $0; jne ${1:l};", "r,X,X,~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* blockaddress(@foo, %label_true), i8* blockaddress(@foo, %loop)) #1 to label %asm.fallthrough [label %label_true, label %loop], !srcloc !3 asm.fallthrough: Compiler need to generate: 1> a dummy constarint 'X' for each label. 2> an unique fallthrough label for each asm goto stmt " asm.fallthrough%number". Diagnostic 1> duplicate asm operand name are used in output, input and label. 2> goto out of scope. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@362045 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST][NFC] Add const children() accessors to all AST nodesBruno Ricci2019-04-121-0/+4
| | | | | | | | | | | | | | | | Systematically add the const-qualified version of children() to all statement/expression nodes. Previously the const-qualified variant was only defined for some nodes. NFC. Patch by: Nicolas Manichon Differential Revision: https://reviews.llvm.org/D60029 Reviewed By: riccibruno git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358288 91177308-0d34-0410-b5e6-96231b3b80d8
* PR40642: Fix determination of whether the final statement of a statementRichard Smith2019-02-151-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | expression is a discarded-value expression. Summary: We used to get this wrong in three ways: 1) During parsing, an expression-statement followed by the }) ending a statement expression was always treated as producing the value of the statement expression. That's wrong for ({ if (1) expr; }) 2) During template instantiation, various kinds of statement (most statements not appearing directly in a compound-statement) were not treated as discarded-value expressions, resulting in missing volatile loads (etc). 3) In all contexts, an expression-statement with attributes was not treated as producing the value of the statement expression, eg ({ [[attr]] expr; }). Also fix incorrect enforcement of OpenMP rule that directives can "only be placed in the program at a position where ignoring or deleting the directive would result in a program with correct syntax". In particular, a label (be it goto, case, or default) should not affect whether directives are permitted. Reviewers: aaron.ballman, rjmccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57984 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354090 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Update the comments of the various Expr::Ignore* + Related cleanupsBruno Ricci2019-02-031-24/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The description of what the various Expr::Ignore* do has drifted from the actual implementation. Inspection reveals that IgnoreParenImpCasts() is not equivalent to doing IgnoreParens() + IgnoreImpCasts() until reaching a fixed point, but IgnoreParenCasts() is equivalent to doing IgnoreParens() + IgnoreCasts() until reaching a fixed point. There is also a fair amount of duplication in the various Expr::Ignore* functions which increase the chance of further future inconsistencies. In preparation for the next patch which will factor out the implementation of the various Expr::Ignore*, do the following cleanups: Remove Stmt::IgnoreImplicit, in favor of Expr::IgnoreImplicit. IgnoreImplicit is the only function among all of the Expr::Ignore* which is available in Stmt. There are only a few users of Stmt::IgnoreImplicit. They can just use instead Expr::IgnoreImplicit like they have to do for the other Ignore*. Move Expr::IgnoreImpCasts() from Expr.h to Expr.cpp. This made no difference in the run-time with my usual benchmark (-fsyntax-only on all of Boost). While we are at it, make IgnoreParenNoopCasts take a const reference to the ASTContext for const correctness. Update the comments to match what the Expr::Ignore* are actually doing. I am not sure that listing exactly what each Expr::Ignore* do is optimal, but it certainly looks better than the current state which is in my opinion between misleading and just plain wrong. The whole patch is NFC (if you count removing Stmt::IgnoreImplicit as NFC). Differential Revision: https://reviews.llvm.org/D57266 Reviewed By: aaron.ballman git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353006 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Assert that no statement/expression class is polymorphicBruno Ricci2018-12-041-0/+8
| | | | | | | | | | | | | Add a static_assert checking that no statement/expression class is polymorphic. People should use LLVM style RTTI instead. Differential Revision: https://reviews.llvm.org/D55222 Reviewed By: aaron.ballman git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348278 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] [analyzer] NFC: Reuse code in stable ID dumping methods.Artem Dergachev2018-12-031-4/+1
| | | | | | | | | Use the new fancy method introduced in r348197 to simplify some code. Differential Revision: https://reviews.llvm.org/D54488 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348199 91177308-0d34-0410-b5e6-96231b3b80d8
* Create ConstantExpr classBill Wendling2018-10-311-2/+2
| | | | | | | | | | | | | | | | | A ConstantExpr class represents a full expression that's in a context where a constant expression is required. This class reflects the path the evaluator took to reach the expression rather than the syntactic context in which the expression occurs. In the future, the class will be expanded to cache the result of the evaluated expression so that it's not needlessly re-evaluated Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D53475 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345692 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Only store data for the NRVO candidate in ReturnStmt if neededBruno Ricci2018-10-301-4/+26
| | | | | | | | | | | | | | | Only store the NRVO candidate if needed in ReturnStmt. A good chuck of all of the ReturnStmt have no NRVO candidate (more than half when parsing all of Boost). For all of them this saves one pointer. This has no impact on children(). Differential Revision: https://reviews.llvm.org/D53716 Reviewed By: rsmith git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345605 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Only store the needed data in WhileStmtBruno Ricci2018-10-301-15/+43
| | | | | | | | | | | | | | Don't store the data for the condition variable if not needed. This cuts the size of WhileStmt by up to a pointer. The order of the children is kept the same. Differential Revision: https://reviews.llvm.org/D53715 Reviewed By: rjmccall git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345597 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Only store the needed data in SwitchStmtBruno Ricci2018-10-291-16/+52
| | | | | | | | | | | | | | | | | | Don't store the data for the init statement and condition variable if not needed. This cuts the size of SwitchStmt by up to 2 pointers. The order of the children is intentionally kept the same. Also use the newly available space in the bit-fields of Stmt to store the bit representing whether all enums have been covered instead of using a PointerIntPair. Differential Revision: https://reviews.llvm.org/D53714 Reviewed By: rjmccall git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345510 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Don't store data for GNU range case statement if not neededBruno Ricci2018-10-281-6/+21
| | | | | | | | | | | | | | | | | | Don't store the data for case statements of the form LHS ... RHS if not needed. This cuts the size of CaseStmt by 1 pointer + 1 SourceLocation in the common case. Also use the newly available space in the bit-fields of Stmt to store the keyword location of SwitchCase and move the small accessor SwitchCase::getSubStmt to the header. Differential Revision: https://reviews.llvm.org/D53609 Reviewed By: rjmccall git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345472 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Only store the needed data in IfStmtBruno Ricci2018-10-271-19/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | Only store the needed data in IfStmt. This cuts the size of IfStmt by up to 3 pointers + 1 SourceLocation. The order of the children is intentionally kept the same even though it would be more convenient to put the optional trailing objects last. Additionally use the newly available space in the bit-fields of Stmt to store the location of the "if". The result of this is that for the common case of an if statement of the form: if (some_cond) some_statement the size of IfStmt is brought down to 8 bytes + 2 pointers, instead of 8 bytes + 5 pointers + 2 SourceLocation. Differential Revision: https://reviews.llvm.org/D53607 Reviewed By: rjmccall git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345464 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Widen the bit-fields of Stmt to 8 bytes.Bruno Ricci2018-10-271-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | Although some classes are using the tail padding of Stmt, most of them are not. In particular the expression classes are not using it since there is Expr in between, and Expr contains a single pointer. This patch widen the bit-fields to Stmt to 8 bytes and move some data from NullStmt, CompoundStmt, LabelStmt, AttributedStmt, SwitchStmt, WhileStmt, DoStmt, ForStmt, GotoStmt, ContinueStmt, BreakStmt and ReturnStmt to the newly available space. In itself this patch do not achieve much but I plan to go through each of the classes in the statement/expression hierarchy and use this newly available space. A quick estimation gives me that this should shrink the size of the statement/expression hierarchy by >10% when parsing all of Boost. Differential Revision: https://reviews.llvm.org/D53604 Reviewed By: rjmccall git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345459 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Further printing improvements: use declarations,George Karpenkov2018-09-151-1/+0
| | | | | | | | skip pointers whenever redundant, use unique prefixes. Differential Revision: https://reviews.llvm.org/D52114 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342316 91177308-0d34-0410-b5e6-96231b3b80d8
* Support generating unique identifiers for Stmt objectsGeorge Karpenkov2018-09-151-0/+8
| | | | | | | | | The generated identifiers are stable across multiple runs, and can be a great debug or visualization aid. Differential Revision: https://reviews.llvm.org/D51822 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@342309 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Stmt::ignoreImplicitStephen Kelly2018-08-141-8/+14
| | | | | | | | | | | | | | | | Summary: A CXXBindTemporaryExpr can appear inside an ImplicitCastExpr, and was not ignored previously. Fixes the case reported in PR37327. Reviewers: rsmith, dblaikie, klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50666 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339730 91177308-0d34-0410-b5e6-96231b3b80d8
* Port getLocEnd -> getEndLocStephen Kelly2018-08-091-11/+9
| | | | | | | | | | Reviewers: teemperor! Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50351 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339386 91177308-0d34-0410-b5e6-96231b3b80d8
* Port getLocStart -> getBeginLocStephen Kelly2018-08-091-15/+13
| | | | | | | | | | Reviewers: teemperor! Subscribers: jholewinski, whisperity, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D50350 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339385 91177308-0d34-0410-b5e6-96231b3b80d8
* Add getEndLoc API to replace getLocEndStephen Kelly2018-08-091-1/+1
| | | | | | | | Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50348 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339374 91177308-0d34-0410-b5e6-96231b3b80d8
* Add getBeginLoc API to replace getLocStartStephen Kelly2018-08-091-2/+2
| | | | | | | | Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50346 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339372 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-5/+5
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331834 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typos in clangAlexander Kornienko2018-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of: archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.) Differential revision: https://reviews.llvm.org/D44188 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329399 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Fix some Clang-tidy modernize-use-auto warnings; other minor fixes (NFC).Eugene Zelenko2018-04-031-33/+33
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329036 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Inline CompoundStmt contents into the parent allocation.Benjamin Kramer2017-12-241-18/+21
| | | | | | Saves a pointer on every CompoundStmt. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321429 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Convert AttributedStmt to llvm::TrailingObjects.Benjamin Kramer2017-12-241-2/+2
| | | | | | No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321428 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-141-32/+40
| | | | | | minor fixes (NFC). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318221 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Support for re-declarations when checking captured variables.Alexey Bataev2017-09-201-5/+1
| | | | | | | Need to check for variables re-declarations when checking that the variable was already captured in the captured region. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313805 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Check DSA for variables captured by value.Alexey Bataev2017-05-151-1/+1
| | | | | | | | Currently clang checks for default data sharing attributes only for variables captured in OpenMP regions by reference. Patch adds checks for variables captured by value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303077 91177308-0d34-0410-b5e6-96231b3b80d8
* Spelling mistakes in comments. NFCI. (PR27635)Simon Pilgrim2017-03-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299083 91177308-0d34-0410-b5e6-96231b3b80d8
* [x86][inline-asm] Add support for curly brackets escape using "%" in ↵Michael Zuckerman2016-10-311-7/+9
| | | | | | | | | | | | | | | | | | | extended inline asm. Commit on behalf of mharoush After LGTM and check all: This patch is a compatibility fix for clang, matching GCC support for charter escape when using extended in-line assembly (i.e, "%{" ,"%}" --> "{" ,"}" ). It is meant to enable support for advanced features such as AVX512 conditional\masked vector instructions/broadcast assembly syntax. Reviewer: 1. rnk Differential Revision: https://reviews.llvm.org/D25012 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285585 91177308-0d34-0410-b5e6-96231b3b80d8
* Retire llvm::alignOf in favor of C++11 alignof.Benjamin Kramer2016-10-201-5/+5
| | | | | | No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284730 91177308-0d34-0410-b5e6-96231b3b80d8
* [ObjC] Warn on unguarded use of partial declarationErik Pilkington2016-08-161-0/+4
| | | | | | | | | | | | | | This commit adds a traversal of the AST after Sema of a function that diagnoses unguarded references to declarations that are partially available (based on availability attributes). This traversal is only done when we would otherwise emit -Wpartial-availability. This commit is part of a feature I proposed here: http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html Differential revision: https://reviews.llvm.org/D23003 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278826 91177308-0d34-0410-b5e6-96231b3b80d8
* P0305R0: Semantic analysis and code generation for C++17 init-statement for ↵Richard Smith2016-07-141-3/+6
| | | | | | | | | | | 'if' and 'switch': if (stmt; condition) { ... } Patch by Anton Bikineev! Some minor formatting and comment tweets by me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275350 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement p0292r2 (constexpr if), a likely C++1z feature.Richard Smith2016-06-231-4/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273602 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid O(n^2) string analysis when handling GNU __asm__ statements.Richard Smith2016-05-161-8/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269716 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for LLVM function name change.Rui Ueyama2016-01-141-4/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257802 91177308-0d34-0410-b5e6-96231b3b80d8
* [ptr-traits] Move methods manipulating PointerUnions, DenseMap pointerChandler Carruth2015-12-301-0/+34
| | | | | | | | | | | | | | | keys, and PointerIntPairs where the pointee types are incomplete out-of-line to where we have the complete type. This is the standard pattern used throughout the AST library to address the inherently mutually cross referenced nature of the AST. This is part of a series of patches to allow LLVM to check for complete pointee types when computing its pointer traits. This is absolutely necessary to get correct (or reproducible) results for things like how many low bits are guaranteed to be zero. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256612 91177308-0d34-0410-b5e6-96231b3b80d8
* Use std::copy and std::transform instead of manual loops. NFCCraig Topper2015-12-051-17/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254845 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] ArrayRef-ize CompoundStmt::setStmts.Craig Topper2015-12-041-6/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254703 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenMP] Update target directive codegen to use 4.5 implicit data mappings.Samuel Antao2015-12-021-0/+27
| | | | | | | | | | | | | | | Summary: This patch implements the 4.5 specification for the implicit data maps. OpenMP 4.5 specification changes the default way data is captured into a target region. All the non-aggregate kinds are passed by value by default. This required activating the capturing by value during SEMA for the target region. All the non-aggregate values that can be encoded in the size of a pointer are properly casted and forwarded to the runtime library. On top of fixing the previous weird behavior for mapping pointers in nested data regions (an explicit map was always required), this also improves performance as the number of allocations/transactions to the device per non-aggregate map are reduced from two to only one - instead of passing a reference and the value, only the value passed. Explicit maps will be added later on once firstprivate, private, and map clauses' SEMA and parsing are available. Reviewers: hfinkel, rjmccall, ABataev Subscribers: cfe-commits, carlo.bertolli Differential Revision: http://reviews.llvm.org/D14940 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254521 91177308-0d34-0410-b5e6-96231b3b80d8
* Move functions declared in Stmt{ObjC,CXX}.h and OpenMPClause.h intoJames Y Knight2015-10-021-1258/+0
| | | | | | | | | | | their associated .cpp file. Previous refactorings long long ago had split out the above categories of classes from Stmt.h into their own header files, but failed to also split the Stmt.cpp implementation file similarly. Do so for readability's sake. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249131 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP 4.1] Add 'threads' clause for '#pragma omp ordered'.Alexey Bataev2015-09-251-6/+12
| | | | | | | | | OpenMP 4.1 extends format of '#pragma omp ordered'. It adds 3 additional clauses: 'threads', 'simd' and 'depend'. If no clause is specified, the ordered construct behaves as if the threads clause had been specified. If the threads clause is specified, the threads in the team executing the loop region execute ordered regions sequentially in the order of the loop iterations. The loop region to which an ordered region without any clause or with a threads clause binds must have an ordered clause without the parameter specified on the corresponding loop directive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248569 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP 4.0] Add 'if' clause for 'cancel' directive.Alexey Bataev2015-09-181-6/+11
| | | | | | | Add parsing, sema analysis and codegen for 'if' clause in 'cancel' directive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247976 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Emit __kmpc_cancel_barrier() and code for 'cancellation point' only ↵Alexey Bataev2015-09-151-15/+19
| | | | | | | | | | | | | | | if 'cancel' is found. Patch improves codegen for OpenMP constructs. If the OpenMP region does not have internal 'cancel' construct, a call to 'void __kmpc_barrier()' runtime function is generated for all implicit/explicit barriers. If the region has inner 'cancel' directive, then ``` if (__kmpc_cancel_barrier()) exit from outer construct; ``` code is generated. Also, the code for 'canellation point' directive is not generated if parent directive does not have 'cancel' directive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247681 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenMP] Make the filetered clause iterator a real iterator and type safe.Benjamin Kramer2015-08-301-12/+0
| | | | | | | | | This replaces the filtered generic iterator with a type-specfic one based on dyn_cast instead of comparing the kind enum. This allows us to use range-based for loops and eliminates casts. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246384 91177308-0d34-0410-b5e6-96231b3b80d8