Changeset ab57786 for src/Parser/LinkageSpec.cc
- Timestamp:
- Aug 22, 2016, 2:28:47 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 2acf5fc
- Parents:
- 80722d0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/LinkageSpec.cc
r80722d0 rab57786 10 10 // Created On : Sat May 16 13:22:09 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Aug 18 23:47:14201613 // Update Count : 1 212 // Last Modified On : Sun Aug 21 12:32:53 2016 13 // Update Count : 17 14 14 // 15 15 … … 20 20 #include "Common/SemanticError.h" 21 21 22 LinkageSpec::Spec LinkageSpec::fromString( const std::string &s tringSpec ) {23 if ( s tringSpec == "\"Cforall\"" ) {22 LinkageSpec::Spec LinkageSpec::fromString( const std::string &spec ) { 23 if ( spec == "\"Cforall\"" ) { 24 24 return Cforall; 25 } else if ( s tringSpec == "\"C\"" ) {25 } else if ( spec == "\"C\"" ) { 26 26 return C; 27 27 } else { 28 throw SemanticError( "Invalid linkage specifier " + stringSpec ); 29 } 28 throw SemanticError( "Invalid linkage specifier " + spec ); 29 } // if 30 delete &spec; // allocated by lexer 30 31 } 31 32 … … 37 38 } 38 39 39 bool LinkageSpec::isDecoratable( Spec t) {40 bool LinkageSpec::isDecoratable( Spec spec ) { 40 41 static bool decoratable[LinkageSpec::NoOfSpecs] = { 41 42 // Intrinsic, Cforall, C, AutoGen, Compiler 42 43 true, true, false, true, false, 43 44 }; 44 return decoratable[ t];45 return decoratable[spec]; 45 46 } 46 47 47 bool LinkageSpec::isGeneratable( Spec t) {48 bool LinkageSpec::isGeneratable( Spec spec ) { 48 49 static bool generatable[LinkageSpec::NoOfSpecs] = { 49 50 // Intrinsic, Cforall, C, AutoGen, Compiler 50 51 true, true, true, true, false, 51 52 }; 52 return generatable[ t];53 return generatable[spec]; 53 54 } 54 55 55 bool LinkageSpec::isOverloadable( Spec t ) { 56 return isDecoratable( t ); 57 } 58 59 60 bool LinkageSpec::isOverridable( Spec t ) { 56 bool LinkageSpec::isOverridable( Spec spec ) { 61 57 static bool overridable[LinkageSpec::NoOfSpecs] = { 62 58 // Intrinsic, Cforall, C, AutoGen, Compiler 63 59 true, false, false, true, false, 64 60 }; 65 return overridable[ t];61 return overridable[spec]; 66 62 } 67 63 68 bool LinkageSpec::isBuiltin( Spec t) {64 bool LinkageSpec::isBuiltin( Spec spec ) { 69 65 static bool builtin[LinkageSpec::NoOfSpecs] = { 70 66 // Intrinsic, Cforall, C, AutoGen, Compiler 71 67 true, false, false, false, true, 72 68 }; 73 return builtin[ t];69 return builtin[spec]; 74 70 } 75 71
Note: See TracChangeset
for help on using the changeset viewer.