Changeset a7c90d4 for src/CodeGen
- Timestamp:
- Mar 7, 2017, 8:33:43 AM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 64cb860, c3396e0
- Parents:
- 7fe2498
- Location:
- src/CodeGen
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r7fe2498 ra7c90d4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 3 21:18:47201713 // Update Count : 4 6512 // Last Modified On : Sun Mar 5 17:13:33 2017 13 // Update Count : 475 14 14 // 15 15 … … 895 895 896 896 void CodeGenerator::handleStorageClass( DeclarationWithType * decl ) { 897 switch ( decl->get_storageClass() ) { 898 //output << DeclarationNode::storageClassNames[decl->get_storageClass()] << ' '; 899 case DeclarationNode::Extern: 900 output << "extern "; 901 break; 902 case DeclarationNode::Static: 903 output << "static "; 904 break; 905 case DeclarationNode::Auto: 906 // silently drop storage class 907 break; 908 case DeclarationNode::Register: 909 output << "register "; 910 break; 911 case DeclarationNode::Threadlocal: 912 output << "_Thread_local "; 913 break; 914 case DeclarationNode::NoStorageClass: 915 break; 916 default: 917 assert( false ); 918 } // switch 897 if ( decl->get_storageClasses().any() ) { 898 DeclarationNode::print_StorageClass( output, decl->get_storageClasses() ); 899 } // if 919 900 } // CodeGenerator::handleStorageClass 920 901 -
src/CodeGen/FixNames.cc
r7fe2498 ra7c90d4 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 3 21:52:17201713 // Update Count : 612 // Last Modified On : Mon Mar 6 23:32:08 2017 13 // Update Count : 15 14 14 // 15 15 … … 39 39 std::string mangle_main() { 40 40 FunctionType* main_type; 41 std::unique_ptr<FunctionDecl> mainDecl { new FunctionDecl( 42 "main", 43 DeclarationNode::NoStorageClass, 44 LinkageSpec::Cforall, 45 main_type = new FunctionType( Type::Qualifiers(), true ), 46 nullptr 47 ) }; 41 std::unique_ptr<FunctionDecl> mainDecl { new FunctionDecl( "main", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 42 main_type = new FunctionType( Type::Qualifiers(), true ), nullptr ) 43 }; 48 44 main_type->get_returnVals().push_back( 49 new ObjectDecl( "", DeclarationNode:: NoStorageClass, LinkageSpec::Cforall, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr )45 new ObjectDecl( "", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr ) 50 46 ); 51 47 … … 56 52 std::string mangle_main_args() { 57 53 FunctionType* main_type; 58 std::unique_ptr<FunctionDecl> mainDecl { new FunctionDecl( 59 "main", 60 DeclarationNode::NoStorageClass, 61 LinkageSpec::Cforall, 62 main_type = new FunctionType( Type::Qualifiers(), false ), 63 nullptr 64 ) }; 54 std::unique_ptr<FunctionDecl> mainDecl { new FunctionDecl( "main", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 55 main_type = new FunctionType( Type::Qualifiers(), false ), nullptr ) 56 }; 65 57 main_type->get_returnVals().push_back( 66 new ObjectDecl( "", DeclarationNode:: NoStorageClass, LinkageSpec::Cforall, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr )58 new ObjectDecl( "", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr ) 67 59 ); 68 60 69 61 mainDecl->get_functionType()->get_parameters().push_back( 70 new ObjectDecl( "", DeclarationNode:: NoStorageClass, LinkageSpec::Cforall, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr )62 new ObjectDecl( "", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, new BasicType( Type::Qualifiers(), BasicType::SignedInt ), nullptr ) 71 63 ); 72 64 73 65 mainDecl->get_functionType()->get_parameters().push_back( 74 new ObjectDecl( "", DeclarationNode:: NoStorageClass, LinkageSpec::Cforall, 0,66 new ObjectDecl( "", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, 75 67 new PointerType( Type::Qualifiers(), new PointerType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::Char ) ) ), 76 68 nullptr )
Note:
See TracChangeset
for help on using the changeset viewer.