diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-01 22:30:59 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-01 22:30:59 +0000 |
| commit | 7edf9e38b91917b661277601c0e448eef0eb2b56 (patch) | |
| tree | cae1fa811f387c2ba417ee518422ee4efde61597 /lib/CodeGen/CGExpr.cpp | |
| parent | da082f12c2633e9b45046fdce81e8b5847b9a26b (diff) | |
| download | clang-7edf9e38b91917b661277601c0e448eef0eb2b56.tar.gz clang-7edf9e38b91917b661277601c0e448eef0eb2b56.tar.bz2 clang-7edf9e38b91917b661277601c0e448eef0eb2b56.tar.xz | |
Simplify: replace getContext().getLangOpts() with just getLangOpts().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167261 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
| -rw-r--r-- | lib/CodeGen/CGExpr.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index e52a9abf56..625558542a 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -194,7 +194,7 @@ EmitExprForReferenceBinding(CodeGenFunction &CGF, const Expr *E, // Objective-C++ ARC: // If we are binding a reference to a temporary that has ownership, we // need to perform retain/release operations on the temporary. - if (M && CGF.getContext().getLangOpts().ObjCAutoRefCount && + if (M && CGF.getLangOpts().ObjCAutoRefCount && M->getType()->isObjCLifetimeType() && (M->getType().getObjCLifetime() == Qualifiers::OCL_Strong || M->getType().getObjCLifetime() == Qualifiers::OCL_Weak || @@ -1771,8 +1771,8 @@ LValue CodeGenFunction::EmitUnaryOpLValue(const UnaryOperator *E) { // of a pointer to object; as in void foo (__weak id *param); *param = 0; // But, we continue to generate __strong write barrier on indirect write // into a pointer to object. - if (getContext().getLangOpts().ObjC1 && - getContext().getLangOpts().getGC() != LangOptions::NonGC && + if (getLangOpts().ObjC1 && + getLangOpts().getGC() != LangOptions::NonGC && LV.isObjCWeak()) LV.setNonGC(!E->isOBJCGCCandidate(getContext())); return LV; @@ -2177,14 +2177,14 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) { // Propagate the alignment from the array itself to the result. ArrayAlignment = ArrayLV.getAlignment(); - if (getContext().getLangOpts().isSignedOverflowDefined()) + if (getLangOpts().isSignedOverflowDefined()) Address = Builder.CreateGEP(ArrayPtr, Args, "arrayidx"); else Address = Builder.CreateInBoundsGEP(ArrayPtr, Args, "arrayidx"); } else { // The base must be a pointer, which is not an aggregate. Emit it. llvm::Value *Base = EmitScalarExpr(E->getBase()); - if (getContext().getLangOpts().isSignedOverflowDefined()) + if (getLangOpts().isSignedOverflowDefined()) Address = Builder.CreateGEP(Base, Idx, "arrayidx"); else Address = Builder.CreateInBoundsGEP(Base, Idx, "arrayidx"); @@ -2207,8 +2207,8 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) { LV.getQuals().setAddressSpace(E->getBase()->getType().getAddressSpace()); - if (getContext().getLangOpts().ObjC1 && - getContext().getLangOpts().getGC() != LangOptions::NonGC) { + if (getLangOpts().ObjC1 && + getLangOpts().getGC() != LangOptions::NonGC) { LV.setNonGC(!E->isOBJCGCCandidate(getContext())); setObjCGCLValueClass(getContext(), E, LV); } @@ -2721,7 +2721,7 @@ RValue CodeGenFunction::EmitCallExpr(const CallExpr *E, if (const CXXPseudoDestructorExpr *PseudoDtor = dyn_cast<CXXPseudoDestructorExpr>(E->getCallee()->IgnoreParens())) { QualType DestroyedType = PseudoDtor->getDestroyedType(); - if (getContext().getLangOpts().ObjCAutoRefCount && + if (getLangOpts().ObjCAutoRefCount && DestroyedType->isObjCLifetimeType() && (DestroyedType.getObjCLifetime() == Qualifiers::OCL_Strong || DestroyedType.getObjCLifetime() == Qualifiers::OCL_Weak)) { |
