mirror of
https://github.com/RPCSX/llvm.git
synced 2025-04-10 20:20:54 +00:00
IR: Don't cast the end iterator to Instruction*
End iterators are usually sentinels, not actually Instruction* at all. Stop casting to it just to get an iterator back. There is likely no observable functionality change here right now (although this is relying on UB, I doubt it was triggering anything), but I'll be removing the cast soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278346 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
91c138b3e0
commit
9040acb5e3
@ -2410,8 +2410,8 @@ LLVMBuilderRef LLVMCreateBuilder(void) {
|
|||||||
void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block,
|
void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block,
|
||||||
LLVMValueRef Instr) {
|
LLVMValueRef Instr) {
|
||||||
BasicBlock *BB = unwrap(Block);
|
BasicBlock *BB = unwrap(Block);
|
||||||
Instruction *I = Instr? unwrap<Instruction>(Instr) : (Instruction*) BB->end();
|
auto I = Instr ? unwrap<Instruction>(Instr)->getIterator() : BB->end();
|
||||||
unwrap(Builder)->SetInsertPoint(BB, I->getIterator());
|
unwrap(Builder)->SetInsertPoint(BB, I);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr) {
|
void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user