diff options
Diffstat (limited to 'clang/lib/AST')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 22 | ||||
-rw-r--r-- | clang/lib/AST/ASTDiagnostic.cpp | 2 | ||||
-rw-r--r-- | clang/lib/AST/ASTImporter.cpp | 10 | ||||
-rw-r--r-- | clang/lib/AST/Decl.cpp | 44 | ||||
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 2 | ||||
-rw-r--r-- | clang/lib/AST/DeclCXX.cpp | 6 | ||||
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 2 | ||||
-rw-r--r-- | clang/lib/AST/Expr.cpp | 12 | ||||
-rw-r--r-- | clang/lib/AST/ExprClassification.cpp | 20 | ||||
-rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 18 | ||||
-rw-r--r-- | clang/lib/AST/ItaniumMangle.cpp | 4 | ||||
-rw-r--r-- | clang/lib/AST/MicrosoftMangle.cpp | 4 | ||||
-rw-r--r-- | clang/lib/AST/RecordLayoutBuilder.cpp | 12 | ||||
-rw-r--r-- | clang/lib/AST/StmtDumper.cpp | 4 | ||||
-rw-r--r-- | clang/lib/AST/StmtPrinter.cpp | 2 | ||||
-rw-r--r-- | clang/lib/AST/Type.cpp | 14 | ||||
-rw-r--r-- | clang/lib/AST/VTableBuilder.cpp | 4 |
17 files changed, 91 insertions, 91 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index ba3f503e3b0..b7e7850329f 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -328,14 +328,14 @@ void ASTContext::PrintStats() const { llvm::errs() << NumImplicitCopyConstructorsDeclared << "/" << NumImplicitCopyConstructors << " implicit copy constructors created\n"; - if (getLangOptions().CPlusPlus) + if (getLangOpts().CPlusPlus) llvm::errs() << NumImplicitMoveConstructorsDeclared << "/" << NumImplicitMoveConstructors << " implicit move constructors created\n"; llvm::errs() << NumImplicitCopyAssignmentOperatorsDeclared << "/" << NumImplicitCopyAssignmentOperators << " implicit copy assignment operators created\n"; - if (getLangOptions().CPlusPlus) + if (getLangOpts().CPlusPlus) llvm::errs() << NumImplicitMoveAssignmentOperatorsDeclared << "/" << NumImplicitMoveAssignmentOperators << " implicit move assignment operators created\n"; @@ -3190,7 +3190,7 @@ bool ASTContext::UnwrapSimilarPointerTypes(QualType &T1, QualType &T2) { return true; } - if (getLangOptions().ObjC1) { + if (getLangOpts().ObjC1) { const ObjCObjectPointerType *T1OPType = T1->getAs<ObjCObjectPointerType>(), *T2OPType = T2->getAs<ObjCObjectPointerType>(); if (T1OPType && T2OPType) { @@ -3769,7 +3769,7 @@ static RecordDecl * CreateRecordDecl(const ASTContext &Ctx, RecordDecl::TagKind TK, DeclContext *DC, IdentifierInfo *Id) { SourceLocation Loc; - if (Ctx.getLangOptions().CPlusPlus) + if (Ctx.getLangOpts().CPlusPlus) return CXXRecordDecl::Create(Ctx, TK, DC, Loc, Loc, Id); else return RecordDecl::Create(Ctx, TK, DC, Loc, Loc, Id); @@ -3904,7 +3904,7 @@ QualType ASTContext::getBlockDescriptorExtendedType() const { bool ASTContext::BlockRequiresCopying(QualType Ty) const { if (Ty->isObjCRetainableType()) return true; - if (getLangOptions().CPlusPlus) { + if (getLangOpts().CPlusPlus) { if (const RecordType *RT = Ty->getAs<RecordType>()) { CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl()); return RD->hasConstCopyConstructor(); @@ -4380,7 +4380,7 @@ static void EncodeBitField(const ASTContext *Ctx, std::string& S, // information is not especially sensible, but we're stuck with it for // compatibility with GCC, although providing it breaks anything that // actually uses runtime introspection and wants to work on both runtimes... - if (!Ctx->getLangOptions().NeXTRuntime) { + if (!Ctx->getLangOpts().NeXTRuntime) { const RecordDecl *RD = FD->getParent(); const ASTRecordLayout &RL = Ctx->getASTRecordLayout(RD); S += llvm::utostr(RL.getFieldOffset(FD->getFieldIndex())); @@ -5118,10 +5118,10 @@ CanQualType ASTContext::getFromTargetType(unsigned Type) const { /// garbage collection attribute. /// Qualifiers::GC ASTContext::getObjCGCAttrKind(QualType Ty) const { - if (getLangOptions().getGC() == LangOptions::NonGC) + if (getLangOpts().getGC() == LangOptions::NonGC) return Qualifiers::GCNone; - assert(getLangOptions().ObjC1); + assert(getLangOpts().ObjC1); Qualifiers::GC GCAttrs = Ty.getObjCGCAttr(); // Default behaviour under objective-C's gc is for ObjC pointers @@ -5615,7 +5615,7 @@ bool ASTContext::canBindObjCObjectType(QualType To, QualType From) { /// same. See 6.7.[2,3,5] for additional rules. bool ASTContext::typesAreCompatible(QualType LHS, QualType RHS, bool CompareUnqualified) { - if (getLangOptions().CPlusPlus) + if (getLangOpts().CPlusPlus) return hasSameType(LHS, RHS); return !mergeTypes(LHS, RHS, false, CompareUnqualified).isNull(); @@ -6568,7 +6568,7 @@ GVALinkage ASTContext::GetGVALinkageForFunction(const FunctionDecl *FD) { if (!FD->isInlined()) return External; - if (!getLangOptions().CPlusPlus || FD->hasAttr<GNUInlineAttr>()) { + if (!getLangOpts().CPlusPlus || FD->hasAttr<GNUInlineAttr>()) { // GNU or C99 inline semantics. Determine whether this symbol should be // externally visible. if (FD->isInlineDefinitionExternallyVisible()) @@ -6600,7 +6600,7 @@ GVALinkage ASTContext::GetGVALinkageForVariable(const VarDecl *VD) { TSK = VD->getTemplateSpecializationKind(); Linkage L = VD->getLinkage(); - if (L == ExternalLinkage && getLangOptions().CPlusPlus && + if (L == ExternalLinkage && getLangOpts().CPlusPlus && VD->getType()->getLinkage() == UniqueExternalLinkage) L = UniqueExternalLinkage; diff --git a/clang/lib/AST/ASTDiagnostic.cpp b/clang/lib/AST/ASTDiagnostic.cpp index 0923b5fafbe..ca4fe268522 100644 --- a/clang/lib/AST/ASTDiagnostic.cpp +++ b/clang/lib/AST/ASTDiagnostic.cpp @@ -294,7 +294,7 @@ void clang::FormatASTNodeDiagnosticArgument( if (DC->isTranslationUnit()) { // FIXME: Get these strings from some localized place - if (Context.getLangOptions().CPlusPlus) + if (Context.getLangOpts().CPlusPlus) S = "the global namespace"; else S = "the global scope"; diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index febfaabd740..621658c7f0a 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -1359,7 +1359,7 @@ QualType ASTNodeImporter::VisitBuiltinType(const BuiltinType *T) { // The context we're importing from has an unsigned 'char'. If we're // importing into a context with a signed 'char', translate to // 'unsigned char' instead. - if (Importer.getToContext().getLangOptions().CharIsSigned) + if (Importer.getToContext().getLangOpts().CharIsSigned) return Importer.getToContext().UnsignedCharTy; return Importer.getToContext().CharTy; @@ -1368,7 +1368,7 @@ QualType ASTNodeImporter::VisitBuiltinType(const BuiltinType *T) { // The context we're importing from has an unsigned 'char'. If we're // importing into a context with a signed 'char', translate to // 'unsigned char' instead. - if (!Importer.getToContext().getLangOptions().CharIsSigned) + if (!Importer.getToContext().getLangOpts().CharIsSigned) return Importer.getToContext().SignedCharTy; return Importer.getToContext().CharTy; @@ -2243,7 +2243,7 @@ Decl *ASTNodeImporter::VisitEnumDecl(EnumDecl *D) { if (!SearchName && D->getTypedefNameForAnonDecl()) { SearchName = Importer.Import(D->getTypedefNameForAnonDecl()->getDeclName()); IDNS = Decl::IDNS_Ordinary; - } else if (Importer.getToContext().getLangOptions().CPlusPlus) + } else if (Importer.getToContext().getLangOpts().CPlusPlus) IDNS |= Decl::IDNS_Ordinary; // We may already have an enum of the same name; try to find and match it. @@ -2328,7 +2328,7 @@ Decl *ASTNodeImporter::VisitRecordDecl(RecordDecl *D) { if (!SearchName && D->getTypedefNameForAnonDecl()) { SearchName = Importer.Import(D->getTypedefNameForAnonDecl()->getDeclName()); IDNS = Decl::IDNS_Ordinary; - } else if (Importer.getToContext().getLangOptions().CPlusPlus) + } else if (Importer.getToContext().getLangOpts().CPlusPlus) IDNS |= Decl::IDNS_Ordinary; // We may already have a record of the same name; try to find and match it. @@ -2485,7 +2485,7 @@ Decl *ASTNodeImporter::VisitFunctionDecl(FunctionDecl *D) { // Sema::IsOverload out to the AST library. // Function overloading is okay in C++. - if (Importer.getToContext().getLangOptions().CPlusPlus) + if (Importer.getToContext().getLangOpts().CPlusPlus) continue; // Complain about inconsistent function types. diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 0e2793490d9..b430fae3b1d 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -222,7 +222,7 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D, LVFlags F) { // and neither explicitly declared extern nor previously // declared to have external linkage; or // (there is no equivalent in C99) - if (Context.getLangOptions().CPlusPlus && + if (Context.getLangOpts().CPlusPlus && Var->getType().isConstant(Context) && Var->getStorageClass() != SC_Extern && Var->getStorageClass() != SC_PrivateExtern) { @@ -279,7 +279,7 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D, LVFlags F) { // scope and no storage-class specifier, its linkage is // external. LinkageInfo LV; - LV.mergeVisibility(Context.getLangOptions().getVisibilityMode()); + LV.mergeVisibility(Context.getLangOpts().getVisibilityMode()); if (F.ConsiderVisibilityAttributes) { if (llvm::Optional<Visibility> Vis = D->getExplicitVisibility()) { @@ -330,7 +330,7 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D, LVFlags F) { // // Note that we don't want to make the variable non-external // because of this, but unique-external linkage suits us. - if (Context.getLangOptions().CPlusPlus && + if (Context.getLangOpts().CPlusPlus && !Var->getDeclContext()->isExternCContext()) { LinkageInfo TypeLV = getLVForType(Var->getType()); if (TypeLV.linkage() != ExternalLinkage) @@ -342,7 +342,7 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D, LVFlags F) { if (Var->getStorageClass() == SC_PrivateExtern) LV.setVisibility(HiddenVisibility, true); - if (!Context.getLangOptions().CPlusPlus && + if (!Context.getLangOpts().CPlusPlus && (Var->getStorageClass() == SC_Extern || Var->getStorageClass() == SC_PrivateExtern)) { @@ -377,7 +377,7 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D, LVFlags F) { // storage-class specifier, its linkage is determined exactly // as if it were declared with the storage-class specifier // extern. - if (!Context.getLangOptions().CPlusPlus && + if (!Context.getLangOpts().CPlusPlus && (Function->getStorageClass() == SC_Extern || Function->getStorageClass() == SC_PrivateExtern || Function->getStorageClass() == SC_None)) { @@ -401,7 +401,7 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D, LVFlags F) { // unique-external linkage, it's not legally usable from outside // this translation unit. However, we should use the C linkage // rules instead for extern "C" declarations. - if (Context.getLangOptions().CPlusPlus && + if (Context.getLangOpts().CPlusPlus && !Function->getDeclContext()->isExternCContext() && Function->getType()->getLinkage() == UniqueExternalLinkage) return LinkageInfo::uniqueExternal(); @@ -447,7 +447,7 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D, LVFlags F) { // Consider -fvisibility unless the type has C linkage. if (F.ConsiderGlobalVisibility) F.ConsiderGlobalVisibility = - (Context.getLangOptions().CPlusPlus && + (Context.getLangOpts().CPlusPlus && !Tag->getDeclContext()->isExternCContext()); // - an enumerator belonging to an enumeration with external linkage; @@ -499,7 +499,7 @@ static LinkageInfo getLVForClassMember(const NamedDecl *D, LVFlags F) { return LinkageInfo::none(); LinkageInfo LV; - LV.mergeVisibility(D->getASTContext().getLangOptions().getVisibilityMode()); + LV.mergeVisibility(D->getASTContext().getLangOpts().getVisibilityMode()); // The flags we're going to use to compute the class's visibility. LVFlags ClassF = F; @@ -563,7 +563,7 @@ static LinkageInfo getLVForClassMember(const NamedDecl *D, LVFlags F) { if (TSK != TSK_ExplicitInstantiationDeclaration && TSK != TSK_ExplicitInstantiationDefinition && F.ConsiderGlobalVisibility && - MD->getASTContext().getLangOptions().InlineVisibilityHidden) { + MD->getASTContext().getLangOpts().InlineVisibilityHidden) { // InlineVisibilityHidden only applies to definitions, and // isInlined() only gives meaningful answers on definitions // anyway. @@ -845,7 +845,7 @@ static LinkageInfo getLVForDecl(const NamedDecl *D, LVFlags Flags) { } std::string NamedDecl::getQualifiedNameAsString() const { - return getQualifiedNameAsString(getASTContext().getLangOptions()); + return getQualifiedNameAsString(getASTContext().getLangOpts()); } std::string NamedDecl::getQualifiedNameAsString(const PrintingPolicy &P) const { @@ -1207,7 +1207,7 @@ bool VarDecl::isExternC() const { return false; ASTContext &Context = getASTContext(); - if (!Context.getLangOptions().CPlusPlus) + if (!Context.getLangOpts().CPlusPlus) return true; return DC->isExternCContext(); } @@ -1260,7 +1260,7 @@ VarDecl::DefinitionKind VarDecl::isThisDeclarationADefinition( // and without a storage class specifier or the scs 'static', constitutes // a tentative definition. // No such thing in C++. - if (!C.getLangOptions().CPlusPlus && isFileVarDecl()) + if (!C.getLangOpts().CPlusPlus && isFileVarDecl()) return TentativeDefinition; // What's left is (in C, block-scope) declarations without initializers or @@ -1373,7 +1373,7 @@ void VarDecl::setInit(Expr *I) { } bool VarDecl::isUsableInConstantExpressions(ASTContext &C) const { - const LangOptions &Lang = C.getLangOptions(); + const LangOptions &Lang = C.getLangOpts(); if (!Lang.CPlusPlus) return false; @@ -1452,7 +1452,7 @@ APValue *VarDecl::evaluateValue( // In C++11, we have determined whether the initializer was a constant // expression as a side-effect. - if (getASTContext().getLangOptions().CPlusPlus0x && !Eval->CheckedICE) { + if (getASTContext().getLangOpts().CPlusPlus0x && !Eval->CheckedICE) { Eval->CheckedICE = true; Eval->IsICE = Result && Notes.empty(); } @@ -1476,7 +1476,7 @@ bool VarDecl::checkInitIsICE() const { // In C++11, evaluate the initializer to check whether it's a constant // expression. - if (getASTContext().getLangOptions().CPlusPlus0x) { + if (getASTContext().getLangOpts().CPlusPlus0x) { llvm::SmallVector<PartialDiagnosticAt, 8> Notes; evaluateValue(Notes); return Eval->IsICE; @@ -1693,7 +1693,7 @@ bool FunctionDecl::isMain() const { const TranslationUnitDecl *tunit = dyn_cast<TranslationUnitDecl>(getDeclContext()->getRedeclContext()); return tunit && - !tunit->getASTContext().getLangOptions().Freestanding && + !tunit->getASTContext().getLangOpts().Freestanding && getIdentifier() && getIdentifier()->isStr("main"); } @@ -1732,7 +1732,7 @@ bool FunctionDecl::isExternC() const { return false; ASTContext &Context = getASTContext(); - if (!Context.getLangOptions().CPlusPlus) + if (!Context.getLangOpts().CPlusPlus) return true; return isMain() || DC->isExternCContext(); @@ -1820,7 +1820,7 @@ unsigned FunctionDecl::getBuiltinID() const { // If this function is at translation-unit scope and we're not in // C++, it refers to the C library function. - if (!Context.getLangOptions().CPlusPlus && + if (!Context.getLangOpts().CPlusPlus && getDeclContext()->isTranslationUnit()) return BuiltinID; @@ -1875,7 +1875,7 @@ void FunctionDecl::setDeclsInPrototypeScope(llvm::ArrayRef<NamedDecl *> NewDecls /// function parameters, if some of the parameters have default /// arguments (in C++) or the last parameter is a parameter pack. unsigned FunctionDecl::getMinRequiredArguments() const { - if (!getASTContext().getLangOptions().CPlusPlus) + if (!getASTContext().getLangOpts().CPlusPlus) return getNumParams(); unsigned NumRequiredArgs = getNumParams(); @@ -1965,7 +1965,7 @@ bool FunctionDecl::doesDeclarationForceExternallyVisibleDefinition() const { ASTContext &Context = getASTContext(); - if (Context.getLangOptions().GNUInline || hasAttr<GNUInlineAttr>()) { + if (Context.getLangOpts().GNUInline || hasAttr<GNUInlineAttr>()) { // With GNU inlining, a declaration with 'inline' but not 'extern', forces // an externally visible definition. // @@ -1993,7 +1993,7 @@ bool FunctionDecl::doesDeclarationForceExternallyVisibleDefinition() const { return FoundBody; } - if (Context.getLangOptions().CPlusPlus) + if (Context.getLangOpts().CPlusPlus) return false; // C99 6.7.4p6: @@ -2034,7 +2034,7 @@ bool FunctionDecl::isInlineDefinitionExternallyVisible() const { assert(isInlined() && "Function must be inline"); ASTContext &Context = getASTContext(); - if (Context.getLangOptions().GNUInline || hasAttr<GNUInlineAttr>()) { + if (Context.getLangOpts().GNUInline || hasAttr<GNUInlineAttr>()) { // Note: If you change the logic here, please change // doesDeclarationForceExternallyVisibleDefinition as well. // diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 2e192657daa..baba97d8151 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -423,7 +423,7 @@ bool Decl::canBeWeakImported(bool &IsDefinition) const { } } else if (isa<ObjCPropertyDecl>(this) || isa<ObjCMethodDecl>(this)) return false; - else if (!(getASTContext().getLangOptions().ObjCNonFragileABI && + else if (!(getASTContext().getLangOpts().ObjCNonFragileABI && isa<ObjCInterfaceDecl>(this))) return false; diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index 33d31308485..114322b1a8a 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -636,7 +636,7 @@ NotASpecialMember:; // C++0x [dcl.init.aggr]p1: // An aggregate is an array or a class with no user-provided // constructors [...]. - if (!getASTContext().getLangOptions().CPlusPlus0x || UserProvided) + if (!getASTContext().getLangOpts().CPlusPlus0x || UserProvided) data().Aggregate = false; // C++ [class]p4: @@ -798,7 +798,7 @@ NotASpecialMember:; ASTContext &Context = getASTContext(); QualType T = Context.getBaseElementType(Field->getType()); if (T->isObjCRetainableType() || T.isObjCGCStrong()) { - if (!Context.getLangOptions().ObjCAutoRefCount || + if (!Context.getLangOpts().ObjCAutoRefCount || T.getObjCLifetime() != Qualifiers::OCL_ExplicitNone) setHasObjectMember(true); } else if (!T.isPODType(Context)) @@ -1243,7 +1243,7 @@ void CXXRecordDecl::completeDefinition() { void CXXRecordDecl::completeDefinition(CXXFinalOverriderMap *FinalOverriders) { RecordDecl::completeDefinition(); - if (hasObjectMember() && getASTContext().getLangOptions().ObjCAutoRefCount) { + if (hasObjectMember() && getASTContext().getLangOpts().ObjCAutoRefCount) { // Objective-C Automatic Reference Counting: // If a class has a non-static data member of Objective-C pointer // type (or array thereof), it is a non-POD type and its diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index 7822eb217fe..3d1fc846600 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -628,7 +628,7 @@ void ObjCMethodDecl::createImplicitParams(ASTContext &Context, bool selfIsPseudoStrong = false; bool selfIsConsumed = false; - if (Context.getLangOptions().ObjCAutoRefCount) { + if (Context.getLangOpts().ObjCAutoRefCount) { if (isInstanceMethod()) { selfIsConsumed = hasAttr<NSConsumesSelfAttr>(); diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 6722e2f21c7..e2fc120b8ab 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -193,7 +193,7 @@ static void computeDeclRefDependence(ASTContext &Ctx, NamedDecl *D, QualType T, // - an entity with reference type and is initialized with an // expression that is value-dependent [C++11] if (VarDecl *Var = dyn_cast<VarDecl>(D)) { - if ((Ctx.getLangOptions().CPlusPlus0x ? + if ((Ctx.getLangOpts().CPlusPlus0x ? Var->getType()->isLiteralType() : Var->getType()->isIntegralOrEnumerationType()) && (Var->getType().getCVRQualifiers() == Qualifiers::Const || @@ -398,7 +398,7 @@ std::string PredefinedExpr::ComputeName(IdentType IT, const Decl *CurrentDecl) { Out << "static "; } - PrintingPolicy Policy(Context.getLangOptions()); + PrintingPolicy Policy(Context.getLangOpts()); std::string Proto = FD->getQualifiedNameAsString(Policy); @@ -1750,7 +1750,7 @@ bool Expr::isUnusedResultAWarning(SourceLocation &Loc, SourceRange &R1, case ObjCMessageExprClass: { const ObjCMessageExpr *ME = cast<ObjCMessageExpr>(this); - if (Ctx.getLangOptions().ObjCAutoRefCount && + if (Ctx.getLangOpts().ObjCAutoRefCount && ME->isInstanceMessage() && !ME->getType()->isVoidType() && ME->getSelector().getIdentifierInfoForSlot(0) && @@ -2780,7 +2780,7 @@ Expr::isNullPointerConstant(ASTContext &Ctx, // Strip off a cast to void*, if it exists. Except in C++. if (const ExplicitCastExpr *CE = dyn_cast<ExplicitCastExpr>(this)) { - if (!Ctx.getLangOptions().CPlusPlus) { + if (!Ctx.getLangOpts().CPlusPlus) { // Check that it is a cast to void*. if (const PointerType *PT = CE->getType()->getAs<PointerType>()) { QualType Pointee = PT->getPointeeType(); @@ -2828,14 +2828,14 @@ Expr::isNullPointerConstant(ASTContext &Ctx, } // This expression must be an integer type. if (!getType()->isIntegerType() || - (Ctx.getLangOptions().CPlusPlus && getType()->isEnumeralType())) + (Ctx.getLangOpts().CPlusPlus && getType()->isEnumeralType())) return NPCK_NotNull; // If we have an integer constant expression, we need to *evaluate* it and // test for the value 0. Don't use the C++11 constant expression semantics // for this, for now; once the dust settles on core issue 903, we might only // allow a literal 0 here in C++11 mode. - if (Ctx.getLangOptions().CPlusPlus0x) { + if (Ctx.getLangOpts().CPlusPlus0x) { if (!isCXX98IntegralConstantExpr(Ctx)) return NPCK_NotNull; } else { diff --git a/clang/lib/AST/ExprClassification.cpp b/clang/lib/AST/ExprClassification.cpp index 7c402c98e41..3261eb6974d 100644 --- a/clang/lib/AST/ExprClassification.cpp +++ b/clang/lib/AST/ExprClassification.cpp @@ -55,7 +55,7 @@ Cl Expr::ClassifyImpl(ASTContext &Ctx, SourceLocation *Loc) const { Cl::Kinds kind = ClassifyInternal(Ctx, this); // C99 6.3.2.1: An lvalue is an expression with an object type or an // incomplete type other than void. - if (!Ctx.getLangOptions().CPlusPlus) { + if (!Ctx.getLangOpts().CPlusPlus) { // Thus, no functions. if (TR->isFunctionType() || TR == Ctx.OverloadTy) kind = Cl::CL_Function; @@ -89,7 +89,7 @@ Cl Expr::ClassifyImpl(ASTContext &Ctx, SourceLocation *Loc) const { static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) { // This function takes the first stab at classifying expressions. - const LangOptions &Lang = Ctx.getLangOptions(); + const LangOptions &Lang = Ctx.getLangOpts(); switch (E->getStmtClass()) { case Stmt::NoStmtClass: @@ -126,7 +126,7 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) { // C99 6.5.2.5p5 says that compound literals are lvalues. // In C++, they're class temporaries. case Expr::CompoundLiteralExprClass: - return Ctx.getLangOptions().CPlusPlus? Cl::CL_ClassTemporary + return Ctx.getLangOpts().CPlusPlus? Cl::CL_ClassTemporary : Cl::CL_LValue; // Expressions that are prvalues. @@ -396,7 +396,7 @@ static Cl::Kinds ClassifyDecl(ASTContext &Ctx, const Decl *D) { else islvalue = isa<VarDecl>(D) || isa<FieldDecl>(D) || isa<IndirectFieldDecl>(D) || - (Ctx.getLangOptions().CPlusPlus && + (Ctx.getLangOpts().CPlusPlus && (isa<FunctionDecl>(D) || isa<FunctionTemplateDecl>(D))); return islvalue ? Cl::CL_LValue : Cl::CL_PRValue; @@ -407,7 +407,7 @@ static Cl::Kinds ClassifyDecl(ASTContext &Ctx, const Decl *D) { /// calls and casts. static Cl::Kinds ClassifyUnnamed(ASTContext &Ctx, QualType T) { // In C, function calls are always rvalues. - if (!Ctx.getLangOptions().CPlusPlus) return Cl::CL_PRValue; + if (!Ctx.getLangOpts().CPlusPlus) return Cl::CL_PRValue; // C++ [expr.call]p10: A function call is an lvalue if the result type is an // lvalue reference type or an rvalue reference to function type, an xvalue @@ -428,7 +428,7 @@ static Cl::Kinds ClassifyMemberExpr(ASTContext &Ctx, const MemberExpr *E) { ? Cl::CL_PRValue : Cl::CL_LValue); // Handle C first, it's easier. - if (!Ctx.getLangOptions().CPlusPlus) { + if (!Ctx.getLangOpts().CPlusPlus) { // C99 6.5.2.3p3 // For dot access, the expression is an lvalue if the first part is. For // arrow access, it always is an lvalue. @@ -480,7 +480,7 @@ static Cl::Kinds ClassifyMemberExpr(ASTContext &Ctx, const MemberExpr *E) { } static Cl::Kinds ClassifyBinaryOp(ASTContext &Ctx, const BinaryOperator *E) { - assert(Ctx.getLangOptions().CPlusPlus && + assert(Ctx.getLangOpts().CPlusPlus && "This is only relevant for C++."); // C++ [expr.ass]p1: All [...] return an lvalue referring to the left operand. // Except we override this for writes to ObjC properties. @@ -516,7 +516,7 @@ static Cl::Kinds ClassifyBinaryOp(ASTContext &Ctx, const BinaryOperator *E) { static Cl::Kinds ClassifyConditional(ASTContext &Ctx, const Expr *True, const Expr *False) { - assert(Ctx.getLangOptions().CPlusPlus && + assert(Ctx.getLangOpts().CPlusPlus && "This is only relevant for C++."); // C++ [expr.cond]p2 @@ -555,7 +555,7 @@ static Cl::ModifiableType IsModifiable(ASTContext &Ctx, const Expr *E, // This is the lvalue case. // Functions are lvalues in C++, but not modifiable. (C++ [basic.lval]p6) - if (Ctx.getLangOptions().CPlusPlus && E->getType()->isFunctionType()) + if (Ctx.getLangOpts().CPlusPlus && E->getType()->isFunctionType()) return Cl::CM_Function; // You cannot assign to a variable outside a block from within the block if @@ -591,7 +591,7 @@ static Cl::ModifiableType IsModifiable(ASTContext &Ctx, const Expr *E, // Records with any const fields (recursively) are not modifiable. if (const RecordType *R = CT->getAs<RecordType>()) { assert((E->getObjectKind() == OK_ObjCProperty || - !Ctx.getLangOptions().CPlusPlus) && + !Ctx.getLangOpts().CPlusPlus) && "C++ struct assignment should be resolved by the " "copy assignment operator."); if (R->hasConstFields()) diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 2d921467f77..4531a464480 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -412,7 +412,7 @@ namespace { EvaluatingDeclValue = &Value; } - const LangOptions &getLangOpts() const { return Ctx.getLangOptions(); } + const LangOptions &getLangOpts() const { return Ctx.getLangOpts(); } bool CheckCallLimit(SourceLocation Loc) { // Don't perform any constexpr calls (other than the call we're checking) @@ -6057,7 +6057,7 @@ bool Expr::EvaluateAsRValue(EvalResult &Result, const ASTContext &Ctx) const { // FIXME: Evaluating values of large array and record types can cause // performance problems. Only do so in C++11 for now. if (isRValue() && (getType()->isArrayType() || getType()->isRecordType()) && - !Ctx.getLangOptions().CPlusPlus0x) + !Ctx.getLangOpts().CPlusPlus0x) return false; EvalInfo Info(Ctx, Result); @@ -6104,7 +6104,7 @@ bool Expr::EvaluateAsInitializer(APValue &Value, const ASTContext &Ctx, // FIXME: Evaluating initializers for large array and record types can cause // performance problems. Only do so in C++11 for now. if (isRValue() && (getType()->isArrayType() || getType()->isRecordType()) && - !Ctx.getLangOptions().CPlusPlus0x) + !Ctx.getLangOpts().CPlusPlus0x) return false; Expr::EvalStatus EStatus; @@ -6120,7 +6120,7 @@ bool Expr::EvaluateAsInitializer(APValue &Value, const ASTContext &Ctx, // Variables with static storage duration or thread storage duration shall be // zero-initialized before any other initialization takes place. // This behavior is not present in C. - if (Ctx.getLangOptions().CPlusPlus && !VD->hasLocalStorage() && + if (Ctx.getLangOpts().CPlusPlus && !VD->hasLocalStorage() && !VD->getType()->isReferenceType()) { ImplicitValueInitExpr VIE(VD->getType()); if (!EvaluateInPlace(Value, InitInfo, LVal, &VIE, CCEK_Constant, @@ -6325,7 +6325,7 @@ static ICEDiag CheckICE(const Expr* E, ASTContext &Ctx) { if (isa<EnumConstantDecl>(cast<DeclRefExpr>(E)->getDecl())) return NoDiag(); const ValueDecl *D = dyn_cast<ValueDecl>(cast<DeclRefExpr>(E)->getDecl()); - if (Ctx.getLangOptions().CPlusPlus && + if (Ctx.getLangOpts().CPlusPlus && D && IsConstNonVolatile(D->getType())) { // Parameter variables are never constants. Without this check, // getAnyInitializer() can find a default argument, which leads @@ -6448,7 +6448,7 @@ static ICEDiag CheckICE(const Expr* E, ASTContext &Ctx) { } } if (Exp->getOpcode() == BO_Comma) { - if (Ctx.getLangOptions().C99) { + if (Ctx.getLangOpts().C99) { // C99 6.6p3 introduces a strange edge case: comma can be in an ICE // if it isn't evaluated. if (LHSResult.Val == 0 && RHSResult.Val == 0) @@ -6593,7 +6593,7 @@ static bool EvaluateCPlusPlus11IntegralConstantExpr(ASTContext &Ctx, } bool Expr::isIntegerConstantExpr(ASTContext &Ctx, SourceLocation *Loc) const { - if (Ctx.getLangOptions().CPlusPlus0x) + if (Ctx.getLangOpts().CPlusPlus0x) return EvaluateCPlusPlus11IntegralConstantExpr(Ctx, this, 0, Loc); ICEDiag d = CheckICE(this, Ctx); @@ -6606,7 +6606,7 @@ bool Expr::isIntegerConstantExpr(ASTContext &Ctx, SourceLocation *Loc) const { bool Expr::isIntegerConstantExpr(llvm::APSInt &Value, ASTContext &Ctx, SourceLocation *Loc, bool isEvaluated) const { - if (Ctx.getLangOptions().CPlusPlus0x) + if (Ctx.getLangOpts().CPlusPlus0x) return EvaluateCPlusPlus11IntegralConstantExpr(Ctx, this, &Value, Loc); if (!isIntegerConstantExpr(Ctx, Loc)) @@ -6624,7 +6624,7 @@ bool Expr::isCXX11ConstantExpr(ASTContext &Ctx, APValue *Result, SourceLocation *Loc) const { // We support this checking in C++98 mode in order to diagnose compatibility // issues. - assert(Ctx.getLangOptions().CPlusPlus); + assert(Ctx.getLangOpts().CPlusPlus); // Build evaluation settings. Expr::EvalStatus Status; diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp index fa782277789..a4676a6c396 100644 --- a/clang/lib/AST/ItaniumMangle.cpp +++ b/clang/lib/AST/ItaniumMangle.cpp @@ -375,7 +375,7 @@ static bool isInCLinkageSpecification(const Decl *D) { bool ItaniumMangleContext::shouldMangleDeclName(const NamedDecl *D) { // In C, functions with no attributes never need to be mangled. Fastpath them. - if (!getASTContext().getLangOptions().CPlusPlus && !D->hasAttrs()) + if (!getASTContext().getLangOpts().CPlusPlus && !D->hasAttrs()) return false; // Any decl can be declared with __asm("foo") on it, and this takes precedence @@ -392,7 +392,7 @@ bool ItaniumMangleContext::shouldMangleDeclName(const NamedDecl *D) { return true; // Otherwise, no mangling is done outside C++ mode. - if (!getASTContext().getLangOptions().CPlusPlus) + if (!getASTContext().getLangOpts().CPlusPlus) return false; // Variables at global scope with non-internal linkage are not mangled diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp index 42e6c9322db..ba9856a8432 100644 --- a/clang/lib/AST/MicrosoftMangle.cpp +++ b/clang/lib/AST/MicrosoftMangle.cpp @@ -119,7 +119,7 @@ static bool isInCLinkageSpecification(const Decl *D) { bool MicrosoftMangleContext::shouldMangleDeclName(const NamedDecl *D) { // In C, functions with no attributes never need to be mangled. Fastpath them. - if (!getASTContext().getLangOptions().CPlusPlus && !D->hasAttrs()) + if (!getASTContext().getLangOpts().CPlusPlus && !D->hasAttrs()) return false; // Any decl can be declared with __asm("foo") on it, and this takes precedence @@ -136,7 +136,7 @@ bool MicrosoftMangleContext::shouldMangleDeclName(const NamedDecl *D) { return true; // Otherwise, no mangling is done outside C++ mode. - if (!getASTContext().getLangOptions().CPlusPlus) + if (!getASTContext().getLangOpts().CPlusPlus) return false; // Variables at global scope with internal linkage are not mangled. diff --git a/clang/lib/AST/RecordLayoutBuilder.cpp b/clang/lib/AST/RecordLayoutBuilder.cpp index 7c4f7f2622e..f73287503ef 100644 --- a/clang/lib/AST/RecordLayoutBuilder.cpp +++ b/clang/lib/AST/RecordLayoutBuilder.cpp @@ -1396,7 +1396,7 @@ void RecordLayoutBuilder::InitializeLayout(const Decl *D) { IsMsStruct = D->hasAttr<MsStructAttr>(); // Honor the default struct packing maximum alignment flag. - if (unsigned DefaultMaxFieldAlignment = Context.getLangOptions().PackStruct) { + if (unsigned DefaultMaxFieldAlignment = Context.getLangOpts().PackStruct) { MaxFieldAlignment = CharUnits::fromQuantity(DefaultMaxFieldAlignment); } @@ -1658,7 +1658,7 @@ void RecordLayoutBuilder::LayoutWideBitField(uint64_t FieldSize, uint64_t TypeSize, bool FieldPacked, const FieldDecl *D) { - assert(Context.getLangOptions().CPlusPlus && + assert(Context.getLangOpts().CPlusPlus && "Can only have wide bit-fields in C++!"); // Itanium C++ ABI 2.4: @@ -1900,7 +1900,7 @@ void RecordLayoutBuilder::LayoutField(const FieldDecl *D) { ZeroLengthBitfield = 0; } - if (Context.getLangOptions().MSBitfields || IsMsStruct) { + if (Context.getLangOpts().MSBitfields || IsMsStruct) { // If MS bitfield layout is required, figure out what type is being // laid out and align the field to the width of that type. @@ -1987,7 +1987,7 @@ void RecordLayoutBuilder::FinishLayout(const NamedDecl *D) { } // In C++, records cannot be of size 0. - if (Context.getLangOptions().CPlusPlus && getSizeInBits() == 0) { + if (Context.getLangOpts().CPlusPlus && getSizeInBits() == 0) { if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(D)) { // Compatibility with gcc requires a class (pod or non-pod) // which is not empty but of size 0; such as having fields of @@ -2263,9 +2263,9 @@ ASTContext::getASTRecordLayout(const RecordDecl *D) const { ASTRecordLayouts[D] = NewEntry; - if (getLangOptions().DumpRecordLayouts) { + if (getLangOpts().DumpRecordLayouts) { llvm::errs() << "\n*** Dumping AST Record Layout\n"; - DumpRecordLayout(D, llvm::errs(), getLangOptions().DumpRecordLayoutsSimple); + DumpRecordLayout(D, llvm::errs(), getLangOpts().DumpRecordLayoutsSimple); } return *NewEntry; diff --git a/clang/lib/AST/StmtDumper.cpp b/clang/lib/AST/StmtDumper.cpp index acacf943fdb..aea4c395d5c 100644 --- a/clang/lib/AST/StmtDumper.cpp +++ b/clang/lib/AST/StmtDumper.cpp @@ -254,7 +254,7 @@ void StmtDumper::DumpDeclarator(Decl *D) { std::string Name = VD->getNameAsString(); VD->getType().getAsStringInternal(Name, - PrintingPolicy(VD->getASTContext().getLangOptions())); + PrintingPolicy(VD->getASTContext().getLangOpts())); OS << Name; // If this is a vardecl with an initializer, emit it. @@ -287,7 +287,7 @@ void StmtDumper::DumpDeclarator(Decl *D) { const char *tn = UD->isTypeName() ? "typename " : ""; OS << '"' << UD->getDeclKindName() << tn; UD->getQualifier()->print(OS, - PrintingPolicy(UD->getASTContext().getLangOptions())); + PrintingPolicy(UD->getASTContext().getLangOpts())); OS << ";\""; } else if (LabelDecl *LD = dyn_cast<LabelDecl>(D)) { OS << "label " << *LD; diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index 1fe4a792dab..7ebc1299f07 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -1833,7 +1833,7 @@ void StmtPrinter::VisitAsTypeExpr(AsTypeExpr *Node) { void Stmt::dumpPretty(ASTContext& Context) const { printPretty(llvm::errs(), Context, 0, - PrintingPolicy(Context.getLangOptions())); + PrintingPolicy(Context.getLangOpts())); } void Stmt::printPretty(raw_ostream &OS, ASTContext& Context, diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp index d9fecd449f3..c61f34f254d 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -580,7 +580,7 @@ bool Type::isIntegralType(ASTContext &Ctx) const { return BT->getKind() >= BuiltinType::Bool && BT->getKind() <= BuiltinType::Int128; - if (!Ctx.getLangOptions().CPlusPlus) + if (!Ctx.getLangOpts().CPlusPlus) if (const EnumType *ET = dyn_cast<EnumType>(CanonicalType)) return ET->getDecl()->isComplete(); // Complete enum types are integral in C. @@ -907,7 +907,7 @@ bool QualType::isPODType(ASTContext &Context) const { if ((*this)->isIncompleteType()) return false; - if (Context.getLangOptions().ObjCAutoRefCount) { + if (Context.getLangOpts().ObjCAutoRefCount) { switch (getObjCLifetime()) { case Qualifiers::OCL_ExplicitNone: return true; @@ -969,7 +969,7 @@ bool QualType::isTrivialType(ASTContext &Context) const { if ((*this)->isIncompleteType()) return false; - if (Context.getLangOptions().ObjCAutoRefCount) { + if (Context.getLangOpts().ObjCAutoRefCount) { switch (getObjCLifetime()) { case Qualifiers::OCL_ExplicitNone: return true; @@ -1019,7 +1019,7 @@ bool QualType::isTriviallyCopyableType(ASTContext &Context) const { if ((*this)->isArrayType()) return Context.getBaseElementType(*this).isTrivialType(Context); - if (Context.getLangOptions().ObjCAutoRefCount) { + if (Context.getLangOpts().ObjCAutoRefCount) { switch (getObjCLifetime()) { case Qualifiers::OCL_ExplicitNone: return true; @@ -1164,7 +1164,7 @@ bool QualType::isCXX11PODType(ASTContext &Context) const { if (ty->isDependentType()) return false; - if (Context.getLangOptions().ObjCAutoRefCount) { + if (Context.getLangOpts().ObjCAutoRefCount) { switch (getObjCLifetime()) { case Qualifiers::OCL_ExplicitNone: return true; @@ -1467,7 +1467,7 @@ QualType QualType::getNonLValueExprType(ASTContext &Context) const { // have cv-unqualified types. // // See also C99 6.3.2.1p2. - if (!Context.getLangOptions().CPlusPlus || + if (!Context.getLangOpts().CPlusPlus || (!getTypePtr()->isDependentType() && !getTypePtr()->isRecordType())) return getUnqualifiedType(); @@ -2234,7 +2234,7 @@ bool QualType::hasTrivialAssignment(ASTContext &Context, bool Copying) const { case Qualifiers::OCL_Autoreleasing: case Qualifiers::OCL_Strong: case Qualifiers::OCL_Weak: - return !Context.getLangOptions().ObjCAutoRefCount; + return !Context.getLangOpts().ObjCAutoRefCount; } if (const CXXRecordDecl *Record diff --git a/clang/lib/AST/VTableBuilder.cpp b/clang/lib/AST/VTableBuilder.cpp index 67924ebf827..35f84ff4834 100644 --- a/clang/lib/AST/VTableBuilder.cpp +++ b/clang/lib/AST/VTableBuilder.cpp @@ -996,7 +996,7 @@ public: LayoutVTable(); - if (Context.getLangOptions().DumpVTableLayouts) + if (Context.getLangOpts().DumpVTableLayouts) dumpLayout(llvm::errs()); } @@ -1580,7 +1580,7 @@ void VTableBuilder::LayoutVTable() { LayoutVTablesForVirtualBases(MostDerivedClass, VBases); // -fapple-kext adds an extra entry at end of vtbl. - bool IsAppleKext = Context.getLangOptions().AppleKext; + bool IsAppleKext = Context.getLangOpts().AppleKext; if (IsAppleKext) Components.push_back(VTableComponent::MakeVCallOffset(CharUnits::Zero())); } |