Changeset e5d9274 for src/AST/Expr.cpp
- Timestamp:
- Jun 2, 2022, 3:11:21 PM (22 months ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- ced5e2a
- Parents:
- 015925a (diff), fc134a48 (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
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Expr.cpp
r015925a re5d9274 10 10 // Created On : Wed May 15 17:00:00 2019 11 11 // Last Modified By : Andrew Beach 12 // Created On : Tue Nov 30 14:23:00 202113 // Update Count : 712 // Created On : Wed May 18 13:56:00 2022 13 // Update Count : 8 14 14 // 15 15 … … 21 21 22 22 #include "Copy.hpp" // for shallowCopy 23 #include "Eval.hpp" // for call24 23 #include "GenericSubstitution.hpp" 25 24 #include "LinkageSpec.hpp" … … 67 66 // --- UntypedExpr 68 67 68 bool UntypedExpr::get_lvalue() const { 69 std::string fname = InitTweak::getFunctionName( this ); 70 return lvalueFunctionNames.count( fname ); 71 } 72 69 73 UntypedExpr * UntypedExpr::createDeref( const CodeLocation & loc, const Expr * arg ) { 70 74 assert( arg ); 71 75 72 UntypedExpr * ret = c all( loc, "*?", arg);76 UntypedExpr * ret = createCall( loc, "*?", { arg } ); 73 77 if ( const Type * ty = arg->result ) { 74 78 const Type * base = InitTweak::getPointerBase( ty ); … … 87 91 } 88 92 89 bool UntypedExpr::get_lvalue() const {90 std::string fname = InitTweak::getFunctionName( this );91 return lvalueFunctionNames.count( fname );92 }93 94 93 UntypedExpr * UntypedExpr::createAssign( const CodeLocation & loc, const Expr * lhs, const Expr * rhs ) { 95 94 assert( lhs && rhs ); 96 95 97 UntypedExpr * ret = c all( loc, "?=?", lhs, rhs);96 UntypedExpr * ret = createCall( loc, "?=?", { lhs, rhs } ); 98 97 if ( lhs->result && rhs->result ) { 99 98 // if both expressions are typed, assumes that this assignment is a C bitwise assignment, … … 102 101 } 103 102 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 ) ); 104 109 } 105 110
Note: See TracChangeset
for help on using the changeset viewer.