mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Convert GetElementPtrInst to use ArrayRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135904 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -386,22 +386,20 @@ bool SjLjEHPass::insertSjLjEHSupport(Function &F) {
|
||||
// We need to also keep around a reference to the call_site field
|
||||
Idxs[0] = Zero;
|
||||
Idxs[1] = ConstantInt::get(Int32Ty, 1);
|
||||
CallSite = GetElementPtrInst::Create(FunctionContext, Idxs, Idxs+2,
|
||||
"call_site",
|
||||
CallSite = GetElementPtrInst::Create(FunctionContext, Idxs, "call_site",
|
||||
EntryBB->getTerminator());
|
||||
|
||||
// The exception selector comes back in context->data[1]
|
||||
Idxs[1] = ConstantInt::get(Int32Ty, 2);
|
||||
Value *FCData = GetElementPtrInst::Create(FunctionContext, Idxs, Idxs+2,
|
||||
"fc_data",
|
||||
Value *FCData = GetElementPtrInst::Create(FunctionContext, Idxs, "fc_data",
|
||||
EntryBB->getTerminator());
|
||||
Idxs[1] = ConstantInt::get(Int32Ty, 1);
|
||||
Value *SelectorAddr = GetElementPtrInst::Create(FCData, Idxs, Idxs+2,
|
||||
Value *SelectorAddr = GetElementPtrInst::Create(FCData, Idxs,
|
||||
"exc_selector_gep",
|
||||
EntryBB->getTerminator());
|
||||
// The exception value comes back in context->data[0]
|
||||
Idxs[1] = Zero;
|
||||
Value *ExceptionAddr = GetElementPtrInst::Create(FCData, Idxs, Idxs+2,
|
||||
Value *ExceptionAddr = GetElementPtrInst::Create(FCData, Idxs,
|
||||
"exception_gep",
|
||||
EntryBB->getTerminator());
|
||||
|
||||
@ -466,8 +464,7 @@ bool SjLjEHPass::insertSjLjEHSupport(Function &F) {
|
||||
Idxs[0] = Zero;
|
||||
Idxs[1] = ConstantInt::get(Int32Ty, 4);
|
||||
Value *LSDAFieldPtr =
|
||||
GetElementPtrInst::Create(FunctionContext, Idxs, Idxs+2,
|
||||
"lsda_gep",
|
||||
GetElementPtrInst::Create(FunctionContext, Idxs, "lsda_gep",
|
||||
EntryBB->getTerminator());
|
||||
Value *LSDA = CallInst::Create(LSDAAddrFn, "lsda_addr",
|
||||
EntryBB->getTerminator());
|
||||
@ -475,8 +472,7 @@ bool SjLjEHPass::insertSjLjEHSupport(Function &F) {
|
||||
|
||||
Idxs[1] = ConstantInt::get(Int32Ty, 3);
|
||||
Value *PersonalityFieldPtr =
|
||||
GetElementPtrInst::Create(FunctionContext, Idxs, Idxs+2,
|
||||
"lsda_gep",
|
||||
GetElementPtrInst::Create(FunctionContext, Idxs, "lsda_gep",
|
||||
EntryBB->getTerminator());
|
||||
new StoreInst(PersonalityFn, PersonalityFieldPtr, true,
|
||||
EntryBB->getTerminator());
|
||||
@ -484,12 +480,11 @@ bool SjLjEHPass::insertSjLjEHSupport(Function &F) {
|
||||
// Save the frame pointer.
|
||||
Idxs[1] = ConstantInt::get(Int32Ty, 5);
|
||||
Value *JBufPtr
|
||||
= GetElementPtrInst::Create(FunctionContext, Idxs, Idxs+2,
|
||||
"jbuf_gep",
|
||||
= GetElementPtrInst::Create(FunctionContext, Idxs, "jbuf_gep",
|
||||
EntryBB->getTerminator());
|
||||
Idxs[1] = ConstantInt::get(Int32Ty, 0);
|
||||
Value *FramePtr =
|
||||
GetElementPtrInst::Create(JBufPtr, Idxs, Idxs+2, "jbuf_fp_gep",
|
||||
GetElementPtrInst::Create(JBufPtr, Idxs, "jbuf_fp_gep",
|
||||
EntryBB->getTerminator());
|
||||
|
||||
Value *Val = CallInst::Create(FrameAddrFn,
|
||||
@ -501,7 +496,7 @@ bool SjLjEHPass::insertSjLjEHSupport(Function &F) {
|
||||
// Save the stack pointer.
|
||||
Idxs[1] = ConstantInt::get(Int32Ty, 2);
|
||||
Value *StackPtr =
|
||||
GetElementPtrInst::Create(JBufPtr, Idxs, Idxs+2, "jbuf_sp_gep",
|
||||
GetElementPtrInst::Create(JBufPtr, Idxs, "jbuf_sp_gep",
|
||||
EntryBB->getTerminator());
|
||||
|
||||
Val = CallInst::Create(StackAddrFn, "sp", EntryBB->getTerminator());
|
||||
|
Reference in New Issue
Block a user