Closed filippobrizzi closed 10 years ago
Hi Filippo,
Thanks for your congrats and take my apologies for the delay with the answer.
So, you want to access in function, generated from Captured Statement a variable, that is not referenced in this Captured Statement, right?
Captured Statement tries to capture all referenced local variables into generated RecordDecl
. So, I would recommend you to use the same technique: mark your variables as used in context of Captured Statement using method Sema::MarkVariableReferenced()
. Just call this method with all your variables between Sema::ActOnCapturedRegionStart()
and Sema::ActOnCapturedRegionEnd()
. It will mark your variables as referenced in CapturedStmt
and you will get access to all these variables automatically.
Hi Alexey, thank you for the reply. I have seen that CapturedStmt has capture_begin() which gives the list of all and only the variables that are used inside CapturedStmt and that are not instantiated there. So it seems to solve all of my problems without further addition.
Hi, first of all congratulation for the incredible work you did!
For my thesis I have to transform each pragma Task into a function. The problem is that I have to pass to this function the variables that are not instantiated inside the pragma but I can access easily only the variables expressed as clauses. Looking at the code I have seen that there is EmitOMPTaskDirective() which should do exactly what I need. When I parse the code using RecursiveASTVisitor I can access the OMPExecutableDirective and catch the CapturedStmt but EmitOMPTaskDirective uses a lot of function from CodeGenFunction and CodeGenModule and I don’t know how to access to this objects. Could you please give me same hints about how to gain access to CodeGenModule or if there is another way to solve my problem? Thank you very much!