- Timestamp:
- Jun 30, 2022, 11:33:20 AM (3 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- 25404c7
- Parents:
- fc2c57a9 (diff), adf03a6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Decl.hpp
rfc2c57a9 r06bdba4 316 316 EnumDecl( const CodeLocation& loc, const std::string& name, 317 317 std::vector<ptr<Attribute>>&& attrs = {}, Linkage::Spec linkage = Linkage::Cforall, Type * base = nullptr, 318 318 std::unordered_map< std::string, long long > enumValues = std::unordered_map< std::string, long long >() ) 319 319 : AggregateDecl( loc, name, std::move(attrs), linkage ), base(base), enumValues(enumValues) {} 320 320 -
src/AST/Inspect.cpp
rfc2c57a9 r06bdba4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Node.hpp --7 // Inspect.cpp -- Helpers to get information from the AST. 8 8 // 9 9 // Author : Thierry Delisle 10 10 // Created On : Fri Jun 24 13:16:31 2022 11 // Last Modified By : 12 // Last Modified On : 13 // Update Count : 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Jun 27 15:35:00 2022 13 // Update Count : 1 14 14 // 15 15 … … 21 21 22 22 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 }; 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 -
src/AST/Inspect.hpp
rfc2c57a9 r06bdba4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Node.hpp --7 // Inspect.hpp -- Helpers to get information from the AST. 8 8 // 9 9 // Author : Thierry Delisle 10 10 // Created On : Fri Jun 24 13:16:31 2022 11 // Last Modified By : 12 // Last Modified On : 13 // Update Count : 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Jun 27 15:35:00 2022 13 // Update Count : 1 14 14 // 15 15 … … 17 17 18 18 namespace ast { 19 bool structHasFlexibleArray( const ast::StructDecl * ); 19 20 // Does the structure end in a flexable array declaration? 21 bool structHasFlexibleArray( const ast::StructDecl * ); 22 20 23 } -
src/SymTab/Validate.cc
rfc2c57a9 r06bdba4 312 312 Stats::Heap::newPass("validate-B"); 313 313 Stats::Time::BlockGuard guard("validate-B"); 314 //linkReferenceToTypes( translationUnit );314 linkReferenceToTypes( translationUnit ); // Must happen before auto-gen, because it uses the sized flag. 315 315 mutateAll( translationUnit, fixQual ); // must happen after LinkReferenceToTypes_old, because aggregate members are accessed 316 316 HoistStruct::hoistStruct( translationUnit ); -
src/Validate/module.mk
rfc2c57a9 r06bdba4 41 41 Validate/LabelAddressFixer.cpp \ 42 42 Validate/LabelAddressFixer.hpp \ 43 Validate/LinkReferenceToTypes.cpp \ 44 Validate/LinkReferenceToTypes.hpp \ 43 45 Validate/NoIdSymbolTable.hpp \ 44 46 Validate/ReturnCheck.cpp \ -
src/main.cc
rfc2c57a9 r06bdba4 85 85 #include "Validate/InitializerLength.hpp" // for setLengthFromInitializer 86 86 #include "Validate/LabelAddressFixer.hpp" // for fixLabelAddresses 87 #include "Validate/LinkReferenceToTypes.hpp" // for linkReferenceToTypes 87 88 #include "Validate/ReturnCheck.hpp" // for checkReturnStatements 88 89 #include "Virtual/ExpandCasts.h" // for expandCasts … … 333 334 PASS( "Validate-A", SymTab::validate_A( translationUnit ) ); 334 335 335 // Must happen before auto-gen, because it uses the sized flag.336 PASS( "Link Reference To Types", SymTab::linkReferenceToTypes( translationUnit ) );337 338 336 CodeTools::fillLocations( translationUnit ); 339 337 … … 348 346 349 347 forceFillCodeLocations( transUnit ); 348 349 // Must happen before auto-gen, because it uses the sized flag. 350 PASS( "Link Reference To Types", Validate::linkReferenceToTypes( transUnit ) ); 350 351 351 352 // Must happen after Link References To Types,
Note:
See TracChangeset
for help on using the changeset viewer.