diff options
| author | Mike Stump <mrs@apple.com> | 2009-05-23 20:21:36 +0000 |
|---|---|---|
| committer | Mike Stump <mrs@apple.com> | 2009-05-23 20:21:36 +0000 |
| commit | 93700fc9883aafb0ce6c548c98e75490b944d907 (patch) | |
| tree | f26168d642928ee2de13b39f64b4cf03fd0b3081 /clang/lib/CodeGen | |
| parent | cfe9db73804bce98eafe12fe9a5508c603f1328b (diff) | |
| download | bcm5719-llvm-93700fc9883aafb0ce6c548c98e75490b944d907.tar.gz bcm5719-llvm-93700fc9883aafb0ce6c548c98e75490b944d907.zip | |
Add support for volatile RValues.
llvm-svn: 72341
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGValue.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGValue.h b/clang/lib/CodeGen/CGValue.h index aed9fc156de..e4175bb62d8 100644 --- a/clang/lib/CodeGen/CGValue.h +++ b/clang/lib/CodeGen/CGValue.h @@ -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; } }; |

