Changeset 9aaac6e9 for src/GenPoly
- Timestamp:
- Aug 23, 2017, 5:18:22 PM (7 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:
- ec55ed5
- Parents:
- 8135d4c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/Lvalue.cc
r8135d4c r9aaac6e9 70 70 }; 71 71 72 struct FixIntrinsicResult final {72 struct FixIntrinsicResult final : public WithGuards { 73 73 Expression * postmutate( ApplicationExpr * appExpr ); 74 void premutate( FunctionDecl * funcDecl ); 75 bool inIntrinsic = false; 74 76 }; 75 77 … … 162 164 appExpr->set_result( result->stripReferences()->clone() ); 163 165 appExpr->get_result()->set_lvalue( true ); 164 Expression * ret = new CastExpr( appExpr, result ); 165 ret->set_env( appExpr->get_env() ); 166 appExpr->set_env( nullptr ); 167 return ret; 166 if ( ! inIntrinsic ) { 167 // when not in an intrinsic function, add a cast to 168 // don't add cast when in an intrinsic function, since they already have the cast 169 Expression * ret = new CastExpr( appExpr, result ); 170 ret->set_env( appExpr->get_env() ); 171 appExpr->set_env( nullptr ); 172 return ret; 173 } 174 delete result; 168 175 } 169 176 return appExpr; 177 } 178 179 void FixIntrinsicResult::premutate( FunctionDecl * funcDecl ) { 180 GuardValue( inIntrinsic ); 181 inIntrinsic = funcDecl->linkage == LinkageSpec::Intrinsic; 170 182 } 171 183
Note: See TracChangeset
for help on using the changeset viewer.