Changeset fa4805f
- Timestamp:
- Jun 28, 2017, 4:05:46 PM (6 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:
- a67b60e
- Parents:
- 16c95e3
- Location:
- src
- Files:
-
- 2 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/FixNames.cc
r16c95e3 rfa4805f 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Wed Jun 2 1 14:22:59201713 // Update Count : 1911 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jun 28 15:26:00 2017 13 // Update Count : 20 14 14 // 15 15 … … 93 93 void FixNames::fixDWT( DeclarationWithType *dwt ) { 94 94 if ( dwt->get_name() != "" ) { 95 if ( LinkageSpec::is Decoratable( dwt->get_linkage() ) ) {95 if ( LinkageSpec::isMangled( dwt->get_linkage() ) ) { 96 96 dwt->set_mangleName( SymTab::Mangler::mangle( dwt ) ); 97 97 dwt->set_scopeLevel( scopeLevel ); -
src/Parser/DeclarationNode.cc
r16c95e3 rfa4805f 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 12:34:05 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Mar 17 15:46:33201713 // Update Count : 101 811 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jun 28 15:27:00 2017 13 // Update Count : 1019 14 14 // 15 15 … … 1063 1063 case TypeData::Enum: 1064 1064 case TypeData::Aggregate: { 1065 ReferenceToType * ret = buildComAggInst( type, attributes );1065 ReferenceToType * ret = buildComAggInst( type, attributes, linkage ); 1066 1066 buildList( type->aggregate.actuals, ret->get_parameters() ); 1067 1067 return ret; -
src/Parser/LinkageSpec.cc
r16c95e3 rfa4805f 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 13:22:09 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sun Oct 2 23:16:21 201613 // Update Count : 2 311 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jun 28 11:51:00 2017 13 // Update Count : 24 14 14 // 15 15 … … 28 28 } else if ( *spec == "\"C\"" ) { 29 29 return C; 30 } else if ( *spec == "\"BuiltinC\"" ) { 31 return BuiltinC; 30 32 } else { 31 33 throw SemanticError( "Invalid linkage specifier " + *spec ); … … 36 38 assert( 0 <= linkage && linkage < LinkageSpec::NoOfSpecs ); 37 39 static const char *linkageKinds[LinkageSpec::NoOfSpecs] = { 38 "intrinsic", "Cforall", "C", "automatically generated", "compiler built-in", 40 "intrinsic", "Cforall", "C", "automatically generated", "compiler built-in", "cfa built-in", "c built-in", 39 41 }; 40 42 return linkageKinds[linkage]; 41 43 } 42 44 43 bool LinkageSpec::is Decoratable( Spec spec ) {45 bool LinkageSpec::isMangled( Spec spec ) { 44 46 assert( 0 <= spec && spec < LinkageSpec::NoOfSpecs ); 45 47 static bool decoratable[LinkageSpec::NoOfSpecs] = { 46 // Intrinsic, Cforall, C, AutoGen, Compiler 48 // Intrinsic, Cforall, C, AutoGen, Compiler, 47 49 true, true, false, true, false, 50 // Builtin, BuiltinC, 51 true, false, 48 52 }; 49 53 return decoratable[spec]; … … 53 57 assert( 0 <= spec && spec < LinkageSpec::NoOfSpecs ); 54 58 static bool generatable[LinkageSpec::NoOfSpecs] = { 55 // Intrinsic, Cforall, C, AutoGen, Compiler 59 // Intrinsic, Cforall, C, AutoGen, Compiler, 56 60 true, true, true, true, false, 61 // Builtin, BuiltinC, 62 true, true, 57 63 }; 58 64 return generatable[spec]; … … 62 68 assert( spec >= 0 && spec < LinkageSpec::NoOfSpecs ); 63 69 static bool overridable[LinkageSpec::NoOfSpecs] = { 64 // Intrinsic, Cforall, C, AutoGen, Compiler 70 // Intrinsic, Cforall, C, AutoGen, Compiler, 65 71 true, false, false, true, false, 72 // Builtin, BuiltinC, 73 false, false, 66 74 }; 67 75 return overridable[spec]; … … 71 79 assert( spec >= 0 && spec < LinkageSpec::NoOfSpecs ); 72 80 static bool builtin[LinkageSpec::NoOfSpecs] = { 73 // Intrinsic, Cforall, C, AutoGen, Compiler 81 // Intrinsic, Cforall, C, AutoGen, Compiler, 74 82 true, false, false, false, true, 83 // Builtin, BuiltinC, 84 true, true, 75 85 }; 76 86 return builtin[spec]; -
src/Parser/LinkageSpec.h
r16c95e3 rfa4805f 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 13:24:28 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sat Oct 1 23:03:17 201613 // Update Count : 1 111 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jun 28 11:50:00 2017 13 // Update Count : 12 14 14 // 15 15 … … 26 26 AutoGen, // built by translator (struct assignment) 27 27 Compiler, // gcc internal 28 Builtin, // mangled builtins 29 BuiltinC, // non-mangled builtins 28 30 NoOfSpecs 29 31 }; … … 32 34 static std::string linkageName( Spec ); 33 35 34 static bool is Decoratable( Spec );36 static bool isMangled( Spec ); 35 37 static bool isGeneratable( Spec ); 36 38 static bool isOverridable( Spec ); -
src/Parser/TypeData.cc
r16c95e3 rfa4805f 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 15:12:51 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Mar 17 15:52:43201713 // Update Count : 56 311 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jun 28 15:28:00 2017 13 // Update Count : 564 14 14 // 15 15 … … 614 614 } // buildPointer 615 615 616 AggregateDecl * buildAggregate( const TypeData * td, std::list< Attribute * > attributes ) {616 AggregateDecl * buildAggregate( const TypeData * td, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) { 617 617 assert( td->kind == TypeData::Aggregate ); 618 618 AggregateDecl * at; … … 622 622 case DeclarationNode::Monitor: 623 623 case DeclarationNode::Thread: 624 at = new StructDecl( *td->aggregate.name, td->aggregate.kind, attributes );624 at = new StructDecl( *td->aggregate.name, td->aggregate.kind, attributes, linkage ); 625 625 buildForall( td->aggregate.params, at->get_parameters() ); 626 626 break; … … 643 643 } // buildAggregate 644 644 645 ReferenceToType * buildComAggInst( const TypeData * type, std::list< Attribute * > attributes ) {645 ReferenceToType * buildComAggInst( const TypeData * type, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) { 646 646 switch ( type->kind ) { 647 647 case TypeData::Enum: { … … 656 656 ReferenceToType * ret; 657 657 if ( type->aggregate.body ) { 658 AggregateDecl * typedecl = buildAggregate( type, attributes );658 AggregateDecl * typedecl = buildAggregate( type, attributes, linkage ); 659 659 switch ( type->aggregate.kind ) { 660 660 case DeclarationNode::Struct: … … 802 802 return decl->set_asmName( asmName ); 803 803 } else if ( td->kind == TypeData::Aggregate ) { 804 return buildAggregate( td, attributes );804 return buildAggregate( td, attributes, linkage ); 805 805 } else if ( td->kind == TypeData::Enum ) { 806 806 return buildEnum( td, attributes ); -
src/Parser/TypeData.h
r16c95e3 rfa4805f 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 15:18:36 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Thu Mar 16 08:32:39201713 // Update Count : 18 511 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jun 28 15:29:00 2017 13 // Update Count : 186 14 14 // 15 15 … … 102 102 ArrayType * buildArray( const TypeData * ); 103 103 AggregateDecl * buildAggregate( const TypeData *, std::list< Attribute * > ); 104 ReferenceToType * buildComAggInst( const TypeData *, std::list< Attribute * > attributes );104 ReferenceToType * buildComAggInst( const TypeData *, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ); 105 105 ReferenceToType * buildAggInst( const TypeData * ); 106 106 TypeDecl * buildVariable( const TypeData * ); -
src/SymTab/Autogen.cc
r16c95e3 rfa4805f 9 9 // Author : Rob Schluntz 10 10 // Created On : Thu Mar 03 15:45:56 2016 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Mar 17 09:41:08201713 // Update Count : 6 011 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jun 28 15:30:00 2017 13 // Update Count : 61 14 14 // 15 15 … … 400 400 /// generates struct constructors, destructor, and assignment functions 401 401 void makeStructFunctions( StructDecl *aggregateDecl, StructInstType *refType, unsigned int functionNesting, std::list< Declaration * > & declsToAdd, const std::vector< FuncData > & data ) { 402 // Builtins do not use autogeneration. 403 if ( aggregateDecl->get_linkage() == LinkageSpec::Builtin || 404 aggregateDecl->get_linkage() == LinkageSpec::BuiltinC ) { 405 return; 406 } 407 402 408 // Make function polymorphic in same parameters as generic struct, if applicable 403 409 const std::list< TypeDecl* > & typeParams = aggregateDecl->get_parameters(); // List of type variables to be placed on the generated functions -
src/SymTab/Mangler.cc
r16c95e3 rfa4805f 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 21:40:29 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Mar 17 09:40:01201713 // Update Count : 2 011 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jun 28 15:31:00 2017 13 // Update Count : 21 14 14 // 15 15 … … 72 72 } else { 73 73 // if we add another kind of overridable function, this has to change 74 assert( false );74 assert( false && "unknown overrideable linkage" ); 75 75 } // if 76 76 } -
src/SynTree/AggregateDecl.cc
r16c95e3 rfa4805f 9 9 // Author : Richard C. Bilson 10 10 // Created On : Sun May 17 23:56:39 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : T hu Mar 16 07:49:07201713 // Update Count : 2 011 // Last Modified By : Andrew Beach 12 // Last Modified On : Tus Jun 27 15:30:00 2017 13 // Update Count : 21 14 14 // 15 15 … … 20 20 21 21 22 AggregateDecl::AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes ) : Parent( name, Type::StorageClasses(), LinkageSpec::Cforall), body( false ), attributes( attributes ) {22 AggregateDecl::AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes, LinkageSpec::Spec linkage ) : Parent( name, Type::StorageClasses(), linkage ), body( false ), attributes( attributes ) { 23 23 } 24 24 -
src/SynTree/Declaration.h
r16c95e3 rfa4805f 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Fri Mar 17 16:05:08201713 // Update Count : 12 111 // Last Modified By : Andrew Beach 12 // Last Modified On : Tus Jun 27 15:31:00 2017 13 // Update Count : 122 14 14 // 15 15 … … 238 238 typedef Declaration Parent; 239 239 public: 240 AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >() );240 AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ); 241 241 AggregateDecl( const AggregateDecl &other ); 242 242 virtual ~AggregateDecl(); … … 266 266 typedef AggregateDecl Parent; 267 267 public: 268 StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >() ) : Parent( name, attributes), kind( kind ) {}268 StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( kind ) {} 269 269 StructDecl( const StructDecl &other ) : Parent( other ) {} 270 270 … … 284 284 typedef AggregateDecl Parent; 285 285 public: 286 UnionDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >() ) : Parent( name, attributes) {}286 UnionDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ) {} 287 287 UnionDecl( const UnionDecl &other ) : Parent( other ) {} 288 288 … … 297 297 typedef AggregateDecl Parent; 298 298 public: 299 EnumDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >() ) : Parent( name, attributes) {}299 EnumDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ) {} 300 300 EnumDecl( const EnumDecl &other ) : Parent( other ) {} 301 301 -
src/libcfa/Makefile.am
r16c95e3 rfa4805f 10 10 ## Author : Peter A. Buhr 11 11 ## Created On : Sun May 31 08:54:01 2015 12 ## Last Modified By : Peter A. Buhr13 ## Last Modified On : Sun May 14 21:04:21201714 ## Update Count : 21 412 ## Last Modified By : Andrew Beach 13 ## Last Modified On : Wed Jun 28 15:36:00 2017 14 ## Update Count : 215 15 15 ############################################################################### 16 16 … … 64 64 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $< 65 65 66 libcfa_a-exception.o : exception.c 67 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $< 68 66 69 concurrency/libcfa_d_a-invoke.o : concurrency/invoke.c 70 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $< 71 72 libcfa_d_a-exception.o : exception.c 67 73 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $< 68 74 -
src/libcfa/Makefile.in
r16c95e3 rfa4805f 1428 1428 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $< 1429 1429 1430 libcfa_a-exception.o : exception.c 1431 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -O2 ${EXTRA_FLAGS} -c -o $@ $< 1432 1430 1433 concurrency/libcfa_d_a-invoke.o : concurrency/invoke.c 1434 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $< 1435 1436 libcfa_d_a-exception.o : exception.c 1431 1437 ${AM_V_CC}@BACKEND_CC@ -DHAVE_CONFIG_H -I. -I../.. -D__CFA_DEBUG__ -O0 ${EXTRA_FLAGS} -c -o $@ $< 1432 1438 -
src/main.cc
r16c95e3 rfa4805f 11 11 // Created On : Fri May 15 23:12:02 2015 12 12 // Last Modified By : Andrew Beach 13 // Last Modified On : Wed May 10 14:45:00 201714 // Update Count : 43 713 // Last Modified On : Wed Jun 28 15:34:00 2017 14 // Update Count : 438 15 15 // 16 16 … … 186 186 if ( ! nopreludep ) { // include gcc builtins 187 187 // -l is for initial build ONLY and builtins.cf is not in the lib directory so access it here. 188 // Read to cfa builtins, if not generating the cfa library189 FILE * builtins = fopen( libcfap | treep ? "../prelude/builtins.cf" : CFA_LIBDIR "/builtins.cf", "r" );190 assertf( builtins, "cannot open builtins.cf\n" );191 parse( builtins, LinkageSpec::Compiler );192 188 193 189 // Read to gcc builtins, if not generating the cfa library … … 206 202 assertf( prelude, "cannot open prelude.cf\n" ); 207 203 parse( prelude, LinkageSpec::Intrinsic ); 204 205 // Read to cfa builtins, if not generating the cfa library 206 FILE * builtins = fopen( libcfap | treep ? "../prelude/builtins.cf" : CFA_LIBDIR "/builtins.cf", "r" ); 207 assertf( builtins, "cannot open builtins.cf\n" ); 208 parse( builtins, LinkageSpec::Builtin ); 208 209 } // if 209 210 } // if -
src/prelude/builtins.c
r16c95e3 rfa4805f 1 1 typedef unsigned long long __cfaabi_exception_type_t; 2 3 #include "../libcfa/exception.h"
Note: See TracChangeset
for help on using the changeset viewer.