]> granicus.if.org Git - clang/commitdiff
IRgen/LValue: Add LValue::setNonGC instead of SetObjCNonGC, for consistency with...
authorDaniel Dunbar <daniel@zuster.org>
Sat, 21 Aug 2010 03:22:38 +0000 (03:22 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sat, 21 Aug 2010 03:22:38 +0000 (03:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111718 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExpr.cpp
lib/CodeGen/CGExprAgg.cpp
lib/CodeGen/CGValue.h

index f95a4388183b114bfbad10aac597df0330c98c6b..da42af39dcba5413fdb10599d5de1898da5d4704 100644 (file)
@@ -1185,7 +1185,9 @@ LValue CodeGenFunction::EmitDeclRefLValue(const DeclRefExpr *E) {
     if (VD->getType()->isReferenceType())
       V = Builder.CreateLoad(V, "tmp");
     LValue LV = LValue::MakeAddr(V, Quals);
-    LValue::SetObjCNonGC(LV, NonGCable);
+    if (NonGCable) {
+      LV.setNonGC(true);
+    }
     setObjCGCLValueClass(getContext(), E, LV);
     return LV;
   }
@@ -1234,7 +1236,7 @@ LValue CodeGenFunction::EmitUnaryOpLValue(const UnaryOperator *E) {
     if (getContext().getLangOptions().ObjC1 &&
         getContext().getLangOptions().getGCMode() != LangOptions::NonGC &&
         LV.isObjCWeak())
-      LValue::SetObjCNonGC(LV, !E->isOBJCGCCandidate(getContext()));
+      LV.setNonGC(!E->isOBJCGCCandidate(getContext()));
     return LV;
   }
   case UnaryOperator::Real:
@@ -1462,7 +1464,7 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) {
   LValue LV = LValue::MakeAddr(Address, Quals);
   if (getContext().getLangOptions().ObjC1 &&
       getContext().getLangOptions().getGCMode() != LangOptions::NonGC) {
-    LValue::SetObjCNonGC(LV, !E->isOBJCGCCandidate(getContext()));
+    LV.setNonGC(!E->isOBJCGCCandidate(getContext()));
     setObjCGCLValueClass(getContext(), E, LV);
   }
   return LV;
@@ -1568,7 +1570,7 @@ LValue CodeGenFunction::EmitMemberExpr(const MemberExpr *E) {
   if (FieldDecl *Field = dyn_cast<FieldDecl>(ND)) {
     LValue LV = EmitLValueForField(BaseValue, Field, 
                                    BaseQuals.getCVRQualifiers());
-    LValue::SetObjCNonGC(LV, isNonGC);
+    LV.setNonGC(isNonGC);
     setObjCGCLValueClass(getContext(), E, LV);
     return LV;
   }
index b3bce15c7478802f868a3e5091322ffd4724afa3..bd7f18e24cc9127b22ff73f50f64f9e7087c7e41 100644 (file)
@@ -735,7 +735,7 @@ void AggExprEmitter::VisitInitListExpr(InitListExpr *E) {
     // FIXME: volatility
     LValue FieldLoc = CGF.EmitLValueForFieldInitialization(DestPtr, *Field, 0);
     // We never generate write-barries for initialized fields.
-    LValue::SetObjCNonGC(FieldLoc, true);
+    FieldLoc.setNonGC(true);
     if (CurInitVal < NumInitElements) {
       // Store the initializer into the field.
       EmitInitializationToLValue(E->getInit(CurInitVal++), FieldLoc,
index 8153169c8757dc384890cf320dee830aa953e872..b190cc8cc067147c766e602b96b0be06d46825c7 100644 (file)
@@ -185,7 +185,10 @@ public:
 
   bool isObjCIvar() const { return Ivar; }
   bool isObjCArray() const { return ObjIsArray; }
+
   bool isNonGC () const { return NonGC; }
+  void setNonGC(bool Value) { NonGC = Value; }
+
   bool isGlobalObjCRef() const { return GlobalObjCRef; }
   bool isThreadLocalRef() const { return ThreadLocalRef; }
   bool isObjCWeak() const { return Quals.getObjCGCAttr() == Qualifiers::Weak; }
@@ -210,9 +213,6 @@ public:
   static void SetThreadLocalRef(LValue& R, bool iValue) {
     R.ThreadLocalRef = iValue;
   }
-  static void SetObjCNonGC(LValue& R, bool iValue) {
-    R.NonGC = iValue;
-  }
 
   // simple lvalue
   llvm::Value *getAddress() const { assert(isSimple()); return V; }