Changes in src/AST/Inspect.cpp [7b71402:b70abaf]
- File:
-
- 1 edited
-
src/AST/Inspect.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Inspect.cpp
r7b71402 rb70abaf 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Inspect.cpp -- Helpers to get information from the AST.7 // Node.hpp -- 8 8 // 9 9 // Author : Thierry Delisle 10 10 // Created On : Fri Jun 24 13:16:31 2022 11 // Last Modified By : Andrew Beach12 // Last Modified On : Mon Jun 27 15:35:00 202213 // Update Count : 111 // Last Modified By : 12 // Last Modified On : 13 // Update Count : 14 14 // 15 15 … … 21 21 22 22 namespace ast { 23 24 bool structHasFlexibleArray( const ast::StructDecl * decl ) { 25 if(decl->members.size() == 0) return false; 26 const auto & last = *decl->members.rbegin(); 27 auto lastd = last.as<ast::DeclWithType>(); 28 // I don't know what this is possible, but it might be. 29 if(!lastd) return false; 30 auto atype = dynamic_cast<const ast::ArrayType *>(lastd->get_type()); 31 if(!atype) return false; 32 return !atype->isVarLen && !atype->dimension; 33 } 34 35 } // namespace ast 23 bool structHasFlexibleArray( const ast::StructDecl * decl ) { 24 if(decl->members.size() == 0) return false; 25 const auto & last = *decl->members.rbegin(); 26 auto lastd = last.as<ast::DeclWithType>(); 27 if(!lastd) return false; // I don't know what this is possible, but it might be. 28 auto atype = dynamic_cast<const ast::ArrayType *>(lastd->get_type()); 29 if(!atype) return false; 30 return !atype->isVarLen && !atype->dimension; 31 } 32 };
Note:
See TracChangeset
for help on using the changeset viewer.