aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Instruction.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@outlook.com>2024-02-29 15:49:05 +0000
committerAlexey Bataev <a.bataev@outlook.com>2024-02-29 15:49:05 +0000
commita0d744b9cf4a5bd7219c5c1007d8db317b70cf1f (patch)
tree40d806f565e8f0ebdafb78f01db92fe4499096f9 /llvm/lib/IR/Instruction.cpp
parent46478028cda679b76757cae689a53b11fadad5f5 (diff)
parent4f132dca711f4b425f9d370f5d59efb766b8bffa (diff)
downloadllvm-users/alexey-bataev/spr/ttiriscvimprove-costs-for-fixed-vector-whole-reg-extractinsert.zip
llvm-users/alexey-bataev/spr/ttiriscvimprove-costs-for-fixed-vector-whole-reg-extractinsert.tar.gz
llvm-users/alexey-bataev/spr/ttiriscvimprove-costs-for-fixed-vector-whole-reg-extractinsert.tar.bz2
Created using spr 1.3.5
Diffstat (limited to 'llvm/lib/IR/Instruction.cpp')
-rw-r--r--llvm/lib/IR/Instruction.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/IR/Instruction.cpp b/llvm/lib/IR/Instruction.cpp
index c54f8d7..ce22175 100644
--- a/llvm/lib/IR/Instruction.cpp
+++ b/llvm/lib/IR/Instruction.cpp
@@ -46,11 +46,11 @@ Instruction::Instruction(Type *ty, unsigned it, Use *Ops, unsigned NumOps,
Instruction::Instruction(Type *ty, unsigned it, Use *Ops, unsigned NumOps,
BasicBlock *InsertAtEnd)
- : User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(nullptr) {
+ : User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(nullptr) {
- // append this instruction into the basic block
- assert(InsertAtEnd && "Basic block to append to may not be NULL!");
- insertInto(InsertAtEnd, InsertAtEnd->end());
+ // If requested, append this instruction into the basic block.
+ if (InsertAtEnd)
+ insertInto(InsertAtEnd, InsertAtEnd->end());
}
Instruction::~Instruction() {
@@ -73,7 +73,6 @@ Instruction::~Instruction() {
setMetadata(LLVMContext::MD_DIAssignID, nullptr);
}
-
void Instruction::setParent(BasicBlock *P) {
Parent = P;
}