IRgen/LValue: Add LValue::setNonGC instead of SetObjCNonGC, for consistency with isNonGC().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111718 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index f95a438..da42af3 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/lib/CodeGen/CGExpr.cpp
@@ -1185,7 +1185,9 @@
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 @@
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 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 @@
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;
}