mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 16:41:06 +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
|
@ -875,14 +875,13 @@ DSliceValue *DtoCatArrays(Loc &loc, Type *arrayType, Expression *exp1,
|
|||
llvm::SmallVector<llvm::Value *, 3> args;
|
||||
LLFunction *fn = nullptr;
|
||||
|
||||
if (exp1->op == TOKcat) { // handle multiple concat
|
||||
if (auto ce = exp1->isCatExp()) { // handle multiple concat
|
||||
fn = getRuntimeFunction(loc, gIR->module, "_d_arraycatnTX");
|
||||
|
||||
// Create array of slices
|
||||
typedef llvm::SmallVector<llvm::Value *, 16> ArgVector;
|
||||
ArgVector arrs;
|
||||
arrs.push_back(DtoSlicePtr(exp2));
|
||||
CatExp *ce = static_cast<CatExp *>(exp1);
|
||||
do {
|
||||
arrs.push_back(DtoSlicePtr(ce->e2));
|
||||
ce = static_cast<CatExp *>(ce->e1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue