mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-13 14:36:18 +03:00
Refactoring: Replace Expression::op check followed by static cast to Expression::is<ExpressionType> (#3141)
This may negatively impact performance, as the (final, i.e., non-virtual) Expression::is... family is implemented in D and not available inline in the C++ headers.
This commit is contained in:
parent
ec1c37a5a4
commit
26673c174f
10 changed files with 112 additions and 132 deletions
|
@ -56,14 +56,14 @@ RVals evalSides(DValue *lhs, Expression *rhs, bool loadLhsAfterRhs) {
|
|||
Expression *extractNoStrideInc(Expression *e, d_uns64 baseSize, bool &negate) {
|
||||
MulExp *mul;
|
||||
while (true) {
|
||||
if (e->op == TOKneg) {
|
||||
if (auto ne = e->isNegExp()) {
|
||||
negate = !negate;
|
||||
e = static_cast<NegExp *>(e)->e1;
|
||||
e = ne->e1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (e->op == TOKmul) {
|
||||
mul = static_cast<MulExp *>(e);
|
||||
if (auto me = e->isMulExp()) {
|
||||
mul = me;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue