[midend]同上,删除了打印函数对维度信息的错误访问

This commit is contained in:
rain2133
2025-07-31 19:57:19 +08:00
parent 35b421b60b
commit aed4577490
3 changed files with 3 additions and 44 deletions

View File

@@ -1148,7 +1148,6 @@ public:
Type* getAllocatedType() const {
return getType()->as<PointerType>()->getBaseType();
} ///< 获取分配的类型
int getNumDims() const { return getNumOperands(); }
}; // class AllocaInst
@@ -1203,12 +1202,7 @@ protected:
}
public:
int getNumIndices() const { return getNumOperands() - 1; }
Value* getPointer() const { return getOperand(0); }
auto getIndices() const {
return make_range(std::next(operand_begin()), operand_end());
}
Value* getIndex(int index) const { return getOperand(index + 1); }
}; // class LoadInst
@@ -1474,9 +1468,6 @@ class ConstantVariable : public Value {
return getByIndex(index);
} ///< 通过多维索引indices获取初始值
// unsigned getNumDims() const { return numDims; } ///< 获取维度数量
// Value* getDim(unsigned index) const { return getOperand(index); } ///< 获取位置为index的维度
// auto getDims() const { return getOperands(); } ///< 获取维度列表
const ValueCounter& getInitValues() const { return initValues; } ///< 获取初始值
};