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
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index ba3f503..b7e7850 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -328,14 +328,14 @@
   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 @@
     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 @@
 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 @@
 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 @@
   // 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 @@
 /// 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 @@
 /// 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 @@
   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 @@
     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/lib/AST/ASTDiagnostic.cpp b/lib/AST/ASTDiagnostic.cpp
index 0923b5f..ca4fe26 100644
--- a/lib/AST/ASTDiagnostic.cpp
+++ b/lib/AST/ASTDiagnostic.cpp
@@ -294,7 +294,7 @@
       
       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/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp
index febfaab..621658c 100644
--- a/lib/AST/ASTImporter.cpp
+++ b/lib/AST/ASTImporter.cpp
@@ -1359,7 +1359,7 @@
     // 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 @@
     // 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 @@
   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 @@
   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 @@
           // 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/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 0e27934..b430fae 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -222,7 +222,7 @@
     //   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 @@
   //   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 @@
     //
     // 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 @@
     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 @@
     //   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 @@
     // 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 @@
     // 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 @@
     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 @@
     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 @@
 }
 
 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 @@
     return false;
 
   ASTContext &Context = getASTContext();
-  if (!Context.getLangOptions().CPlusPlus)
+  if (!Context.getLangOpts().CPlusPlus)
     return true;
   return DC->isExternCContext();
 }
@@ -1260,7 +1260,7 @@
   //   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 @@
 }
 
 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 @@
 
   // 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 @@
 
   // 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 @@
   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 @@
     return false;
 
   ASTContext &Context = getASTContext();
-  if (!Context.getLangOptions().CPlusPlus)
+  if (!Context.getLangOpts().CPlusPlus)
     return true;
 
   return isMain() || DC->isExternCContext();
@@ -1820,7 +1820,7 @@
 
   // 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 @@
 /// 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 @@
 
   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 @@
     return FoundBody;
   }
 
-  if (Context.getLangOptions().CPlusPlus)
+  if (Context.getLangOpts().CPlusPlus)
     return false;
 
   // C99 6.7.4p6:
@@ -2034,7 +2034,7 @@
   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/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp
index 2e19265..baba97d 100644
--- a/lib/AST/DeclBase.cpp
+++ b/lib/AST/DeclBase.cpp
@@ -423,7 +423,7 @@
     }
   } 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/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp
index 33d3130..114322b 100644
--- a/lib/AST/DeclCXX.cpp
+++ b/lib/AST/DeclCXX.cpp
@@ -636,7 +636,7 @@
     // 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 @@
     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(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/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index 7822eb2..3d1fc84 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -628,7 +628,7 @@
   bool selfIsPseudoStrong = false;
   bool selfIsConsumed = false;
   
-  if (Context.getLangOptions().ObjCAutoRefCount) {
+  if (Context.getLangOpts().ObjCAutoRefCount) {
     if (isInstanceMethod()) {
       selfIsConsumed = hasAttr<NSConsumesSelfAttr>();
 
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp
index 6722e2f..e2fc120 100644
--- a/lib/AST/Expr.cpp
+++ b/lib/AST/Expr.cpp
@@ -193,7 +193,7 @@
   //       -  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 @@
         Out << "static ";
     }
 
-    PrintingPolicy Policy(Context.getLangOptions());
+    PrintingPolicy Policy(Context.getLangOpts());
 
     std::string Proto = FD->getQualifiedNameAsString(Policy);
 
@@ -1750,7 +1750,7 @@
 
   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 @@
 
   // 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 @@
       }
   // 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/lib/AST/ExprClassification.cpp b/lib/AST/ExprClassification.cpp
index 7c402c9..3261eb6 100644
--- a/lib/AST/ExprClassification.cpp
+++ b/lib/AST/ExprClassification.cpp
@@ -55,7 +55,7 @@
   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 @@
 
 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 @@
     // 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 @@
   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 @@
 /// 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 @@
               ? 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 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 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 @@
 
   // 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 @@
   // 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/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 2d92146..4531a46 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -412,7 +412,7 @@
       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 @@
   // 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 @@
   // 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 @@
   //  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 @@
     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 @@
         }
       }
       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 @@
 }
 
 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(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 @@
                                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/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp
index fa78227..a4676a6 100644
--- a/lib/AST/ItaniumMangle.cpp
+++ b/lib/AST/ItaniumMangle.cpp
@@ -375,7 +375,7 @@
 
 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 @@
     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/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp
index 42e6c93..ba9856a 100644
--- a/lib/AST/MicrosoftMangle.cpp
+++ b/lib/AST/MicrosoftMangle.cpp
@@ -119,7 +119,7 @@
 
 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 @@
     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/lib/AST/RecordLayoutBuilder.cpp b/lib/AST/RecordLayoutBuilder.cpp
index 7c4f7f2..f732875 100644
--- a/lib/AST/RecordLayoutBuilder.cpp
+++ b/lib/AST/RecordLayoutBuilder.cpp
@@ -1396,7 +1396,7 @@
   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 @@
                                              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 @@
       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 @@
   }
   
   // 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 @@
 
   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/lib/AST/StmtDumper.cpp b/lib/AST/StmtDumper.cpp
index acacf94..aea4c39 100644
--- a/lib/AST/StmtDumper.cpp
+++ b/lib/AST/StmtDumper.cpp
@@ -254,7 +254,7 @@
 
     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 @@
     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/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp
index 1fe4a79..7ebc129 100644
--- a/lib/AST/StmtPrinter.cpp
+++ b/lib/AST/StmtPrinter.cpp
@@ -1833,7 +1833,7 @@
 
 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/lib/AST/Type.cpp b/lib/AST/Type.cpp
index d9fecd4..c61f34f 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -580,7 +580,7 @@
     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 @@
   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 @@
   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 @@
   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 @@
   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 @@
   //   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 @@
   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/lib/AST/VTableBuilder.cpp b/lib/AST/VTableBuilder.cpp
index 67924eb..35f84ff 100644
--- a/lib/AST/VTableBuilder.cpp
+++ b/lib/AST/VTableBuilder.cpp
@@ -996,7 +996,7 @@
 
     LayoutVTable();
 
-    if (Context.getLangOptions().DumpVTableLayouts)
+    if (Context.getLangOpts().DumpVTableLayouts)
       dumpLayout(llvm::errs());
   }
 
@@ -1580,7 +1580,7 @@
   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()));
 }