[midend]修改注释

This commit is contained in:
rain2133
2025-07-24 17:05:56 +08:00
parent 9c56bc1310
commit 18dc8dbfee

View File

@@ -44,10 +44,10 @@ Value* SysYIRGenerator::getGEPAddressInst(Value* basePointer, const std::vector<
// 检查 basePointer 是否为指针类型
assert(basePointer->getType()->isPointer());
// GEP 的第一个索引通常是0用于“穿过”指针本身,访问其指向的对象。
// 例如,对于全局数组 @arr其类型为 [6 x i32]*第一个0索引是必需的。
// GEP 的第一个索引通常是0用于“过”指针本身,访问其指向的对象。
// 例如,对于全局数组 @arr其类型为 [6 x i32]*第一个0索引是必需的步过偏移
std::vector<Value*> actualGEPIndices;
actualGEPIndices.push_back(ConstantInteger::get(0)); // 模拟 ConstantInteger::get(0)
actualGEPIndices.push_back(ConstantInteger::get(0));
actualGEPIndices.insert(actualGEPIndices.end(), indices.begin(), indices.end());
// 直接调用 builder 的方法,无需再关心类型推断的细节