Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Expr.cpp

    re6cf857f rf27331c  
    1010// Created On       : Wed May 15 17:00:00 2019
    1111// Last Modified By : Andrew Beach
    12 // Created On       : Wed May 18 13:56:00 2022
    13 // Update Count     : 8
     12// Created On       : Tue Nov 30 14:23:00 2021
     13// Update Count     : 7
    1414//
    1515
     
    2121
    2222#include "Copy.hpp"                // for shallowCopy
     23#include "Eval.hpp"                // for call
    2324#include "GenericSubstitution.hpp"
    2425#include "LinkageSpec.hpp"
     
    6667// --- UntypedExpr
    6768
    68 bool UntypedExpr::get_lvalue() const {
    69         std::string fname = InitTweak::getFunctionName( this );
    70         return lvalueFunctionNames.count( fname );
    71 }
    72 
    7369UntypedExpr * UntypedExpr::createDeref( const CodeLocation & loc, const Expr * arg ) {
    7470        assert( arg );
    7571
    76         UntypedExpr * ret = createCall( loc, "*?", { arg } );
     72        UntypedExpr * ret = call( loc, "*?", arg );
    7773        if ( const Type * ty = arg->result ) {
    7874                const Type * base = InitTweak::getPointerBase( ty );
     
    9187}
    9288
     89bool UntypedExpr::get_lvalue() const {
     90        std::string fname = InitTweak::getFunctionName( this );
     91        return lvalueFunctionNames.count( fname );
     92}
     93
    9394UntypedExpr * UntypedExpr::createAssign( const CodeLocation & loc, const Expr * lhs, const Expr * rhs ) {
    9495        assert( lhs && rhs );
    9596
    96         UntypedExpr * ret = createCall( loc, "?=?", { lhs, rhs } );
     97        UntypedExpr * ret = call( loc, "?=?", lhs, rhs );
    9798        if ( lhs->result && rhs->result ) {
    9899                // if both expressions are typed, assumes that this assignment is a C bitwise assignment,
     
    101102        }
    102103        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 ) );
    109104}
    110105
Note: See TracChangeset for help on using the changeset viewer.