Skip to content

Commit e7e8789

Browse files
committed
Revert "[OPENMP]Add support for analysis of if clauses."
This reverts commit rL366068. The patch broke 86 tests under clang/test/OpenMP/ when run with address sanitizer. llvm-svn: 366169
1 parent 1739b70 commit e7e8789

27 files changed

+239
-494
lines changed

clang/include/clang/AST/OpenMPClause.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -501,10 +501,11 @@ class OMPIfClause : public OMPClause, public OMPClauseWithPreInit {
501501
return const_child_range(&Condition, &Condition + 1);
502502
}
503503

504-
child_range used_children();
504+
child_range used_children() {
505+
return child_range(child_iterator(), child_iterator());
506+
}
505507
const_child_range used_children() const {
506-
auto Children = const_cast<OMPIfClause *>(this)->used_children();
507-
return const_child_range(Children.begin(), Children.end());
508+
return const_child_range(const_child_iterator(), const_child_iterator());
508509
}
509510

510511
static bool classof(const OMPClause *T) {

clang/lib/AST/OpenMPClause.cpp

-19
Original file line numberDiff line numberDiff line change
@@ -209,25 +209,6 @@ const OMPClauseWithPostUpdate *OMPClauseWithPostUpdate::get(const OMPClause *C)
209209
return nullptr;
210210
}
211211

212-
/// Gets the address of the original, non-captured, expression used in the
213-
/// clause as the preinitializer.
214-
static Stmt **getAddrOfExprAsWritten(Stmt *S) {
215-
if (!S)
216-
return nullptr;
217-
if (auto *DS = dyn_cast<DeclStmt>(S)) {
218-
assert(DS->isSingleDecl() && "Only single expression must be captured.");
219-
if (auto *OED = dyn_cast<OMPCapturedExprDecl>(DS->getSingleDecl()))
220-
return OED->getInitAddress();
221-
}
222-
return nullptr;
223-
}
224-
225-
OMPClause::child_range OMPIfClause::used_children() {
226-
if (Stmt **C = getAddrOfExprAsWritten(getPreInitStmt()))
227-
return child_range(C, C + 1);
228-
return child_range(&Condition, &Condition + 1);
229-
}
230-
231212
OMPOrderedClause *OMPOrderedClause::Create(const ASTContext &C, Expr *Num,
232213
unsigned NumLoops,
233214
SourceLocation StartLoc,

0 commit comments

Comments
 (0)