Instead of initializing the volatile field, use accessors to set it.
authorChris Lattner <sabre@nondot.org>
Sat, 5 Feb 2005 01:38:38 +0000 (01:38 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 5 Feb 2005 01:38:38 +0000 (01:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20045 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Instructions.cpp

index 4bbe64a12855c26b9ddf2dbc5f15b0118f4b4e8e..73183a344bdce08cdc0410689966db6ee0ea473f 100644 (file)
@@ -498,27 +498,31 @@ void LoadInst::AssertOK() {
 
 LoadInst::LoadInst(Value *Ptr, const std::string &Name, Instruction *InsertBef)
   : UnaryInstruction(cast<PointerType>(Ptr->getType())->getElementType(),
-                     Load, Ptr, Name, InsertBef), Volatile(false) {
+                     Load, Ptr, Name, InsertBef) {
+  setVolatile(false);
   AssertOK();
 }
 
 LoadInst::LoadInst(Value *Ptr, const std::string &Name, BasicBlock *InsertAE)
   : UnaryInstruction(cast<PointerType>(Ptr->getType())->getElementType(),
-                     Load, Ptr, Name, InsertAE), Volatile(false) {
+                     Load, Ptr, Name, InsertAE) {
+  setVolatile(false);
   AssertOK();
 }
 
 LoadInst::LoadInst(Value *Ptr, const std::string &Name, bool isVolatile,
                    Instruction *InsertBef)
   : UnaryInstruction(cast<PointerType>(Ptr->getType())->getElementType(),
-                     Load, Ptr, Name, InsertBef), Volatile(isVolatile) {
+                     Load, Ptr, Name, InsertBef) {
+  setVolatile(isVolatile);
   AssertOK();
 }
 
 LoadInst::LoadInst(Value *Ptr, const std::string &Name, bool isVolatile,
                    BasicBlock *InsertAE)
   : UnaryInstruction(cast<PointerType>(Ptr->getType())->getElementType(),
-                     Load, Ptr, Name, InsertAE), Volatile(isVolatile) {
+                     Load, Ptr, Name, InsertAE) {
+  setVolatile(isVolatile);
   AssertOK();
 }
 
@@ -537,35 +541,36 @@ void StoreInst::AssertOK() {
 
 
 StoreInst::StoreInst(Value *val, Value *addr, Instruction *InsertBefore)
-  : Instruction(Type::VoidTy, Store, Ops, 2, "", InsertBefore),
-    Volatile(false) {
+  : Instruction(Type::VoidTy, Store, Ops, 2, "", InsertBefore) {
   Ops[0].init(val, this);
   Ops[1].init(addr, this);
+  setVolatile(false);
   AssertOK();
 }
 
 StoreInst::StoreInst(Value *val, Value *addr, BasicBlock *InsertAtEnd)
-  : Instruction(Type::VoidTy, Store, Ops, 2, "", InsertAtEnd), Volatile(false) {
+  : Instruction(Type::VoidTy, Store, Ops, 2, "", InsertAtEnd) {
   Ops[0].init(val, this);
   Ops[1].init(addr, this);
+  setVolatile(false);
   AssertOK();
 }
 
 StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile, 
                      Instruction *InsertBefore)
-  : Instruction(Type::VoidTy, Store, Ops, 2, "", InsertBefore),
-    Volatile(isVolatile) {
+  : Instruction(Type::VoidTy, Store, Ops, 2, "", InsertBefore) {
   Ops[0].init(val, this);
   Ops[1].init(addr, this);
+  setVolatile(isVolatile);
   AssertOK();
 }
 
 StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile, 
                      BasicBlock *InsertAtEnd)
-  : Instruction(Type::VoidTy, Store, Ops, 2, "", InsertAtEnd),
-    Volatile(isVolatile) {
+  : Instruction(Type::VoidTy, Store, Ops, 2, "", InsertAtEnd) {
   Ops[0].init(val, this);
   Ops[1].init(addr, this);
+  setVolatile(isVolatile);
   AssertOK();
 }