- Timestamp:
- Dec 16, 2019, 5:40:36 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 7006ba5
- Parents:
- 6f9cc13
- Location:
- src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/DeclarationNode.cc
r6f9cc13 rd912bed 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Dec 16 09:32:40201913 // Update Count : 113 212 // Last Modified On : Mon Dec 16 15:32:22 2019 13 // Update Count : 1133 14 14 // 15 15 … … 133 133 134 134 if ( linkage != LinkageSpec::Cforall ) { 135 os << LinkageSpec:: linkageName( linkage ) << " ";135 os << LinkageSpec::name( linkage ) << " "; 136 136 } // if 137 137 -
src/Parser/parser.yy
r6f9cc13 rd912bed 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Dec 16 07:45:59201913 // Update Count : 440 812 // Last Modified On : Mon Dec 16 15:32:58 2019 13 // Update Count : 4409 14 14 // 15 15 … … 2589 2589 { 2590 2590 linkageStack.push( linkage ); // handle nested extern "C"/"Cforall" 2591 linkage = LinkageSpec:: linkageUpdate( yylloc, linkage, $2 );2591 linkage = LinkageSpec::update( yylloc, linkage, $2 ); 2592 2592 } 2593 2593 '{' up external_definition_list_opt down '}' -
src/SynTree/AggregateDecl.cc
r6f9cc13 rd912bed 10 10 // Created On : Sun May 17 23:56:39 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Dec 13 23:10:22201913 // Update Count : 3 012 // Last Modified On : Mon Dec 16 15:07:20 2019 13 // Update Count : 31 14 14 // 15 15 … … 55 55 os << typeString() << " " << name << ":"; 56 56 if ( get_linkage() != LinkageSpec::Cforall ) { 57 os << " " << LinkageSpec:: linkageName( linkage );57 os << " " << LinkageSpec::name( linkage ); 58 58 } // if 59 59 os << " with body " << has_body(); -
src/SynTree/FunctionDecl.cc
r6f9cc13 rd912bed 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Dec 13 23:10:34201913 // Update Count : 7 612 // Last Modified On : Mon Dec 16 15:11:20 2019 13 // Update Count : 77 14 14 // 15 15 … … 73 73 } // if 74 74 if ( linkage != LinkageSpec::Cforall ) { 75 os << LinkageSpec:: linkageName( linkage ) << " ";75 os << LinkageSpec::name( linkage ) << " "; 76 76 } // if 77 77 -
src/SynTree/LinkageSpec.cc
r6f9cc13 rd912bed 9 9 // Author : Rodolfo G. Esteves 10 10 // Created On : Sat May 16 13:22:09 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thr Spt 12 15:59:00 201813 // Update Count : 2 611 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Dec 16 15:02:29 2019 13 // Update Count : 28 14 14 // 15 15 16 #include <memory> 16 #include <cassert> 17 #include <memory> // for unique_ptr 17 18 #include <string> 18 #include <cassert>19 19 using namespace std; 20 20 … … 23 23 24 24 namespace LinkageSpec { 25 Spec update( CodeLocation location, Spec spec, const string * cmd ) { 26 assert( cmd ); 27 unique_ptr<const string> guard( cmd ); // allocated by lexer 28 if ( *cmd == "\"Cforall\"" ) { 29 spec.is_mangled = true; 30 return spec; 31 } else if ( *cmd == "\"C\"" ) { 32 spec.is_mangled = false; 33 return spec; 34 } else { 35 SemanticError( location, "Invalid linkage specifier " + *cmd ); 36 } // if 37 } // update 25 38 26 Spec linkageUpdate( CodeLocation location, Spec old_spec, const string * cmd ) { 27 assert( cmd ); 28 unique_ptr<const string> guard( cmd ); // allocated by lexer 29 if ( *cmd == "\"Cforall\"" ) { 30 old_spec.is_mangled = true; 31 return old_spec; 32 } else if ( *cmd == "\"C\"" ) { 33 old_spec.is_mangled = false; 34 return old_spec; 35 } else { 36 SemanticError( location, "Invalid linkage specifier " + *cmd ); 37 } // if 38 } 39 40 std::string linkageName( Spec linkage ) { 41 switch ( linkage ) { 42 case Intrinsic: 43 return "intrinsic"; 44 case C: 45 return "C"; 46 case Cforall: 47 return "Cforall"; 48 case AutoGen: 49 return "autogenerated cfa"; 50 case Compiler: 51 return "compiler built-in"; 52 case BuiltinCFA: 53 return "cfa built-in"; 54 case BuiltinC: 55 return "c built-in"; 56 default: 57 return "<unnamed linkage spec>"; 58 } 59 } 60 39 string name( Spec spec ) { 40 switch ( spec ) { 41 case Intrinsic: return "intrinsic"; 42 case C: return "C"; 43 case Cforall: return "Cforall"; 44 case AutoGen: return "autogenerated cfa"; 45 case Compiler: return "compiler built-in"; 46 case BuiltinCFA: return "cfa built-in"; 47 case BuiltinC: return "c built-in"; 48 default: return "<unnamed linkage spec>"; 49 } // siwtch 50 } // name 61 51 } // LinkageSpec 62 52 -
src/SynTree/LinkageSpec.h
r6f9cc13 rd912bed 10 10 // Created On : Sat May 16 13:24:28 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jul 10 16:02:34201913 // Update Count : 1812 // Last Modified On : Mon Dec 16 15:03:43 2019 13 // Update Count : 20 14 14 // 15 15 … … 21 21 22 22 namespace LinkageSpec { 23 // All linkage specs are some combination of these flags: 24 enum { Mangle = 1 << 0, Generate = 1 << 1, Overrideable = 1 << 2, Builtin = 1 << 3, GccBuiltin = 1 << 4, NoOfSpecs = 1 << 5, }; 23 // Bitflags for linkage specifiers 24 enum { 25 Mangle = 1 << 0, 26 Generate = 1 << 1, 27 Overrideable = 1 << 2, 28 Builtin = 1 << 3, 29 GccBuiltin = 1 << 4, 30 }; 25 31 32 // Bitflag type for storage classes 26 33 union Spec { 27 34 unsigned int val; … … 42 49 43 50 44 Spec linkageUpdate( CodeLocation location, Spec old_spec, const std::string * cmd ); 45 /* If cmd = "C" returns a Spec that is old_spec with is_mangled = false 46 * If cmd = "Cforall" returns old_spec Spec with is_mangled = true 47 */ 51 Spec update( CodeLocation location, Spec spec, const std::string * cmd ); 52 // If cmd = "C" returns a Spec that is old_spec with is_mangled = false 53 // If cmd = "Cforall" returns old_spec Spec with is_mangled = true 48 54 49 std::string linkageName( Spec );55 std::string name( Spec ); 50 56 51 57 // To Update: LinkageSpec::isXyz( cur_spec ) -> cur_spec.is_xyz -
src/SynTree/NamedTypeDecl.cc
r6f9cc13 rd912bed 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Dec 13 23:44:24201913 // Update Count : 1 612 // Last Modified On : Mon Dec 16 15:11:40 2019 13 // Update Count : 17 14 14 // 15 15 … … 44 44 45 45 if ( linkage != LinkageSpec::Cforall ) { 46 os << LinkageSpec:: linkageName( linkage ) << " ";46 os << LinkageSpec::name( linkage ) << " "; 47 47 } // if 48 48 get_storageClasses().print( os ); -
src/SynTree/ObjectDecl.cc
r6f9cc13 rd912bed 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Dec 13 23:44:50201913 // Update Count : 6 012 // Last Modified On : Mon Dec 16 15:12:03 2019 13 // Update Count : 61 14 14 // 15 15 … … 48 48 49 49 if ( linkage != LinkageSpec::Cforall ) { 50 os << LinkageSpec:: linkageName( linkage ) << " ";50 os << LinkageSpec::name( linkage ) << " "; 51 51 } // if 52 52
Note: See TracChangeset
for help on using the changeset viewer.