[cfe-commits] r72341 - /cfe/trunk/lib/CodeGen/CGValue.h

Mike Stump mrs at apple.com
Sat May 23 13:21:36 PDT 2009


Author: mrs
Date: Sat May 23 15:21:36 2009
New Revision: 72341

URL: http://llvm.org/viewvc/llvm-project?rev=72341&view=rev
Log:
Add support for volatile RValues.

Modified:
    cfe/trunk/lib/CodeGen/CGValue.h

Modified: cfe/trunk/lib/CodeGen/CGValue.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGValue.h?rev=72341&r1=72340&r2=72341&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGValue.h (original)
+++ cfe/trunk/lib/CodeGen/CGValue.h Sat May 23 15:21:36 2009
@@ -38,14 +38,15 @@
   // 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 @@
     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;
   }
 };





More information about the cfe-commits mailing list