summaryrefslogtreecommitdiffstats
path: root/include/clang/Serialization
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2019-03-06 07:45:10 +0000
committerRoman Lebedev <lebedev.ri@gmail.com>2019-03-06 07:45:10 +0000
commit134d9aa746792d05d7b2e93b99809bc5efb9ae95 (patch)
tree32a315dd2903b4fe54dc16395158142bf9ca92bc /include/clang/Serialization
parent38f1a525822288cc0aec7b2470edb61c2a2c0188 (diff)
[clang][OpenMP] Revert "OMPFlushClause is synthetic, no such clause exists"
Summary: This reverts rL352390 / D57280. As discussed in https://reviews.llvm.org/D57112#inline-506781, 'flush' clause does not exist in the OpenMP spec, it can not be specified, and `OMPFlushClause` class is just a helper class. Now, here's the caveat. I have read @ABataev's > Well, I think it would be good to filter out OMPC_flush somehow > because there is no such clause actually, it is a pseudo clause > for better handling of the flush directive. as if that clause is pseudo clause that only exists for the sole purpose of simplifying the parser. As in, it never reaches AST. I did not however try to verify that. Too bad, i was wrong. It absolutely *does* reach AST. Therefore my understanding/justification for the change was flawed, which makes the patch a regression which **must** be reverted. @gribozavr has brought that up again in https://reviews.llvm.org/D57112#inline-521238 > > ... > Sorry to be late for this discussion, but I don't think this conclusion > follows. ASTMatchers are supposed to match the AST as it is. > Even if OMPC_flush is synthetic, it exists in the AST, and users might > want to match it. I think users would find anything else (trying to filter > out AST nodes that are not in the source code) to be surprising. For example, > there's a matcher materializeTemporaryExpr even though this AST node is a > Clang invention and is not a part of the C++ spec. > > Matching only constructs that appear in the source code is not feasible with > ASTMatchers, because they are based on Clang's AST that exposes tons of semantic > information, and its design is dictated by the structure of the semantic information. > See "RFC: Tree-based refactorings with Clang" in cfe-dev for a library that will > focus on representing source code as faithfully as possible. > > Not to even mention that this code is in ASTTypeTraits, a general library for > handling AST nodes, not specifically for AST Matchers... Reviewers: gribozavr, ABataev, rjmccall, aaron.ballman Reviewed By: gribozavr, ABataev Subscribers: dylanmckay, guansong, arphaman, jdoerfert, cfe-commits, gribozavr, ABataev Tags: #clang, #openmp Differential Revision: https://reviews.llvm.org/D58979 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355486 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Serialization')
-rw-r--r--include/clang/Serialization/ASTReader.h1
-rw-r--r--include/clang/Serialization/ASTWriter.h1
2 files changed, 0 insertions, 2 deletions
diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h
index 798adeeade..5b92b13722 100644
--- a/include/clang/Serialization/ASTReader.h
+++ b/include/clang/Serialization/ASTReader.h
@@ -2686,7 +2686,6 @@ public:
: Record(Record), Context(Record.getContext()) {}
#define OPENMP_CLAUSE(Name, Class) void Visit##Class(Class *C);
- OPENMP_CLAUSE(flush, OMPFlushClause)
#include "clang/Basic/OpenMPKinds.def"
OMPClause *readClause();
void VisitOMPClauseWithPreInit(OMPClauseWithPreInit *C);
diff --git a/include/clang/Serialization/ASTWriter.h b/include/clang/Serialization/ASTWriter.h
index 2d12f6ae17..32c02bddb5 100644
--- a/include/clang/Serialization/ASTWriter.h
+++ b/include/clang/Serialization/ASTWriter.h
@@ -999,7 +999,6 @@ class OMPClauseWriter : public OMPClauseVisitor<OMPClauseWriter> {
public:
OMPClauseWriter(ASTRecordWriter &Record) : Record(Record) {}
#define OPENMP_CLAUSE(Name, Class) void Visit##Class(Class *S);
- OPENMP_CLAUSE(flush, OMPFlushClause)
#include "clang/Basic/OpenMPKinds.def"
void writeClause(OMPClause *C);
void VisitOMPClauseWithPreInit(OMPClauseWithPreInit *C);