Changeset 509ec82 for src/ResolvExpr/ResolveTypeof.cpp
- Timestamp:
- Dec 1, 2024, 9:04:12 PM (10 months ago)
- Branches:
- master
- Children:
- eae8b37
- Parents:
- 3e2e9b2 (diff), 1c0a3a4 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/ResolveTypeof.cpp
r3e2e9b2 r509ec82 88 88 FixArrayDimension(const ResolveContext & context) : context( context ) {} 89 89 90 const ast::ArrayType * previsit (const ast::ArrayType * arrayType) { 91 if (!arrayType->dimension) return arrayType; 92 auto mutType = mutate(arrayType); 90 template< typename PtrType > 91 const PtrType * previsitImpl( const PtrType * type ) { 92 // Note: resolving dimension expressions seems to require duplicate logic, 93 // here and Resolver.cpp: handlePtrType 94 95 if (!type->dimension) return type; 96 auto mutType = mutate(type); 93 97 auto globalSizeType = context.global.sizeType; 94 98 ast::ptr<ast::Type> sizetype = globalSizeType ? globalSizeType : new ast::BasicType( ast::BasicKind::LongUnsignedInt ); 95 mutType->dimension = findSingleExpression( arrayType->dimension, sizetype, context );99 mutType->dimension = findSingleExpression(type->dimension, sizetype, context ); 96 100 97 101 if (InitTweak::isConstExpr(mutType->dimension)) { … … 102 106 } 103 107 return mutType; 108 } 109 110 const ast::ArrayType * previsit (const ast::ArrayType * arrayType) { 111 return previsitImpl( arrayType ); 112 } 113 114 const ast::PointerType * previsit (const ast::PointerType * pointerType) { 115 return previsitImpl( pointerType ); 104 116 } 105 117 };
Note:
See TracChangeset
for help on using the changeset viewer.