Skip to content

Commit

Permalink
Filter out variables which should not be params
Browse files Browse the repository at this point in the history
Previously we collected all variables declared and used in for loops and
made them into target region parameters. Now we check wether these
variables where declared outside the target region first.
  • Loading branch information
manorom committed Apr 26, 2019
1 parent 483c414 commit a952ea3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clang/tools/sotoc/src/Visitors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ void FindTargetCodeVisitor::addTargetRegionArgs(
for (const auto i : *FindLoopVisitor.getVarSet()) {
DEBUGP("Iterating var set");
// i->print(llvm::outs());
if (Context.getSourceManager().isBeforeInTranslationUnit(
S->getBeginLoc(),i->getSourceRange().getBegin())) {
tmpSet.insert(i);
continue;
}
for (auto j : *TCR->getOMPClauses()) {
for (auto CC : j->children()) {
if (auto CC_DeclRefExpr =
Expand Down
Binary file removed clang/tools/sotoc/test/arrays/a.out
Binary file not shown.

0 comments on commit a952ea3

Please sign in to comment.