diff --git a/dmd2/expression.h b/dmd2/expression.h index 7c9e369e..6e8ea740 100644 --- a/dmd2/expression.h +++ b/dmd2/expression.h @@ -1124,6 +1124,9 @@ struct CallExp : UnaExp #if IN_LLVM DValue* toElem(IRState* irs); +#if DMDV2 + void cacheLvalue(IRState* p); +#endif #endif }; diff --git a/gen/toir.cpp b/gen/toir.cpp index bfb55b83..b6e4f776 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -771,6 +771,20 @@ DValue* ModExp::toElem(IRState* p) ////////////////////////////////////////////////////////////////////////////////////////// +#if DMDV2 + +void CallExp::cacheLvalue(IRState* p) +{ + + Logger::println("Caching l-value of %s", toChars()); + LOG_SCOPE; + cachedLvalue = toElem(p)->getLVal(); +} + +#endif + +////////////////////////////////////////////////////////////////////////////////////////// + DValue* CallExp::toElem(IRState* p) { Logger::print("CallExp::toElem: %s @ %s\n", toChars(), type->toChars());