Changeset d3d54b3 for src/AST/Util.cpp
- Timestamp:
- Feb 5, 2025, 1:45:29 PM (2 months ago)
- Branches:
- master
- Children:
- ab94c37
- Parents:
- 92aeae1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/AST/Util.cpp ¶
r92aeae1 rd3d54b3 22 22 #include "Common/Utility.hpp" 23 23 #include "GenPoly/ScopedSet.hpp" 24 #include "Decl.hpp" 25 #include "Type.hpp" 24 26 25 27 #include <vector> … … 382 384 } 383 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 state 399 // as if `size_t` in program text were freshly parsed 400 return zd_abstract; 401 } else if ( transUnit->global.sizeType ) { 402 // late state, normal run 403 // whatever size_t was defined as 404 return transUnit->global.sizeType; 405 } else { 406 // late state, no prelude (-n) 407 // placeholder: cfa-cpp is being used experimentally, stay out of the way 408 return ld_concrete; 409 } 410 } 411 412 384 413 } // namespace ast
Note: See TracChangeset
for help on using the changeset viewer.