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
diff --git a/lib/CodeGen/CGValue.h b/lib/CodeGen/CGValue.h
index e601b04..505381e 100644
--- a/lib/CodeGen/CGValue.h
+++ b/lib/CodeGen/CGValue.h
@@ -130,13 +130,16 @@
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 @@
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