File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -174,15 +174,20 @@ clang::SourceRange TargetCodeRegion::getInnerRange() {
174174
175175std::string TargetCodeRegion::PrintLocalVarsFromClauses () {
176176 std::stringstream Out;
177+ std::set<std::string> Printed;
177178 for (auto C : OMPClauses) {
178179 if (C->getClauseKind () == clang::OpenMPClauseKind::OMPC_private) {
179180 auto PC = llvm::dyn_cast<clang::OMPPrivateClause>(C);
180181 for (auto Var : PC->varlists ()) {
181182 std::string PrettyStr = " " ;
182183 llvm::raw_string_ostream PrettyOS (PrettyStr);
183184 Var->printPretty (PrettyOS, NULL , PP);
184- Out << " " << Var->getType ().getAsString () << " " << PrettyOS.str ()
185- << " ;\n " ;
185+ std::string VarName = PrettyOS.str ();
186+ if (!Printed.count (VarName)) {
187+ Out << " " << Var->getType ().getAsString () << " " << VarName
188+ << " ;\n " ;
189+ Printed.insert (VarName);
190+ }
186191 }
187192 }
188193 }
You can’t perform that action at this time.
0 commit comments