diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-03-11 07:00:24 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-03-11 07:00:24 +0000 |
commit | 4e4d08403ca5cfd4d558fa2936215d3a4e5a528d (patch) | |
tree | bc9bf6ce1639dc8a7ba02d0e3046ab14b5329d8c /lib/CodeGen | |
parent | 7c02cfeb0861278c09ba05d1b92bd2a996bbe2e0 (diff) |
Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).
The member variable is always "LangOpts" and the member function is always "getLangOpts".
Reviewed by Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152536 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
28 files changed, 207 insertions, 207 deletions
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp index 8e280e6823..9fe31cb958 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/lib/CodeGen/CGBlocks.cpp @@ -92,7 +92,7 @@ static llvm::Constant *buildBlockDescriptor(CodeGenModule &CGM, CGM.GetAddrOfConstantCString(typeAtEncoding), i8p)); // GC layout. - if (C.getLangOptions().ObjC1) + if (C.getLangOpts().ObjC1) elements.push_back(CGM.getObjCRuntime().BuildGCBlockLayout(CGM, blockInfo)); else elements.push_back(llvm::Constant::getNullValue(i8p)); @@ -227,7 +227,7 @@ static llvm::Constant *tryCaptureAsConstant(CodeGenModule &CGM, // Except that any class member declared mutable can be // modified, any attempt to modify a const object during its // lifetime results in undefined behavior. - if (CGM.getLangOptions().CPlusPlus && !isSafeForCXXConstantCapture(type)) + if (CGM.getLangOpts().CPlusPlus && !isSafeForCXXConstantCapture(type)) return 0; // If the variable doesn't have any initializer (shouldn't this be @@ -374,7 +374,7 @@ static void computeBlockInfo(CodeGenModule &CGM, CodeGenFunction *CGF, info.HasCXXObject = true; // And so do types with destructors. - } else if (CGM.getLangOptions().CPlusPlus) { + } else if (CGM.getLangOpts().CPlusPlus) { if (const CXXRecordDecl *record = variable->getType()->getAsCXXRecordDecl()) { if (!record->hasTrivialDestructor()) { @@ -1251,7 +1251,7 @@ CodeGenFunction::GenerateCopyHelperFunction(const CGBlockInfo &blockInfo) { flags = BLOCK_FIELD_IS_BLOCK; // Special rules for ARC captures: - if (getLangOptions().ObjCAutoRefCount) { + if (getLangOpts().ObjCAutoRefCount) { Qualifiers qs = type.getQualifiers(); // Don't generate special copy logic for a captured object @@ -1363,7 +1363,7 @@ CodeGenFunction::GenerateDestroyHelperFunction(const CGBlockInfo &blockInfo) { flags = BLOCK_FIELD_IS_BLOCK; // Special rules for ARC captures. - if (getLangOptions().ObjCAutoRefCount) { + if (getLangOpts().ObjCAutoRefCount) { Qualifiers qs = type.getQualifiers(); // Don't generate special dispose logic for a captured object @@ -1744,7 +1744,7 @@ CodeGenFunction::buildByrefHelpers(llvm::StructType &byrefType, // If we have lifetime, that dominates. if (Qualifiers::ObjCLifetime lifetime = qs.getObjCLifetime()) { - assert(getLangOptions().ObjCAutoRefCount); + assert(getLangOpts().ObjCAutoRefCount); switch (lifetime) { case Qualifiers::OCL_None: llvm_unreachable("impossible"); @@ -1979,7 +1979,7 @@ namespace { /// to be done externally. void CodeGenFunction::enterByrefCleanup(const AutoVarEmission &emission) { // We don't enter this cleanup if we're in pure-GC mode. - if (CGM.getLangOptions().getGC() == LangOptions::GCOnly) + if (CGM.getLangOpts().getGC() == LangOptions::GCOnly) return; EHStack.pushCleanup<CallBlockRelease>(NormalAndEHCleanup, emission.Address); @@ -1988,7 +1988,7 @@ void CodeGenFunction::enterByrefCleanup(const AutoVarEmission &emission) { /// Adjust the declaration of something from the blocks API. static void configureBlocksRuntimeObject(CodeGenModule &CGM, llvm::Constant *C) { - if (!CGM.getLangOptions().BlocksRuntimeOptional) return; + if (!CGM.getLangOpts().BlocksRuntimeOptional) return; llvm::GlobalValue *GV = cast<llvm::GlobalValue>(C->stripPointerCasts()); if (GV->isDeclaration() && diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 2c7a0495ae..4fe4fa8a14 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -254,7 +254,7 @@ CodeGenTypes::arrangeObjCMessageSendSignature(const ObjCMethodDecl *MD, FunctionType::ExtInfo einfo; einfo = einfo.withCallingConv(getCallingConventionForDecl(MD)); - if (getContext().getLangOptions().ObjCAutoRefCount && + if (getContext().getLangOpts().ObjCAutoRefCount && MD->hasAttr<NSReturnsRetainedAttr>()) einfo = einfo.withProducesResult(true); @@ -1467,7 +1467,7 @@ void CodeGenFunction::EmitFunctionEpilog(const CGFunctionInfo &FI) { // In ARC, end functions that return a retainable type with a call // to objc_autoreleaseReturnValue. if (AutoreleaseResult) { - assert(getLangOptions().ObjCAutoRefCount && + assert(getLangOpts().ObjCAutoRefCount && !FI.isReturnsRetained() && RetTy->isObjCRetainableType()); RV = emitAutoreleaseOfResult(*this, RV); @@ -1662,7 +1662,7 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E, QualType type) { if (const ObjCIndirectCopyRestoreExpr *CRE = dyn_cast<ObjCIndirectCopyRestoreExpr>(E)) { - assert(getContext().getLangOptions().ObjCAutoRefCount); + assert(getContext().getLangOpts().ObjCAutoRefCount); assert(getContext().hasSameType(E->getType(), type)); return emitWritebackArg(*this, args, CRE); } @@ -1717,7 +1717,7 @@ CodeGenFunction::EmitCallOrInvoke(llvm::Value *Callee, // In ObjC ARC mode with no ObjC ARC exception safety, tell the ARC // optimizer it can aggressively ignore unwind edges. - if (CGM.getLangOptions().ObjCAutoRefCount) + if (CGM.getLangOpts().ObjCAutoRefCount) AddObjCARCExceptionMetadata(Inst); return Inst; @@ -2031,7 +2031,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, // In ObjC ARC mode with no ObjC ARC exception safety, tell the ARC // optimizer it can aggressively ignore unwind edges. - if (CGM.getLangOptions().ObjCAutoRefCount) + if (CGM.getLangOpts().ObjCAutoRefCount) AddObjCARCExceptionMetadata(CS.getInstruction()); // If the call doesn't return, finish the basic block and clear the diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp index 6b5a149710..ee79c394ac 100644 --- a/lib/CodeGen/CGClass.cpp +++ b/lib/CodeGen/CGClass.cpp @@ -405,7 +405,7 @@ static void EmitBaseInitializer(CodeGenFunction &CGF, CGF.EmitAggExpr(BaseInit->getInit(), AggSlot); - if (CGF.CGM.getLangOptions().Exceptions && + if (CGF.CGM.getLangOpts().Exceptions && !BaseClassDecl->hasTrivialDestructor()) CGF.EHStack.pushCleanup<CallBaseDtor>(EHCleanup, BaseClassDecl, isBaseVirtual); @@ -642,7 +642,7 @@ void CodeGenFunction::EmitInitializerForField(FieldDecl *Field, EmitAggMemberInitializer(*this, LHS, Init, ArrayIndexVar, FieldType, ArrayIndexes, 0); - if (!CGM.getLangOptions().Exceptions) + if (!CGM.getLangOpts().Exceptions) return; // FIXME: If we have an array of classes w/ non-trivial destructors, @@ -935,7 +935,7 @@ void CodeGenFunction::EmitDestructorBody(FunctionArgList &Args) { } // -fapple-kext must inline any call to this dtor into // the caller's body. - if (getContext().getLangOptions().AppleKext) + if (getContext().getLangOpts().AppleKext) CurFn->addFnAttr(llvm::Attribute::AlwaysInline); break; } @@ -1172,7 +1172,7 @@ CodeGenFunction::EmitCXXAggrConstructorCall(const CXXConstructorDecl *ctor, // Evaluate the constructor and its arguments in a regular // partial-destroy cleanup. - if (getLangOptions().Exceptions && + if (getLangOpts().Exceptions && !ctor->getParent()->hasTrivialDestructor()) { Destroyer *destroyer = destroyCXXObject; pushRegularPartialArrayCleanup(arrayBegin, cur, type, *destroyer); @@ -1376,7 +1376,7 @@ CodeGenFunction::EmitDelegatingCXXConstructorCall(const CXXConstructorDecl *Ctor EmitAggExpr(Ctor->init_begin()[0]->getInit(), AggSlot); const CXXRecordDecl *ClassDecl = Ctor->getParent(); - if (CGM.getLangOptions().Exceptions && !ClassDecl->hasTrivialDestructor()) { + if (CGM.getLangOpts().Exceptions && !ClassDecl->hasTrivialDestructor()) { CXXDtorType Type = CurGD.getCtorType() == Ctor_Complete ? Dtor_Complete : Dtor_Base; @@ -1393,7 +1393,7 @@ void CodeGenFunction::EmitCXXDestructorCall(const CXXDestructorDecl *DD, llvm::Value *VTT = GetVTTParameter(*this, GlobalDecl(DD, Type), ForVirtualBase); llvm::Value *Callee = 0; - if (getContext().getLangOptions().AppleKext) + if (getContext().getLangOpts().AppleKext) Callee = BuildAppleKextVirtualDestructorCall(DD, Type, DD->getParent()); @@ -1711,7 +1711,7 @@ static bool UseVirtualCall(ASTContext &Context, // When building with -fapple-kext, all calls must go through the vtable since // the kernel linker can do runtime patching of vtables. - if (Context.getLangOptions().AppleKext) + if (Context.getLangOpts().AppleKext) return true; return !canDevirtualizeMemberFunctionCall(CE->getArg(0), MD); diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 96d3198d5e..bd37197ae3 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -183,7 +183,7 @@ CGDebugInfo::getClassName(const RecordDecl *RD) { NumArgs = TemplateArgs.size(); } Buffer = RD->getIdentifier()->getNameStart(); - PrintingPolicy Policy(CGM.getLangOptions()); + PrintingPolicy Policy(CGM.getLangOpts()); Buffer += TemplateSpecializationType::PrintTemplateArgumentList(Args, NumArgs, Policy); @@ -288,7 +288,7 @@ void CGDebugInfo::CreateCompileUnit() { StringRef Filename(FilenamePtr, MainFileName.length()); unsigned LangTag; - const LangOptions &LO = CGM.getLangOptions(); + const LangOptions &LO = CGM.getLangOpts(); if (LO.CPlusPlus) { if (LO.ObjC1) LangTag = llvm::dwarf::DW_LANG_ObjC_plus_plus; @@ -332,7 +332,7 @@ llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT) { llvm_unreachable("Unexpected builtin type"); case BuiltinType::NullPtr: return DBuilder. - createNullPtrType(BT->getName(CGM.getContext().getLangOptions())); + createNullPtrType(BT->getName(CGM.getContext().getLangOpts())); case BuiltinType::Void: return llvm::DIType(); case BuiltinType::ObjCClass: @@ -403,7 +403,7 @@ llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT) { case BuiltinType::ULong: BTName = "long unsigned int"; break; case BuiltinType::ULongLong: BTName = "long long unsigned int"; break; default: - BTName = BT->getName(CGM.getContext().getLangOptions()); + BTName = BT->getName(CGM.getContext().getLangOpts()); break; } // Bit size, align and offset of the type. @@ -953,7 +953,7 @@ CGDebugInfo::CreateCXXMemberFunction(const CXXMethodDecl *Method, MethodTy, /*isLocalToUnit=*/false, /* isDefinition=*/ false, Virtuality, VIndex, ContainingType, - Flags, CGM.getLangOptions().Optimize); + Flags, CGM.getLangOpts().Optimize); SPCache[Method->getCanonicalDecl()] = llvm::WeakVH(SP); @@ -1345,7 +1345,7 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty, // the non-fragile abi and the debugger should ignore the value anyways. // Call it the FieldNo+1 due to how debuggers use the information, // e.g. negating the value when it needs a lookup in the dynamic table. - uint64_t FieldOffset = CGM.getLangOptions().ObjCNonFragileABI ? FieldNo+1 + uint64_t FieldOffset = CGM.getLangOpts().ObjCNonFragileABI ? FieldNo+1 : RL.getFieldOffset(FieldNo); unsigned Flags = 0; @@ -1996,7 +1996,7 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType, DBuilder.createFunction(FDContext, Name, LinkageName, Unit, LineNo, getOrCreateFunctionType(D, FnType, Unit), Fn->hasInternalLinkage(), true/*definition*/, - Flags, CGM.getLangOptions().Optimize, Fn, + Flags, CGM.getLangOpts().Optimize, Fn, TParamsArray, SPDecl); // Push function on region stack. @@ -2227,7 +2227,7 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag, llvm::DIVariable D = DBuilder.createLocalVariable(Tag, llvm::DIDescriptor(Scope), Name, Unit, Line, Ty, - CGM.getLangOptions().Optimize, Flags, ArgNo); + CGM.getLangOpts().Optimize, Flags, ArgNo); // Insert an llvm.dbg.declare into the current block. llvm::Instruction *Call = @@ -2256,7 +2256,7 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag, llvm::DIVariable D = DBuilder.createLocalVariable(Tag, llvm::DIDescriptor(Scope), FieldName, Unit, Line, FieldTy, - CGM.getLangOptions().Optimize, Flags, + CGM.getLangOpts().Optimize, Flags, ArgNo); // Insert an llvm.dbg.declare into the current block. @@ -2484,7 +2484,7 @@ void CGDebugInfo::EmitDeclareOfBlockLiteralArgVariable(const CGBlockInfo &block, DBuilder.createLocalVariable(llvm::dwarf::DW_TAG_arg_variable, llvm::DIDescriptor(scope), name, tunit, line, type, - CGM.getLangOptions().Optimize, flags, + CGM.getLangOpts().Optimize, flags, cast<llvm::Argument>(addr)->getArgNo() + 1); // Insert an llvm.dbg.value into the current block. diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index a3437f7458..970f0b2389 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -121,7 +121,7 @@ void CodeGenFunction::EmitVarDecl(const VarDecl &D) { // uniqued. We can't do this in C, though, because there's no // standard way to agree on which variables are the same (i.e. // there's no mangling). - if (getContext().getLangOptions().CPlusPlus) + if (getContext().getLangOpts().CPlusPlus) if (llvm::GlobalValue::isWeakForLinker(CurFn->getLinkage())) Linkage = CurFn->getLinkage(); @@ -141,7 +141,7 @@ void CodeGenFunction::EmitVarDecl(const VarDecl &D) { static std::string GetStaticDeclName(CodeGenFunction &CGF, const VarDecl &D, const char *Separator) { CodeGenModule &CGM = CGF.CGM; - if (CGF.getContext().getLangOptions().CPlusPlus) { + if (CGF.getContext().getLangOpts().CPlusPlus) { StringRef Name = CGM.getMangledName(&D); return Name.str(); } @@ -216,7 +216,7 @@ CodeGenFunction::AddInitializerToStaticVarDecl(const VarDecl &D, // If constant emission failed, then this should be a C++ static // initializer. if (!Init) { - if (!getContext().getLangOptions().CPlusPlus) + if (!getContext().getLangOpts().CPlusPlus) CGM.ErrorUnsupported(D.getInit(), "constant l-value expression"); else if (Builder.GetInsertBlock()) { // Since we have a static initializer, this global variable can't @@ -770,7 +770,7 @@ CodeGenFunction::EmitAutoVarAlloca(const VarDecl &D) { llvm::Value *DeclPtr; if (Ty->isConstantSizeType()) { if (!Target.useGlobalsForAutomaticVariables()) { - bool NRVO = getContext().getLangOptions().ElideConstructors && + bool NRVO = getContext().getLangOpts().ElideConstructors && D.isNRVOVariable(); // If this value is a POD array or struct with a statically @@ -1170,7 +1170,7 @@ void CodeGenFunction::EmitAutoVarCleanups(const AutoVarEmission &emission) { emitAutoVarTypeCleanup(emission, dtorKind); // In GC mode, honor objc_precise_lifetime. - if (getLangOptions().getGC() != LangOptions::NonGC && + if (getLangOpts().getGC() != LangOptions::NonGC && D.hasAttr<ObjCPreciseLifetimeAttr>()) { EHStack.pushCleanup<ExtendGCLifetime>(NormalCleanup, &D); } diff --git a/lib/CodeGen/CGDeclCXX.cpp b/lib/CodeGen/CGDeclCXX.cpp index fac38a3242..e7765fd106 100644 --- a/lib/CodeGen/CGDeclCXX.cpp +++ b/lib/CodeGen/CGDeclCXX.cpp @@ -199,14 +199,14 @@ CreateGlobalInitOrDestructFunction(CodeGenModule &CGM, llvm::Function *Fn = llvm::Function::Create(FTy, llvm::GlobalValue::InternalLinkage, Name, &CGM.getModule()); - if (!CGM.getContext().getLangOptions().AppleKext) { + if (!CGM.getContext().getLangOpts().AppleKext) { // Set the section if needed. if (const char *Section = CGM.getContext().getTargetInfo().getStaticInitSectionSpecifier()) Fn->setSection(Section); } - if (!CGM.getLangOptions().Exceptions) + if (!CGM.getLangOpts().Exceptions) Fn->setDoesNotThrow(); return Fn; @@ -327,7 +327,7 @@ void CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, // When building in Objective-C++ ARC mode, create an autorelease pool // around the global initializers. - if (getLangOptions().ObjCAutoRefCount && getLangOptions().CPlusPlus) { + if (getLangOpts().ObjCAutoRefCount && getLangOpts().CPlusPlus) { llvm::Value *token = EmitObjCAutoreleasePoolPush(); EmitObjCAutoreleasePoolCleanup(token); } diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp index 668dbaf70e..95e0030866 100644 --- a/lib/CodeGen/CGException.cpp +++ b/lib/CodeGen/CGException.cpp @@ -100,7 +100,7 @@ llvm::Constant *CodeGenFunction::getUnwindResumeFn() { llvm::FunctionType *FTy = llvm::FunctionType::get(VoidTy, Int8PtrTy, /*IsVarArgs=*/false); - if (CGM.getLangOptions().SjLjExceptions) + if (CGM.getLangOpts().SjLjExceptions) return CGM.CreateRuntimeFunction(FTy, "_Unwind_SjLj_Resume"); return CGM.CreateRuntimeFunction(FTy, "_Unwind_Resume"); } @@ -109,7 +109,7 @@ llvm::Constant *CodeGenFunction::getUnwindResumeOrRethrowFn() { llvm::FunctionType *FTy = llvm::FunctionType::get(VoidTy, Int8PtrTy, /*IsVarArgs=*/false); - if (CGM.getLangOptions().SjLjExceptions) + if (CGM.getLangOpts().SjLjExceptions) return CGM.CreateRuntimeFunction(FTy, "_Unwind_SjLj_Resume_or_Rethrow"); return CGM.CreateRuntimeFunction(FTy, "_Unwind_Resume_or_Rethrow"); } @@ -123,9 +123,9 @@ static llvm::Constant *getTerminateFn(CodeGenFunction &CGF) { StringRef name; // In C++, use std::terminate(). - if (CGF.getLangOptions().CPlusPlus) + if (CGF.getLangOpts().CPlusPlus) name = "_ZSt9terminatev"; // FIXME: mangling! - else if (CGF.getLangOptions().ObjC1 && + else if (CGF.getLangOpts().ObjC1 && CGF.CGM.getCodeGenOpts().ObjCRuntimeHasTerminate) name = "objc_terminate"; else @@ -300,11 +300,11 @@ void CodeGenModule::SimplifyPersonality() { return; // If we're not in ObjC++ -fexceptions, there's nothing to do. - if (!Features.CPlusPlus || !Features.ObjC1 || !Features.Exceptions) + if (!LangOpts.CPlusPlus || !LangOpts.ObjC1 || !LangOpts.Exceptions) return; - const EHPersonality &ObjCXX = EHPersonality::get(Features); - const EHPersonality &CXX = getCXXPersonality(Features); + const EHPersonality &ObjCXX = EHPersonality::get(LangOpts); + const EHPersonality &CXX = getCXXPersonality(LangOpts); if (&ObjCXX == &CXX) return; @@ -470,7 +470,7 @@ void CodeGenFunction::EmitCXXThrowExpr(const CXXThrowExpr *E) { } void CodeGenFunction::EmitStartEHSpec(const Decl *D) { - if (!CGM.getLangOptions().CXXExceptions) + if (!CGM.getLangOpts().CXXExceptions) return; const FunctionDecl* FD = dyn_cast_or_null<FunctionDecl>(D); @@ -538,7 +538,7 @@ static void emitFilterDispatchBlock(CodeGenFunction &CGF, } void CodeGenFunction::EmitEndEHSpec(const Decl *D) { - if (!CGM.getLangOptions().CXXExceptions) + if (!CGM.getLangOpts().CXXExceptions) return; const FunctionDecl* FD = dyn_cast_or_null<FunctionDecl>(D); @@ -661,7 +661,7 @@ llvm::BasicBlock *CodeGenFunction::getInvokeDestImpl() { assert(EHStack.requiresLandingPad()); assert(!EHStack.empty()); - if (!CGM.getLangOptions().Exceptions) + if (!CGM.getLangOpts().Exceptions) return 0; // Check the innermost scope for a cached landing pad. If this is @@ -751,7 +751,7 @@ llvm::BasicBlock *CodeGenFunction::EmitLandingPad() { // Save the current IR generation state. CGBuilderTy::InsertPoint savedIP = Builder.saveAndClearIP(); - const EHPersonality &personality = EHPersonality::get(getLangOptions()); + const EHPersonality &personality = EHPersonality::get(getLangOpts()); // Create and configure the landing pad. llvm::BasicBlock *lpad = createBasicBlock("lpad"); @@ -1494,7 +1494,7 @@ llvm::BasicBlock *CodeGenFunction::getTerminateLandingPad() { Builder.SetInsertPoint(TerminateLandingPad); // Tell the backend that this is a landing pad. - const EHPersonality &Personality = EHPersonality::get(CGM.getLangOptions()); + const EHPersonality &Personality = EHPersonality::get(CGM.getLangOpts()); llvm::LandingPadInst *LPadInst = Builder.CreateLandingPad(llvm::StructType::get(Int8PtrTy, Int32Ty, NULL), getOpaquePersonalityFn(CGM, Personality), 0); @@ -1541,7 +1541,7 @@ llvm::BasicBlock *CodeGenFunction::getEHResumeBlock() { EHResumeBlock = createBasicBlock("eh.resume"); Builder.SetInsertPoint(EHResumeBlock); - const EHPersonality &Personality = EHPersonality::get(CGM.getLangOptions()); + const EHPersonality &Personality = EHPersonality::get(CGM.getLangOpts()); // This can always be a call because we necessarily didn't find // anything on the EH stack which needs our help. diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 80233b5d28..7b820f5732 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -225,7 +225,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 (CGF.getContext().getLangOptions().ObjCAutoRefCount && + if (CGF.getContext().getLangOpts().ObjCAutoRefCount && E->getType()->isObjCLifetimeType() && (E->getType().getObjCLifetime() == Qualifiers::OCL_Strong || E->getType().getObjCLifetime() == Qualifiers::OCL_Weak || @@ -1329,7 +1329,7 @@ void CodeGenFunction::EmitStoreThroughExtVectorComponentLValue(RValue Src, static void setObjCGCLValueClass(const ASTContext &Ctx, const Expr *E, LValue &LV, bool IsMemberAccess=false) { - if (Ctx.getLangOptions().getGC() == LangOptions::NonGC) + if (Ctx.getLangOpts().getGC() == LangOptions::NonGC) return; if (isa<ObjCIvarRefExpr>(E)) { @@ -1565,8 +1565,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().getLangOptions().ObjC1 && - getContext().getLangOptions().getGC() != LangOptions::NonGC && + if (getContext().getLangOpts().ObjC1 && + getContext().getLangOpts().getGC() != LangOptions::NonGC && LV.isObjCWeak()) LV.setNonGC(!E->isOBJCGCCandidate(getContext())); return LV; @@ -1766,7 +1766,7 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) { // GEP indexes are signed, and scaling an index isn't permitted to // signed-overflow, so we use the same semantics for our explicit // multiply. We suppress this if overflow is not undefined behavior. - if (getLangOptions().isSignedOverflowDefined()) { + if (getLangOpts().isSignedOverflowDefined()) { Idx = Builder.CreateMul(Idx, numElements); Address = Builder.CreateGEP(Address, Idx, "arrayidx"); } else { @@ -1801,14 +1801,14 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) { // Propagate the alignment from the array itself to the result. ArrayAlignment = ArrayLV.getAlignment(); - if (getContext().getLangOptions().isSignedOverflowDefined()) + if (getContext().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().getLangOptions().isSignedOverflowDefined()) + if (getContext().getLangOpts().isSignedOverflowDefined()) Address = Builder.CreateGEP(Base, Idx, "arrayidx"); else Address = Builder.CreateInBoundsGEP(Base, Idx, "arrayidx"); @@ -1831,8 +1831,8 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) { LV.getQuals().setAddressSpace(E->getBase()->getType().getAddressSpace()); - if (getContext().getLangOptions().ObjC1 && - getContext().getLangOptions().getGC() != LangOptions::NonGC) { + if (getContext().getLangOpts().ObjC1 && + getContext().getLangOpts().getGC() != LangOptions::NonGC) { LV.setNonGC(!E->isOBJCGCCandidate(getContext())); setObjCGCLValueClass(getContext(), E, LV); } @@ -2340,7 +2340,7 @@ RValue CodeGenFunction::EmitCallExpr(const CallExpr *E, if (const CXXPseudoDestructorExpr *PseudoDtor = dyn_cast<CXXPseudoDestructorExpr>(E->getCallee()->IgnoreParens())) { QualType DestroyedType = PseudoDtor->getDestroyedType(); - if (getContext().getLangOptions().ObjCAutoRefCount && + if (getContext().getLangOpts().ObjCAutoRefCount && DestroyedType->isObjCLifetimeType() && (DestroyedType.getObjCLifetime() == Qualifiers::OCL_Strong || DestroyedType.getObjCLifetime() == Qualifiers::OCL_Weak)) { diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index 3e8ae06f16..b6efc1cafa 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -85,7 +85,7 @@ public: QualType elementType, InitListExpr *E); AggValueSlot::NeedsGCBarriers_t needsGC(QualType T) { - if (CGF.getLangOptions().getGC() && TypeRequiresGCollection(T)) + if (CGF.getLangOpts().getGC() && TypeRequiresGCollection(T)) return AggValueSlot::NeedsGCBarriers; return AggValueSlot::DoesNotNeedGCBarriers; } @@ -254,7 +254,7 @@ void AggExprEmitter::EmitFinalDestCopy(const Expr *E, RValue Src, bool Ignore, // volatile. if (Dest.isIgnored()) { if (!Src.isVolatileQualified() || - CGF.CGM.getLangOptions().CPlusPlus || + CGF.CGM.getLangOpts().CPlusPlus || (IgnoreResult && Ignore)) return; @@ -1123,7 +1123,7 @@ static void CheckAggExprForMemSetUse(AggValueSlot &Slot, const Expr *E, if (Slot.isZeroed() || Slot.isVolatile() || Slot.getAddr() == 0) return; // C++ objects with a user-declared constructor don't need zero'ing. - if (CGF.getContext().getLangOptions().CPlusPlus) + if (CGF.getContext().getLangOpts().CPlusPlus) if (const RecordType *RT = CGF.getContext() .getBaseElementType(E->getType())->getAs<RecordType>()) { const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl()); @@ -1195,7 +1195,7 @@ void CodeGenFunction::EmitAggregateCopy(llvm::Value *DestPtr, bool isVolatile, unsigned Alignment) { assert(!Ty->isAnyComplexType() && "Shouldn't happen for complex"); - if (getContext().getLangOptions().CPlusPlus) { + if (getContext().getLangOpts().CPlusPlus) { if (const RecordType *RT = Ty->getAs<RecordType>()) { CXXRecordDecl *Record = cast<CXXRecordDecl>(RT->getDecl()); assert((Record->hasTrivialCopyConstructor() || @@ -1254,7 +1254,7 @@ void CodeGenFunction::EmitAggregateCopy(llvm::Value *DestPtr, SrcPtr = Builder.CreateBitCast(SrcPtr, SBP); // Don't do any of the memmove_collectable tests if GC isn't set. - if (CGM.getLangOptions().getGC() == LangOptions::NonGC) { + if (CGM.getLangOpts().getGC() == LangOptions::NonGC) { // fall through } else if (const RecordType *RecordTy = Ty->getAs<RecordType>()) { RecordDecl *Record = RecordTy->getDecl(); diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp index c0e3acf51b..d3ba770747 100644 --- a/lib/CodeGen/CGExprCXX.cpp +++ b/lib/CodeGen/CGExprCXX.cpp @@ -113,7 +113,7 @@ static bool canDevirtualizeMemberFunctionCalls(ASTContext &Context, // When building with -fapple-kext, all calls must go through the vtable since // the kernel linker can do runtime patching of vtables. - if (Context.getLangOptions().AppleKext) + if (Context.getLangOpts().AppleKext) return false; // If the most derived class is marked final, we know that no subclass can @@ -256,7 +256,7 @@ RValue CodeGenFunction::EmitCXXMemberCallExpr(const CXXMemberCallExpr *CE, if (UseVirtualCall) { Callee = BuildVirtualCall(Dtor, Dtor_Complete, This, Ty); } else { - if (getContext().getLangOptions().AppleKext && + if (getContext().getLangOpts().AppleKext && MD->isVirtual() && ME->hasQualifier()) Callee = BuildAppleKextVirtualCall(MD, ME->getQualifier(), Ty); @@ -269,7 +269,7 @@ RValue CodeGenFunction::EmitCXXMemberCallExpr(const CXXMemberCallExpr *CE, } else if (UseVirtualCall) { Callee = BuildVirtualCall(MD, This, Ty); } else { - if (getContext().getLangOptions().AppleKext && + if (getContext().getLangOpts().AppleKext && MD->isVirtual() && ME->hasQualifier()) Callee = BuildAppleKextVirtualCall(MD, ME->getQualifier(), Ty); @@ -427,7 +427,7 @@ CodeGenFunction::EmitCXXConstructExpr(const CXXConstructExpr *E, // Elide the constructor if we're constructing from a temporary. // The temporary check is required because Sema sets this on NRVO // returns. - if (getContext().getLangOptions().ElideConstructors && E->isElidable()) { + if (getContext().getLangOpts().ElideConstructors && E->isElidable()) { assert(getContext().hasSameUnqualifiedType(E->getType(), E->getArg(0)->getType())); if (E->getArg(0)->isTemporaryObjec |