我收到 「無效getelementptr指數」 上的這LLVM-IR代碼的最後一行:無效getelementptr指數
%alc = alloca %mytype*
store %mytype* %obj, %mytype** %alc
%ldc = load %mytype** %alc
%gcs = getelementptr inbounds %mytype* %ldc, i32 0, i32 1
其中MYTYPE定義如下:
%mytype = type {i32, %tp1**, %tp1}
我有另一個類似類型的索引超過它不會導致上述錯誤並且被定義爲:
%mytype2 = type {i32, i16*, %tp1}
任何有助於解決這個問題將不勝感激。
您能否顯示完整的失敗文件,包括'%tp1'的定義? GEP本身對我來說看起來很好。 – Oak
失敗的文件太大,無法附加,但%tp1定義如下:%tp1 = type {i32(...)**,%tp2 *(...)**,i1(... )**,void(...)**,%tp1 *(...)**} – user1723583