Changeset 03e5d14 for src/SynTree
- Timestamp:
- May 6, 2016, 3:45:23 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, 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:
- 9e2c1f0, af18713, fac84be
- Parents:
- 37024fd
- Location:
- src/SynTree
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.h
r37024fd r03e5d14 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Fri May 06 1 1:16:45201612 // Last Modified On : Fri May 06 15:39:02 2016 13 13 // Update Count : 33 14 14 // … … 107 107 public: 108 108 // temporary - merge this into general GCC attributes 109 enum Attribute { 110 NoAttribute, Constructor, Destructor, 109 struct Attribute { 110 enum Type { 111 NoAttribute, Constructor, Destructor, 112 } type; 113 enum Priority { 114 // priorities 0-100 are reserved by gcc, so it's okay to use 100 an exceptional case 115 Default = 100, High, 116 } priority; 117 Attribute(Type t = NoAttribute, Priority p = Default) : type(t), priority(p) {}; 111 118 }; 112 119 113 FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, Attribute attribute = NoAttribute);120 FunctionDecl( const std::string &name, DeclarationNode::StorageClass sc, LinkageSpec::Type linkage, FunctionType *type, CompoundStmt *statements, bool isInline, bool isNoreturn, Attribute attribute = Attribute() ); 114 121 FunctionDecl( const FunctionDecl &other ); 115 122 virtual ~FunctionDecl(); -
src/SynTree/FunctionDecl.cc
r37024fd r03e5d14 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Rob Schluntz 12 // Last Modified On : Fri May 06 1 1:35:09201612 // Last Modified On : Fri May 06 15:41:05 2016 13 13 // Update Count : 19 14 14 // … … 65 65 os << "_Noreturn "; 66 66 } // if 67 switch ( attribute ) {68 case Constructor:67 switch ( attribute.type ) { 68 case Attribute::Constructor: 69 69 os << "Global Constructor "; 70 70 break; 71 case Destructor:71 case Attribute::Destructor: 72 72 os << "Global Destructor "; 73 73 break; 74 74 default: 75 75 break; 76 } 77 if ( attribute.priority != Attribute::Default ) { 78 os << "with priority " << attribute.priority << " "; 76 79 } 77 80 if ( get_storageClass() != DeclarationNode::NoStorageClass ) { … … 114 117 os << "_Noreturn "; 115 118 } // if 116 switch ( attribute ) {117 case Constructor:119 switch ( attribute.type ) { 120 case Attribute::Constructor: 118 121 os << " Global Constructor "; 119 122 break; 120 case Destructor:123 case Attribute::Destructor: 121 124 os << " Global Destructor "; 122 125 break; 123 126 default: 124 127 break; 128 } 129 if ( attribute.priority != Attribute::Default ) { 130 os << "with priority " << attribute.priority << " "; 125 131 } 126 132 if ( get_storageClass() != DeclarationNode::NoStorageClass ) {
Note:
See TracChangeset
for help on using the changeset viewer.