Ignore:
Timestamp:
Dec 5, 2017, 2:35:03 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
f9feab8
Parents:
9c35431 (diff), 65197c2 (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 cleanup-dtors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Specialize.cc

    r9c35431 rc13e8dc8  
    3535#include "SynTree/Declaration.h"         // for FunctionDecl, DeclarationWit...
    3636#include "SynTree/Expression.h"          // for ApplicationExpr, Expression
    37 #include "SynTree/Label.h"               // for Label, noLabels
     37#include "SynTree/Label.h"               // for Label
    3838#include "SynTree/Mutator.h"             // for mutateAll
    3939#include "SynTree/Statement.h"           // for CompoundStmt, DeclStmt, Expr...
     
    234234                } // if
    235235                // create new thunk with same signature as formal type (C linkage, empty body)
    236                 FunctionDecl *thunkFunc = new FunctionDecl( thunkNamer.newName(), Type::StorageClasses(), LinkageSpec::C, newType, new CompoundStmt( noLabels ) );
     236                FunctionDecl *thunkFunc = new FunctionDecl( thunkNamer.newName(), Type::StorageClasses(), LinkageSpec::C, newType, new CompoundStmt() );
    237237                thunkFunc->fixUniqueId();
    238238
     
    287287                Statement *appStmt;
    288288                if ( funType->returnVals.empty() ) {
    289                         appStmt = new ExprStmt( noLabels, appExpr );
    290                 } else {
    291                         appStmt = new ReturnStmt( noLabels, appExpr );
     289                        appStmt = new ExprStmt( appExpr );
     290                } else {
     291                        appStmt = new ReturnStmt( appExpr );
    292292                } // if
    293293                thunkFunc->statements->kids.push_back( appStmt );
    294294
    295295                // add thunk definition to queue of statements to add
    296                 stmtsToAddBefore.push_back( new DeclStmt( noLabels, thunkFunc ) );
     296                stmtsToAddBefore.push_back( new DeclStmt( thunkFunc ) );
    297297                // return address of thunk function as replacement expression
    298298                return new AddressExpr( new VariableExpr( thunkFunc ) );
Note: See TracChangeset for help on using the changeset viewer.