Changeset 933f32f for src/SynTree/Declaration.h
- Timestamp:
- May 24, 2019, 10:19:41 AM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- d908563
- Parents:
- 6a9d4b4 (diff), 292642a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.h
r6a9d4b4 r933f32f 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 : Sun Sep 3 19:24:06 201713 // Update Count : 13 111 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr May 2 10:47:00 2019 13 // Update Count : 135 14 14 // 15 15 … … 19 19 #include <iosfwd> // for ostream 20 20 #include <list> // for list 21 #include <unordered_map> // for unordered_map 21 22 #include <string> // for string, operator+, allocator, to_string 22 23 … … 70 71 static Declaration *declFromId( UniqueId id ); 71 72 72 private: 73 UniqueId uniqueId; 73 74 Type::StorageClasses storageClasses; 74 UniqueId uniqueId; 75 private: 75 76 }; 76 77 … … 166 167 CompoundStmt *get_statements() const { return statements; } 167 168 void set_statements( CompoundStmt *newValue ) { statements = newValue; } 169 bool has_body() const { return NULL != statements; } 168 170 169 171 static FunctionDecl * newFunction( const std::string & name, FunctionType * type, CompoundStmt * statements ); … … 211 213 TypeDecl::Kind kind; 212 214 bool isComplete; 215 213 216 Data() : kind( (TypeDecl::Kind)-1 ), isComplete( false ) {} 214 217 Data( TypeDecl * typeDecl ) : Data( typeDecl->get_kind(), typeDecl->isComplete() ) {} 215 218 Data( Kind kind, bool isComplete ) : kind( kind ), isComplete( isComplete ) {} 219 Data( const Data& d1, const Data& d2 ) 220 : kind( d1.kind ), isComplete ( d1.isComplete || d2.isComplete ) {} 221 216 222 bool operator==(const Data & other) const { return kind == other.kind && isComplete == other.isComplete; } 217 223 bool operator!=(const Data & other) const { return !(*this == other);} … … 239 245 virtual void print( std::ostream &os, Indenter indent = {} ) const override; 240 246 241 private:242 247 Kind kind; 243 248 }; … … 300 305 virtual void accept( Visitor &v ) override { v.visit( this ); } 301 306 virtual Declaration *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 302 private:303 307 DeclarationNode::Aggregate kind; 308 private: 304 309 virtual std::string typeString() const override; 305 310 }; … … 330 335 virtual Declaration *acceptMutator( Mutator &m ) override { return m.mutate( this ); } 331 336 private: 332 std:: map< std::string, long long int > enumValues;337 std::unordered_map< std::string, long long int > enumValues; 333 338 virtual std::string typeString() const override; 334 339 };
Note:
See TracChangeset
for help on using the changeset viewer.