diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2008-11-18 20:18:11 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2008-11-18 20:18:11 +0000 |
commit | 6d657c4809d9128be88705d32768de007b988212 (patch) | |
tree | 8bf236ce48fb5ff95ddf46b50a2fbad8f0175a8d /lib/CodeGen/CGValue.h | |
parent | cfe8bf31ad61a16458d5970734d4a300a7bd9b0a (diff) |
Some basic support toward objective-c's GC code gen.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59543 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGValue.h')
-rw-r--r-- | lib/CodeGen/CGValue.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/CodeGen/CGValue.h b/lib/CodeGen/CGValue.h index e601b04900..505381eb41 100644 --- a/lib/CodeGen/CGValue.h +++ b/lib/CodeGen/CGValue.h @@ -130,13 +130,16 @@ class LValue { bool Volatile:1; // FIXME: set but never used, what effect should it have? bool Restrict:1; + + bool ObjcWeak:1; + bool ObjcStrong:1; private: static void SetQualifiers(unsigned Qualifiers, LValue& R) { R.Volatile = (Qualifiers&QualType::Volatile)!=0; R.Restrict = (Qualifiers&QualType::Restrict)!=0; } - + public: bool isSimple() const { return LVType == Simple; } bool isVectorElt() const { return LVType == VectorElt; } @@ -146,7 +149,15 @@ public: bool isVolatileQualified() const { return Volatile; } bool isRestrictQualified() const { return Restrict; } - + + bool isObjcWeak() const { return ObjcWeak; } + bool isObjcStrong() const { return ObjcStrong; } + + static void SetObjCGCAttrs(unsigned Weak, unsigned Strong, LValue& R) { + R.ObjcWeak = Weak; + R.ObjcStrong = Strong; + } + // simple lvalue llvm::Value *getAddress() const { assert(isSimple()); return V; } // vector elt lvalue |