Changeset 3906301 for src/Common
- Timestamp:
- Aug 29, 2016, 5:58:17 PM (9 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, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- fa463f1
- Parents:
- 486341f
- git-author:
- Rob Schluntz <rschlunt@…> (08/25/16 11:09:18)
- git-committer:
- Rob Schluntz <rschlunt@…> (08/29/16 17:58:17)
- Location:
- src/Common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/Common/SemanticError.cc ¶
r486341f r3906301 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // SemanticError.cc -- 7 // SemanticError.cc -- 8 8 // 9 9 // Author : Richard C. Bilson … … 26 26 27 27 SemanticError::SemanticError( std::string error ) { 28 errors.push_back( std::string( "Error: " ) +error );28 append( error ); 29 29 } 30 30 31 31 void SemanticError::append( SemanticError &other ) { 32 errors.splice( errors.end(), other.errors ); 32 errors.splice( errors.end(), other.errors ); 33 } 34 35 void SemanticError::append( const std::string & msg ) { 36 errors.push_back( std::string( "Error: ") + msg ); 33 37 } 34 38 -
TabularUnified src/Common/SemanticError.h ¶
r486341f r3906301 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // SemanticError.h -- 7 // SemanticError.h -- 8 8 // 9 9 // Author : Richard C. Bilson … … 31 31 32 32 void append( SemanticError &other ); 33 void append( const std::string & ); 33 34 bool isEmpty() const; 34 35 void print( std::ostream &os ); … … 42 43 template< typename T > 43 44 SemanticError::SemanticError( const std::string &error, const T *obj ) { 44 std::ostringstream os; 45 os << "Error: " << error; 46 obj->print( os ); 47 errors.push_back( os.str() ); 45 append( toString( error, obj ) ); 48 46 } 47 49 48 50 49 #endif // SEMANTICERROR_H
Note: See TracChangeset
for help on using the changeset viewer.