]> granicus.if.org Git - clang/commitdiff
Add support for volatile RValues.
authorMike Stump <mrs@apple.com>
Sat, 23 May 2009 20:21:36 +0000 (20:21 +0000)
committerMike Stump <mrs@apple.com>
Sat, 23 May 2009 20:21:36 +0000 (20:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72341 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGValue.h

index aed9fc156def7763b9c388f5f140cc9ff7f07b60..e4175bb62d8218562ea874ca15ecfd2dac8161e8 100644 (file)
@@ -38,14 +38,15 @@ class RValue {
   // return-by-value.
   enum { Scalar, Complex, Aggregate } Flavor;
   
-  // FIXME: Aggregate rvalues need to retain information about whether they are
-  // volatile or not.
+  bool Volatile:1;
 public:
   
   bool isScalar() const { return Flavor == Scalar; }
   bool isComplex() const { return Flavor == Complex; }
   bool isAggregate() const { return Flavor == Aggregate; }
   
+  bool isVolatileQualified() const { return Volatile; }
+
   /// getScalar() - Return the Value* of this scalar value.
   llvm::Value *getScalarVal() const {
     assert(isScalar() && "Not a scalar!");
@@ -84,10 +85,14 @@ public:
     ER.Flavor = Complex;
     return ER;
   }
-  static RValue getAggregate(llvm::Value *V) {
+  // FIXME: Aggregate rvalues need to retain information about whether they are
+  // volatile or not.  Remove default to find all places that probably get this
+  // wrong.
+  static RValue getAggregate(llvm::Value *V, bool Vol = false) {
     RValue ER;
     ER.V1 = V;
     ER.Flavor = Aggregate;
+    ER.Volatile = Vol;
     return ER;
   }
 };