- Timestamp:
- May 21, 2021, 4:48:10 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
- Children:
- f1bce515
- Parents:
- 5407cdc (diff), 7404cdc (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
- 8 edited
-
CodeGen/LinkOnce.cc (added)
-
CodeGen/LinkOnce.h (added)
-
CodeGen/module.mk (modified) (1 diff)
-
Concurrency/Keywords.cc (modified) (2 diffs)
-
GenPoly/Box.cc (modified) (1 diff)
-
InitTweak/InitTweak.cc (modified) (1 diff)
-
Parser/DeclarationNode.cc (modified) (1 diff)
-
Virtual/ExpandCasts.cc (modified) (2 diffs)
-
Virtual/Tables.cc (modified) (2 diffs)
-
main.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/module.mk
r5407cdc r8d66610 25 25 CodeGen/GenType.cc \ 26 26 CodeGen/GenType.h \ 27 CodeGen/LinkOnce.cc \ 28 CodeGen/LinkOnce.h \ 27 29 CodeGen/OperatorTable.cc \ 28 30 CodeGen/OperatorTable.h \ -
src/Concurrency/Keywords.cc
r5407cdc r8d66610 432 432 new ObjectDecl( 433 433 Virtual::concurrentDefaultVTableName(), 434 Type::Const,434 noStorageClasses, 435 435 LinkageSpec::Cforall, 436 436 /* bitfieldWidth */ nullptr, … … 504 504 new ObjectDecl( 505 505 Virtual::concurrentDefaultVTableName(), 506 Type:: Const,506 Type::StorageClasses( Type::Extern ), 507 507 LinkageSpec::Cforall, 508 508 /* bitfieldWidth */ nullptr, -
src/GenPoly/Box.cc
r5407cdc r8d66610 1525 1525 stmtsToAddBefore.push_back( new DeclStmt( newBuf ) ); 1526 1526 1527 // if the object has a cleanup attribute, the cleanup should be on the buffer, not the pointer 1528 auto matchAndMove = [newBuf](Attribute * attr){ 1529 if(attr->name == "cleanup") { 1530 newBuf->attributes.push_back(attr); 1531 return true; 1532 } 1533 return false; 1534 }; 1535 1536 objectDecl->attributes.remove_if(matchAndMove); 1537 1527 1538 delete objectDecl->get_init(); 1528 1539 objectDecl->set_init( new SingleInit( new VariableExpr( newBuf ) ) ); -
src/InitTweak/InitTweak.cc
r5407cdc r8d66610 1216 1216 1217 1217 void addDataSectonAttribute( ObjectDecl * objDecl ) { 1218 Type *strLitT = new PointerType( Type::Qualifiers( ), 1219 new BasicType( Type::Qualifiers( ), BasicType::Char ) ); 1220 std::list< Expression * > attr_params; 1221 attr_params.push_back( 1222 new ConstantExpr( Constant( strLitT, "\".data#\"", std::nullopt ) ) ); 1223 objDecl->attributes.push_back(new Attribute("section", attr_params)); 1218 objDecl->attributes.push_back(new Attribute("section", { 1219 new ConstantExpr( Constant::from_string(".data#") ), 1220 })); 1224 1221 } 1225 1222 1226 1223 void addDataSectionAttribute( ast::ObjectDecl * objDecl ) { 1227 auto strLitT = new ast::PointerType(new ast::BasicType(ast::BasicType::Char)); 1228 objDecl->attributes.push_back(new ast::Attribute("section", {new ast::ConstantExpr(objDecl->location, strLitT, "\".data#\"", std::nullopt)})); 1224 objDecl->attributes.push_back(new ast::Attribute("section", { 1225 ast::ConstantExpr::from_string(objDecl->location, ".data#"), 1226 })); 1229 1227 } 1230 1228 -
src/Parser/DeclarationNode.cc
r5407cdc r8d66610 1076 1076 if ( variable.tyClass != TypeDecl::NUMBER_OF_KINDS ) { 1077 1077 // otype is internally converted to dtype + otype parameters 1078 static const TypeDecl::Kind kindMap[] = { TypeDecl::Dtype, TypeDecl::DStype, TypeDecl::Dtype, TypeDecl::Ftype, TypeDecl::Ttype, TypeDecl:: ALtype };1078 static const TypeDecl::Kind kindMap[] = { TypeDecl::Dtype, TypeDecl::DStype, TypeDecl::Dtype, TypeDecl::Ftype, TypeDecl::Ttype, TypeDecl::Dtype }; 1079 1079 static_assert( sizeof(kindMap) / sizeof(kindMap[0]) == TypeDecl::NUMBER_OF_KINDS, "DeclarationNode::build: kindMap is out of sync." ); 1080 1080 assertf( variable.tyClass < sizeof(kindMap)/sizeof(kindMap[0]), "Variable's tyClass is out of bounds." ); 1081 TypeDecl * ret = new TypeDecl( *name, Type::StorageClasses(), nullptr, kindMap[ variable.tyClass ], variable.tyClass == TypeDecl::Otype , variable.initializer ? variable.initializer->buildType() : nullptr );1081 TypeDecl * ret = new TypeDecl( *name, Type::StorageClasses(), nullptr, kindMap[ variable.tyClass ], variable.tyClass == TypeDecl::Otype || variable.tyClass == TypeDecl::ALtype, variable.initializer ? variable.initializer->buildType() : nullptr ); 1082 1082 buildList( variable.assertions, ret->get_assertions() ); 1083 1083 return ret; -
src/Virtual/ExpandCasts.cc
r5407cdc r8d66610 105 105 void VirtualCastCore::premutate( FunctionDecl * functionDecl ) { 106 106 if ( (! vcast_decl) && 107 functionDecl->get_name() == "__cfa __virtual_cast" ) {107 functionDecl->get_name() == "__cfavir_virtual_cast" ) { 108 108 vcast_decl = functionDecl; 109 109 } … … 113 113 if ( pvt_decl || ! structDecl->has_body() ) { 114 114 return; 115 } else if ( structDecl->get_name() == "__cfa __parent_vtable" ) {115 } else if ( structDecl->get_name() == "__cfavir_type_info" ) { 116 116 pvt_decl = structDecl; 117 117 } -
src/Virtual/Tables.cc
r5407cdc r8d66610 172 172 } 173 173 174 Attribute * linkonce( const std::string & subsection ) {175 const std::string section = ".gnu.linkonce." + subsection;176 return new Attribute( "section", {177 new ConstantExpr( Constant::from_string( section ) ),178 } );179 }180 181 174 ObjectDecl * makeTypeIdInstance( StructInstType const * typeIdType ) { 182 175 assert( typeIdType ); … … 193 186 new AddressExpr( new NameExpr( "__cfatid_exception_t" ) ) 194 187 ) } ), 195 { linkonce( typeid_name) },188 { new Attribute( "cfa_linkonce", {} ) }, 196 189 noFuncSpecifiers 197 190 ); -
src/main.cc
r5407cdc r8d66610 37 37 #include "CodeGen/FixNames.h" // for fixNames 38 38 #include "CodeGen/Generate.h" // for generate 39 #include "CodeGen/LinkOnce.h" // for translateLinkOnce 39 40 #include "CodeTools/DeclStats.h" // for printDeclStats 40 41 #include "CodeTools/ResolvProtoDump.h" // for dumpAsResolvProto … … 405 406 PASS( "Box", GenPoly::box( translationUnit ) ); 406 407 408 PASS( "Link-Once", CodeGen::translateLinkOnce( translationUnit ) ); 409 410 // Code has been lowered to C, now we can start generation. 411 407 412 if ( bcodegenp ) { 408 413 dump( translationUnit );
Note:
See TracChangeset
for help on using the changeset viewer.