deploy-20250820-3 #1

Merged
gh0s7 merged 352 commits from deploy-20250820-3 into master 2025-08-20 21:20:33 +08:00
Showing only changes of commit 18dc8dbfee - Show all commits

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 的方法,无需再关心类型推断的细节