更新IR,.g4修改
This commit is contained in:
@@ -1575,6 +1575,7 @@ class ConstantVariable : public User, public LVal {
|
||||
Value* getByIndex(unsigned index) const { return initValues.getValue(index); } ///< 通过一维位置index获取值
|
||||
Value* getByIndices(const std::vector<Value *> &indices) const {
|
||||
int index = 0;
|
||||
// 计算偏移量
|
||||
for (size_t i = 0; i < indices.size(); i++) {
|
||||
index = dynamic_cast<ConstantValue *>(getDim(i))->getInt() * index +
|
||||
dynamic_cast<ConstantValue *>(indices[i])->getInt();
|
||||
|
||||
@@ -120,6 +120,7 @@ public:
|
||||
// std::any visitUnaryOp(SysYParser::UnaryOpContext *ctx) override;
|
||||
|
||||
std::any visitUnExp(SysYParser::UnExpContext *ctx) override;
|
||||
|
||||
std::any visitFuncRParams(SysYParser::FuncRParamsContext *ctx) override;
|
||||
std::any visitMulExp(SysYParser::MulExpContext *ctx) override;
|
||||
std::any visitAddExp(SysYParser::AddExpContext *ctx) override;
|
||||
|
||||
Reference in New Issue
Block a user