summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Instruction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/VMCore/Instruction.cpp')
-rw-r--r--llvm/lib/VMCore/Instruction.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/VMCore/Instruction.cpp b/llvm/lib/VMCore/Instruction.cpp
index ce253d64ced..f468c1bf3af 100644
--- a/llvm/lib/VMCore/Instruction.cpp
+++ b/llvm/lib/VMCore/Instruction.cpp
@@ -24,7 +24,8 @@ using namespace llvm;
Instruction::Instruction(const Type *ty, unsigned it, Use *Ops, unsigned NumOps,
Instruction *InsertBefore)
- : User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(0) {
+ : User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(0),
+ HasMetadata(false) {
// Make sure that we get added to a basicblock
LeakDetector::addGarbageObject(this);
@@ -38,7 +39,8 @@ Instruction::Instruction(const Type *ty, unsigned it, Use *Ops, unsigned NumOps,
Instruction::Instruction(const Type *ty, unsigned it, Use *Ops, unsigned NumOps,
BasicBlock *InsertAtEnd)
- : User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(0) {
+ : User(ty, Value::InstructionVal + it, Ops, NumOps), Parent(0),
+ HasMetadata(false) {
// Make sure that we get added to a basicblock
LeakDetector::addGarbageObject(this);
@@ -51,10 +53,8 @@ Instruction::Instruction(const Type *ty, unsigned it, Use *Ops, unsigned NumOps,
// Out of line virtual method, so the vtable, etc has a home.
Instruction::~Instruction() {
assert(Parent == 0 && "Instruction still linked in the program!");
- if (hasMetadata()) {
- LLVMContext &Context = getContext();
- Context.pImpl->TheMetadata.ValueIsDeleted(this);
- }
+ if (HasMetadata)
+ getContext().pImpl->TheMetadata.ValueIsDeleted(this);
}
@@ -464,7 +464,7 @@ bool Instruction::isSafeToSpeculativelyExecute() const {
Instruction *Instruction::clone() const {
Instruction *New = clone_impl();
New->SubclassOptionalData = SubclassOptionalData;
- if (hasMetadata())
+ if (HasMetadata)
getContext().pImpl->TheMetadata.ValueIsCloned(this, New);
return New;
}
OpenPOWER on IntegriCloud