Changeset 8135d4c for src/ControlStruct/ExceptTranslate.cc
- Timestamp:
- Aug 22, 2017, 7:31:52 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, 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:
- 9aaac6e9
- Parents:
- fc56cdbf (diff), b3d413b (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
-
src/ControlStruct/ExceptTranslate.cc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ControlStruct/ExceptTranslate.cc
rfc56cdbf r8135d4c 10 10 // Created On : Wed Jun 14 16:49:00 2017 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : T us Aug 8 16:54:00 201713 // Update Count : 712 // Last Modified On : Thr Aug 17 17:19:00 2017 13 // Update Count : 9 14 14 // 15 15 16 16 #include "ExceptTranslate.h" 17 #include "Common/PassVisitor.h" 18 #include "SynTree/Statement.h" 19 #include "SynTree/Declaration.h" 20 #include "SynTree/Expression.h" 21 #include "SynTree/Type.h" 22 #include "SynTree/Attribute.h" 23 #include "SynTree/VarExprReplacer.h" 17 18 #include <stddef.h> // for NULL 19 #include <cassert> // for assert, assertf 20 #include <iterator> // for back_inserter, inserter 21 #include <string> // for string, operator== 22 23 #include "Common/PassVisitor.h" // for PassVisitor, WithGuards 24 #include "Common/SemanticError.h" // for SemanticError 25 #include "Common/utility.h" // for CodeLocation 26 #include "Parser/LinkageSpec.h" // for Cforall 27 #include "SynTree/Attribute.h" // for Attribute 28 #include "SynTree/Constant.h" // for Constant 29 #include "SynTree/Declaration.h" // for ObjectDecl, FunctionDecl, Struc... 30 #include "SynTree/Expression.h" // for UntypedExpr, ConstantExpr, Name... 31 #include "SynTree/Initializer.h" // for SingleInit, ListInit 32 #include "SynTree/Label.h" // for Label, noLabels 33 #include "SynTree/Mutator.h" // for mutateAll 34 #include "SynTree/Statement.h" // for CompoundStmt, CatchStmt, ThrowStmt 35 #include "SynTree/Type.h" // for FunctionType, Type, noQualifiers 36 #include "SynTree/VarExprReplacer.h" // for VarExprReplacer, VarExprReplace... 37 #include "SynTree/Visitor.h" // for acceptAll 24 38 25 39 namespace ControlStruct { … … 152 166 /*bitfieldWidth*/ NULL, 153 167 new BasicType( noQualifiers, BasicType::Bool ), 154 /*init*/ NULL 168 /*init*/ NULL, 169 std::list<Attribute *>{ new Attribute( "unused" ) } 155 170 ); 156 171 ObjectDecl voidptr_obj( … … 169 184 ); 170 185 186 ObjectDecl * unused_index_obj = index_obj.clone(); 187 unused_index_obj->attributes.push_back( new Attribute( "unused" ) ); 188 171 189 catch_func_t.get_parameters().push_back( index_obj.clone() ); 172 190 catch_func_t.get_parameters().push_back( exception_obj.clone() ); 173 match_func_t.get_returnVals().push_back( index_obj.clone());191 match_func_t.get_returnVals().push_back( unused_index_obj ); 174 192 match_func_t.get_parameters().push_back( exception_obj.clone() ); 175 193 handle_func_t.get_returnVals().push_back( bool_obj.clone() ); … … 403 421 } 404 422 405 body->push_back( new ReturnStmt( noLabels, new ConstantExpr(406 Constant::from_int( 0 ) ) ) );423 body->push_back( new ReturnStmt( noLabels, 424 new ConstantExpr( Constant::from_int( 0 ) ) ) ); 407 425 408 426 return new FunctionDecl("match", Type::StorageClasses(), … … 435 453 CompoundStmt * body = new CompoundStmt( noLabels ); 436 454 437 FunctionType * func_type = match_func_t.clone();455 FunctionType * func_type = handle_func_t.clone(); 438 456 DeclarationWithType * except_obj = func_type->get_parameters().back(); 439 457 … … 458 476 } 459 477 460 body->push_back( new ReturnStmt( noLabels, new ConstantExpr(461 Constant::from_bool( false ) ) ) );478 body->push_back( new ReturnStmt( noLabels, 479 new ConstantExpr( Constant::from_bool( false ) ) ) ); 462 480 463 481 return new FunctionDecl("handle", Type::StorageClasses(),
Note:
See TracChangeset
for help on using the changeset viewer.