Skip to content

Commit

Permalink
Add workaround to fix llvm#24
Browse files Browse the repository at this point in the history
  • Loading branch information
manorom committed Mar 28, 2019
1 parent 6a8009d commit 07ec398
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions clang/tools/sotoc/src/TargetCodeFragment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,20 @@ clang::SourceRange TargetCodeRegion::getInnerRange() {

std::string TargetCodeRegion::PrintLocalVarsFromClauses() {
std::stringstream Out;
std::set<std::string> Printed;
for (auto C : OMPClauses) {
if (C->getClauseKind() == clang::OpenMPClauseKind::OMPC_private) {
auto PC = llvm::dyn_cast<clang::OMPPrivateClause>(C);
for (auto Var : PC->varlists()) {
std::string PrettyStr = "";
llvm::raw_string_ostream PrettyOS(PrettyStr);
Var->printPretty(PrettyOS, NULL, PP);
Out << " " << Var->getType().getAsString() << " " << PrettyOS.str()
<< ";\n";
std::string VarName = PrettyOS.str();
if (!Printed.count(VarName)) {
Out << " " << Var->getType().getAsString() << " " << VarName
<< ";\n";
Printed.insert(VarName);
}
}
}
}
Expand Down

0 comments on commit 07ec398

Please sign in to comment.