Changeset 0dd3a2f for translator/SymTab/TypeTable.h
- Timestamp:
- May 18, 2015, 11:20:23 AM (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, string, with_gc
- Children:
- 51587aa
- Parents:
- a32b204
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/SymTab/TypeTable.h
ra32b204 r0dd3a2f 1 #ifndef SYMTAB_TYPETABLE_H 2 #define SYMTAB_TYPETABLE_H 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo 3 // 4 // The contents of this file are covered under the licence agreement in the 5 // file "LICENCE" distributed with Cforall. 6 // 7 // TypeTable.h -- 8 // 9 // Author : Richard C. Bilson 10 // Created On : Sun May 17 21:48:32 2015 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun May 17 21:49:49 2015 13 // Update Count : 2 14 // 15 16 #ifndef TYPETABLE_H 17 #define TYPETABLE_H 3 18 4 19 #include <cassert> … … 14 29 class TypeTableConflictFunction : public std::binary_function< NamedTypeDecl *, NamedTypeDecl *, NamedTypeDecl * > { 15 30 public: 16 NamedTypeDecl *operator()( NamedTypeDecl *existing, NamedTypeDecl *added ) {17 18 return added;19 20 return existing;21 22 throw SemanticError( "redeclaration of ", added );23 }24 25 26 }31 NamedTypeDecl *operator()( NamedTypeDecl *existing, NamedTypeDecl *added ) { 32 if ( existing->get_base() == 0 ) { 33 return added; 34 } else if ( added->get_base() == 0 ) { 35 return existing; 36 } else { 37 throw SemanticError( "redeclaration of ", added ); 38 } // if 39 assert( false ); 40 return 0; 41 } 27 42 }; 28 43 29 44 typedef StackTable< NamedTypeDecl, TypeTableConflictFunction > TypeTable; 30 } // SymTab45 } // namespace SymTab 31 46 32 #endif // SYMTAB_TYPETABLE_H 47 #endif // TYPETABLE_H 48 49 // Local Variables: // 50 // tab-width: 4 // 51 // mode: c++ // 52 // compile-command: "make install" // 53 // End: //
Note: See TracChangeset
for help on using the changeset viewer.