Ignore:
Timestamp:
Aug 22, 2017, 7:31:52 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
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.
Message:

Merge branch 'master' into references

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ControlStruct/ExceptTranslate.cc

    rfc56cdbf r8135d4c  
    1010// Created On       : Wed Jun 14 16:49:00 2017
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Tus Aug  8 16:54:00 2017
    13 // Update Count     : 7
     12// Last Modified On : Thr Aug 17 17:19:00 2017
     13// Update Count     : 9
    1414//
    1515
    1616#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
    2438
    2539namespace ControlStruct {
     
    152166                        /*bitfieldWidth*/ NULL,
    153167                        new BasicType( noQualifiers, BasicType::Bool ),
    154                         /*init*/ NULL
     168                        /*init*/ NULL,
     169                        std::list<Attribute *>{ new Attribute( "unused" ) }
    155170                        );
    156171                ObjectDecl voidptr_obj(
     
    169184                        );
    170185
     186                ObjectDecl * unused_index_obj = index_obj.clone();
     187                unused_index_obj->attributes.push_back( new Attribute( "unused" ) );
     188
    171189                catch_func_t.get_parameters().push_back( index_obj.clone() );
    172190                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 );
    174192                match_func_t.get_parameters().push_back( exception_obj.clone() );
    175193                handle_func_t.get_returnVals().push_back( bool_obj.clone() );
     
    403421                }
    404422
    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 ) ) ) );
    407425
    408426                return new FunctionDecl("match", Type::StorageClasses(),
     
    435453                CompoundStmt * body = new CompoundStmt( noLabels );
    436454
    437                 FunctionType * func_type = match_func_t.clone();
     455                FunctionType * func_type = handle_func_t.clone();
    438456                DeclarationWithType * except_obj = func_type->get_parameters().back();
    439457
     
    458476                }
    459477
    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 ) ) ) );
    462480
    463481                return new FunctionDecl("handle", Type::StorageClasses(),
Note: See TracChangeset for help on using the changeset viewer.