An updated implemnentation of VLA types capturing based on previously committed solution for Lambdas.
This version captures the whole VLA type instead of particular variables which are part of VLA size expression and allows to use previusly calculated size of VLA type in captured regions. Required for OpenMP.
Details
Diff Detail
Event Timeline
include/clang/AST/Stmt.h | ||
---|---|---|
2048 | VAT? Do you mean VLA? | |
lib/AST/Decl.cpp | ||
3286 | Calling this function here seems confusing because this has nothing to do with VLAs. | |
3569 | Is testing the source location really necessary here? That seems fragile. | |
lib/CodeGen/CGStmt.cpp | ||
2195 | Why not use Loc (S.getLocStart()) as the source location? |
Generally looks good. A few comments inline.
include/clang/AST/Stmt.h | ||
---|---|---|
1989 | Leave a comma after the last enumerator, please. | |
lib/AST/Decl.cpp | ||
3286 | It's because we're reusing the same member to store
However, this is getting out of hand. Querying this should be efficient. I'm committing a patch to fix this; you'll have to rebase some of this patch on top of that. | |
3569 | I agree, there is absolutely no reason to be doing this. If you need a bit to store that this is a capture record, find a bit to use. Or set an attribute. |
This looks great; one minor suggestion and it's good to go.
lib/AST/Decl.cpp | ||
---|---|---|
3572 | We don't actually need or want to support removing this, so there's no point in taking a parameter. |
Ok, will remove it
Best regards,
Alexey Bataev
Software Engineer
Intel Compiler Team
20.10.2014 22:09, John McCall пишет:
This looks great; one minor suggestion and it's good to go.
Comment at: lib/AST/Decl.cpp:3572
@@ +3571,3 @@
+
+void RecordDecl::setCapturedRecord(bool CapRec) {+ if (CapRec)
We don't actually need or want to support removing this, so there's no point in taking a parameter.
Leave a comma after the last enumerator, please.