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
- Repository
- rL LLVM
Event Timeline
include/clang/AST/Stmt.h | ||
---|---|---|
2044 ↗ | (On Diff #13030) | VAT? Do you mean VLA? |
lib/AST/Decl.cpp | ||
3274 ↗ | (On Diff #13030) | Calling this function here seems confusing because this has nothing to do with VLAs. |
3564 ↗ | (On Diff #13030) | Is testing the source location really necessary here? That seems fragile. |
lib/CodeGen/CGStmt.cpp | ||
2161 ↗ | (On Diff #13030) | Why not use Loc (S.getLocStart()) as the source location? |
Generally looks good. A few comments inline.
include/clang/AST/Stmt.h | ||
---|---|---|
1985 ↗ | (On Diff #13030) | Leave a comma after the last enumerator, please. |
lib/AST/Decl.cpp | ||
3274 ↗ | (On Diff #13030) | 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. |
3564 ↗ | (On Diff #13030) | 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 ↗ | (On Diff #15134) | 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.