Changes in src/AST/Expr.cpp [e6cf857f:f27331c]
- File:
-
- 1 edited
-
src/AST/Expr.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Expr.cpp
re6cf857f rf27331c 10 10 // Created On : Wed May 15 17:00:00 2019 11 11 // Last Modified By : Andrew Beach 12 // Created On : Wed May 18 13:56:00 202213 // Update Count : 812 // Created On : Tue Nov 30 14:23:00 2021 13 // Update Count : 7 14 14 // 15 15 … … 21 21 22 22 #include "Copy.hpp" // for shallowCopy 23 #include "Eval.hpp" // for call 23 24 #include "GenericSubstitution.hpp" 24 25 #include "LinkageSpec.hpp" … … 66 67 // --- UntypedExpr 67 68 68 bool UntypedExpr::get_lvalue() const {69 std::string fname = InitTweak::getFunctionName( this );70 return lvalueFunctionNames.count( fname );71 }72 73 69 UntypedExpr * UntypedExpr::createDeref( const CodeLocation & loc, const Expr * arg ) { 74 70 assert( arg ); 75 71 76 UntypedExpr * ret = c reateCall( loc, "*?", { arg });72 UntypedExpr * ret = call( loc, "*?", arg ); 77 73 if ( const Type * ty = arg->result ) { 78 74 const Type * base = InitTweak::getPointerBase( ty ); … … 91 87 } 92 88 89 bool UntypedExpr::get_lvalue() const { 90 std::string fname = InitTweak::getFunctionName( this ); 91 return lvalueFunctionNames.count( fname ); 92 } 93 93 94 UntypedExpr * UntypedExpr::createAssign( const CodeLocation & loc, const Expr * lhs, const Expr * rhs ) { 94 95 assert( lhs && rhs ); 95 96 96 UntypedExpr * ret = c reateCall( loc, "?=?", { lhs, rhs });97 UntypedExpr * ret = call( loc, "?=?", lhs, rhs ); 97 98 if ( lhs->result && rhs->result ) { 98 99 // if both expressions are typed, assumes that this assignment is a C bitwise assignment, … … 101 102 } 102 103 return ret; 103 }104 105 UntypedExpr * UntypedExpr::createCall( const CodeLocation & loc,106 const std::string & name, std::vector<ptr<Expr>> && args ) {107 return new UntypedExpr( loc,108 new NameExpr( loc, name ), std::move( args ) );109 104 } 110 105
Note:
See TracChangeset
for help on using the changeset viewer.