Skip to content

Commit 706c610

Browse files
committed
[LLVMCore] Fix a bug in function 'Instruction::setVolatile'
1 parent a133aee commit 706c610

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/IR/Instruction.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -793,16 +793,16 @@ void Instruction::setVolatile(bool Volatile) {
793793
IsVolatileInstruction = Volatile;
794794
switch (getOpcode()) {
795795
case Instruction::AtomicRMW:
796-
cast<AtomicRMWInst>(this)->setVolatile(true);
796+
cast<AtomicRMWInst>(this)->setVolatile(Volatile);
797797
break;
798798
case Instruction::Store:
799-
cast<StoreInst>(this)->setVolatile(true);
799+
cast<StoreInst>(this)->setVolatile(Volatile);
800800
break;
801801
case Instruction::Load:
802-
cast<LoadInst>(this)->setVolatile(true);
802+
cast<LoadInst>(this)->setVolatile(Volatile);
803803
break;
804804
case Instruction::AtomicCmpXchg:
805-
cast<AtomicCmpXchgInst>(this)->setVolatile(true);
805+
cast<AtomicCmpXchgInst>(this)->setVolatile(Volatile);
806806
break;
807807
}
808808
}

0 commit comments

Comments
 (0)