- Timestamp:
- May 22, 2019, 1:10:54 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 15934a6
- Parents:
- ed5e798
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Convert.cpp
red5e798 r9a0cd9c 1277 1277 virtual void visit( FunctionDecl * old ) override final { 1278 1278 if ( inCache( old ) ) return; 1279 // TODO 1280 auto decl = (ast::FunctionDecl *)nullptr; 1279 auto decl = new ast::FunctionDecl{ 1280 old->location, 1281 old->name, 1282 GET_ACCEPT_1(type, FunctionType), 1283 GET_ACCEPT_1(statements, CompoundStmt), 1284 { old->storageClasses.val }, 1285 { old->linkage.val }, 1286 GET_ACCEPT_V(attributes, Attribute), 1287 { old->get_funcSpec().val } 1288 }; 1289 decl->scopeLevel = old->scopeLevel; 1290 decl->mangleName = old->mangleName; 1291 decl->isDeleted = old->isDeleted; 1292 decl->uniqueId = old->uniqueId; 1293 decl->extension = old->extension; 1281 1294 cache.emplace( old, decl ); 1295 1296 this->node = decl; 1282 1297 } 1283 1298 … … 1364 1379 1365 1380 virtual void visit( TypeDecl * old ) override final { 1366 if ( inCache( old ) ) return; 1367 // TODO 1368 auto decl = (ast::TypeDecl *)nullptr; 1381 if ( inCache( old ) ) return; 1382 auto decl = new ast::TypeDecl{ 1383 old->location, 1384 old->name, 1385 { old->storageClasses.val }, 1386 GET_ACCEPT_1(base, Type), 1387 (ast::TypeVar::Kind)(unsigned)old->kind, 1388 old->sized, 1389 GET_ACCEPT_1(init, Type) 1390 }; 1391 decl->assertions = GET_ACCEPT_V(assertions, DeclWithType); 1392 decl->params = GET_ACCEPT_V(parameters, TypeDecl); 1393 decl->extension = old->extension; 1394 decl->uniqueId = old->uniqueId; 1369 1395 cache.emplace( old, decl ); 1396 1397 this->node = decl; 1370 1398 } 1371 1399 … … 1387 1415 } 1388 1416 1389 virtual void visit( AsmDecl * ) override final { 1390 1391 } 1392 1393 virtual void visit( StaticAssertDecl * ) override final { 1394 1417 virtual void visit( AsmDecl * old ) override final { 1418 auto decl = new ast::AsmDecl{ 1419 old->location, 1420 GET_ACCEPT_1(stmt, AsmStmt) 1421 }; 1422 decl->extension = old->extension; 1423 decl->uniqueId = old->uniqueId; 1424 decl->storage = { old->storageClasses.val }; 1425 1426 this->node = decl; 1427 } 1428 1429 virtual void visit( StaticAssertDecl * old ) override final { 1430 auto decl = new ast::StaticAssertDecl{ 1431 old->location, 1432 GET_ACCEPT_1(condition, Expr), 1433 GET_ACCEPT_1(message, ConstantExpr) 1434 }; 1435 decl->extension = old->extension; 1436 decl->uniqueId = old->uniqueId; 1437 decl->storage = { old->storageClasses.val }; 1438 1439 this->node = decl; 1395 1440 } 1396 1441
Note: See TracChangeset
for help on using the changeset viewer.