Translates polymorphic function to a single instance
This commit is contained in:
4
stmt.cpp
4
stmt.cpp
@@ -503,7 +503,7 @@ Stmt *
|
||||
DeclStmt::ReplacePolyType(const PolyType *from, const Type *to) {
|
||||
for (size_t i = 0; i < vars.size(); i++) {
|
||||
Symbol *s = vars[i].sym;
|
||||
if (Type::EqualIgnoringConst(s->type->GetBaseType(), from)) {
|
||||
if (Type::EqualForReplacement(s->type->GetBaseType(), from)) {
|
||||
s->type = PolyType::ReplaceType(s->type, to);
|
||||
}
|
||||
}
|
||||
@@ -2198,7 +2198,7 @@ ForeachStmt::ReplacePolyType(const PolyType *from, const Type *to) {
|
||||
|
||||
for (size_t i=0; i<dimVariables.size(); i++) {
|
||||
const Type *t = dimVariables[i]->type;
|
||||
if (Type::EqualIgnoringConst(t->GetBaseType(), from)) {
|
||||
if (Type::EqualForReplacement(t->GetBaseType(), from)) {
|
||||
t = PolyType::ReplaceType(t, to);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user