Changeset 17fa94f for src/AST/Util.cpp
- Timestamp:
- Feb 11, 2025, 11:24:07 AM (12 months ago)
- Branches:
- master
- Children:
- 691bf0a
- Parents:
- 3e5e32cf
- File:
-
- 1 edited
-
src/AST/Util.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Util.cpp
r3e5e32cf r17fa94f 384 384 } 385 385 386 namespace {387 const TranslationUnit * transUnit = 0;388 }389 390 void TranslationDeps::evolve( TranslationUnit & u ) {391 transUnit = &u;392 }393 394 const ast::Type * TranslationDeps::getSizeType() {395 static const ast::Type * zd_abstract = new TypeInstType{ "size_t", TypeDecl::Kind::Dtype };396 static const ast::Type * ld_concrete = new BasicType( BasicKind::LongUnsignedInt );397 if ( ! transUnit ) {398 // early state399 // as if `size_t` in program text were freshly parsed400 return zd_abstract;401 } else if ( transUnit->global.sizeType ) {402 // late state, normal run403 // whatever size_t was defined as404 return transUnit->global.sizeType;405 } else {406 // late state, no prelude (-n)407 // placeholder: cfa-cpp is being used experimentally, stay out of the way408 return ld_concrete;409 }410 }411 412 413 386 } // namespace ast
Note:
See TracChangeset
for help on using the changeset viewer.