Ver código fonte

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
David Blaikie 13 anos atrás
pai
commit
4e4d08403c
100 arquivos alterados com 735 adições e 735 exclusões
  1. 4 4
      examples/wpa/clang-wpa.cpp
  2. 2 2
      include/clang/AST/ASTContext.h
  3. 1 1
      include/clang/Edit/EditedSource.h
  4. 15 15
      include/clang/Lex/Lexer.h
  5. 10 10
      include/clang/Lex/Preprocessor.h
  6. 10 10
      include/clang/Parse/Parser.h
  7. 1 1
      include/clang/Sema/Initialization.h
  8. 1 1
      include/clang/Sema/Lookup.h
  9. 2 2
      include/clang/Sema/Sema.h
  10. 1 1
      include/clang/StaticAnalyzer/Core/CheckerManager.h
  11. 3 3
      include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h
  12. 2 2
      include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
  13. 7 7
      lib/ARCMigrate/ARCMT.cpp
  14. 2 2
      lib/ARCMigrate/ObjCMT.cpp
  15. 1 1
      lib/ARCMigrate/TransBlockObjCVariable.cpp
  16. 1 1
      lib/ARCMigrate/TransGCAttrs.cpp
  17. 1 1
      lib/ARCMigrate/TransRetainReleaseDealloc.cpp
  18. 7 7
      lib/ARCMigrate/Transforms.cpp
  19. 11 11
      lib/AST/ASTContext.cpp
  20. 1 1
      lib/AST/ASTDiagnostic.cpp
  21. 5 5
      lib/AST/ASTImporter.cpp
  22. 22 22
      lib/AST/Decl.cpp
  23. 1 1
      lib/AST/DeclBase.cpp
  24. 3 3
      lib/AST/DeclCXX.cpp
  25. 1 1
      lib/AST/DeclObjC.cpp
  26. 6 6
      lib/AST/Expr.cpp
  27. 10 10
      lib/AST/ExprClassification.cpp
  28. 9 9
      lib/AST/ExprConstant.cpp
  29. 2 2
      lib/AST/ItaniumMangle.cpp
  30. 2 2
      lib/AST/MicrosoftMangle.cpp
  31. 6 6
      lib/AST/RecordLayoutBuilder.cpp
  32. 2 2
      lib/AST/StmtDumper.cpp
  33. 1 1
      lib/AST/StmtPrinter.cpp
  34. 7 7
      lib/AST/Type.cpp
  35. 2 2
      lib/AST/VTableBuilder.cpp
  36. 1 1
      lib/Analysis/AnalysisDeclContext.cpp
  37. 1 1
      lib/Analysis/CFG.cpp
  38. 8 8
      lib/CodeGen/CGBlocks.cpp
  39. 5 5
      lib/CodeGen/CGCall.cpp
  40. 7 7
      lib/CodeGen/CGClass.cpp
  41. 10 10
      lib/CodeGen/CGDebugInfo.cpp
  42. 5 5
      lib/CodeGen/CGDecl.cpp
  43. 3 3
      lib/CodeGen/CGDeclCXX.cpp
  44. 13 13
      lib/CodeGen/CGException.cpp
  45. 10 10
      lib/CodeGen/CGExpr.cpp
  46. 5 5
      lib/CodeGen/CGExprAgg.cpp
  47. 5 5
      lib/CodeGen/CGExprCXX.cpp
  48. 2 2
      lib/CodeGen/CGExprComplex.cpp
  49. 16 16
      lib/CodeGen/CGExprScalar.cpp
  50. 17 17
      lib/CodeGen/CGObjC.cpp
  51. 15 15
      lib/CodeGen/CGObjCGNU.cpp
  52. 18 18
      lib/CodeGen/CGObjCMac.cpp
  53. 1 1
      lib/CodeGen/CGObjCRuntime.cpp
  54. 4 4
      lib/CodeGen/CGRTTI.cpp
  55. 2 2
      lib/CodeGen/CGRecordLayoutBuilder.cpp
  56. 1 1
      lib/CodeGen/CGStmt.cpp
  57. 1 1
      lib/CodeGen/CGVTables.cpp
  58. 5 5
      lib/CodeGen/CodeGenFunction.cpp
  59. 3 3
      lib/CodeGen/CodeGenFunction.h
  60. 40 40
      lib/CodeGen/CodeGenModule.cpp
  61. 3 3
      lib/CodeGen/CodeGenModule.h
  62. 1 1
      lib/CodeGen/CodeGenTypes.cpp
  63. 2 2
      lib/CodeGen/ItaniumCXXABI.cpp
  64. 1 1
      lib/CodeGen/ModuleBuilder.cpp
  65. 4 4
      lib/CodeGen/TargetInfo.cpp
  66. 1 1
      lib/Edit/Commit.cpp
  67. 1 1
      lib/Edit/RewriteObjCFoundationAPI.cpp
  68. 1 1
      lib/Frontend/ASTMerge.cpp
  69. 5 5
      lib/Frontend/ASTUnit.cpp
  70. 1 1
      lib/Frontend/CacheTokens.cpp
  71. 1 1
      lib/Frontend/ChainedIncludesSource.cpp
  72. 1 1
      lib/Frontend/FrontendAction.cpp
  73. 1 1
      lib/Frontend/FrontendActions.cpp
  74. 6 6
      lib/Frontend/InitPreprocessor.cpp
  75. 1 1
      lib/Frontend/PrintPreprocessedOutput.cpp
  76. 1 1
      lib/Frontend/VerifyDiagnosticConsumer.cpp
  77. 1 1
      lib/Index/ASTLocation.cpp
  78. 60 60
      lib/Lex/Lexer.cpp
  79. 6 6
      lib/Lex/LiteralSupport.cpp
  80. 17 17
      lib/Lex/PPDirectives.cpp
  81. 4 4
      lib/Lex/PPExpressions.cpp
  82. 5 5
      lib/Lex/PPMacroExpansion.cpp
  83. 1 1
      lib/Lex/Pragma.cpp
  84. 5 5
      lib/Lex/Preprocessor.cpp
  85. 7 7
      lib/Lex/TokenConcatenation.cpp
  86. 4 4
      lib/Lex/TokenLexer.cpp
  87. 4 4
      lib/Parse/ParseCXXInlineMethods.cpp
  88. 73 73
      lib/Parse/ParseDecl.cpp
  89. 22 22
      lib/Parse/ParseDeclCXX.cpp
  90. 32 32
      lib/Parse/ParseExpr.cpp
  91. 15 15
      lib/Parse/ParseExprCXX.cpp
  92. 6 6
      lib/Parse/ParseInit.cpp
  93. 13 13
      lib/Parse/ParseObjc.cpp
  94. 2 2
      lib/Parse/ParsePragma.cpp
  95. 19 19
      lib/Parse/ParseStmt.cpp
  96. 4 4
      lib/Parse/ParseTemplate.cpp
  97. 11 11
      lib/Parse/ParseTentative.cpp
  98. 30 30
      lib/Parse/Parser.cpp
  99. 1 1
      lib/Rewrite/HTMLPrint.cpp
  100. 2 2
      lib/Rewrite/HTMLRewrite.cpp

+ 4 - 4
examples/wpa/clang-wpa.cpp

@@ -151,16 +151,16 @@ int main(int argc, char **argv) {
     Opts.CheckersControlList.push_back(std::make_pair("macosx", true));
     Opts.CheckersControlList.push_back(std::make_pair("macosx", true));
 
 
   // Checks to perform for Objective-C/Objective-C++.
   // Checks to perform for Objective-C/Objective-C++.
-  if (PP.getLangOptions().ObjC1)
+  if (PP.getLangOpts().ObjC1)
     Opts.CheckersControlList.push_back(std::make_pair("cocoa", true));
     Opts.CheckersControlList.push_back(std::make_pair("cocoa", true));
 
 
   OwningPtr<ento::CheckerManager> checkerMgr;
   OwningPtr<ento::CheckerManager> checkerMgr;
-  checkerMgr.reset(ento::registerCheckers(Opts, PP.getLangOptions(),
+  checkerMgr.reset(ento::registerCheckers(Opts, PP.getLangOpts(),
                                           PP.getDiagnostics()));
                                           PP.getDiagnostics()));
 
 
   using namespace clang::ento;
   using namespace clang::ento;
   AnalysisManager AMgr(TU->getASTContext(), PP.getDiagnostics(),
   AnalysisManager AMgr(TU->getASTContext(), PP.getDiagnostics(),
-                       PP.getLangOptions(), /* PathDiagnostic */ 0,
+                       PP.getLangOpts(), /* PathDiagnostic */ 0,
                        CreateRegionStoreManager,
                        CreateRegionStoreManager,
                        CreateRangeConstraintManager, checkerMgr.get(), &Idxer,
                        CreateRangeConstraintManager, checkerMgr.get(), &Idxer,
                        Opts.MaxNodes, Opts.MaxLoop,
                        Opts.MaxNodes, Opts.MaxLoop,
@@ -172,7 +172,7 @@ int main(int argc, char **argv) {
                        Opts.EagerlyTrimEGraph);
                        Opts.EagerlyTrimEGraph);
 
 
   TransferFuncs* TF = MakeCFRefCountTF(AMgr.getASTContext(), /*GC*/false,
   TransferFuncs* TF = MakeCFRefCountTF(AMgr.getASTContext(), /*GC*/false,
-                                         AMgr.getLangOptions());
+                                         AMgr.getLangOpts());
   ExprEngine Eng(AMgr, TF);
   ExprEngine Eng(AMgr, TF);
 
 
   Eng.ExecuteWorkList(AMgr.getStackFrame(FD, TU), AMgr.getMaxNodes());
   Eng.ExecuteWorkList(AMgr.getStackFrame(FD, TU), AMgr.getMaxNodes());

+ 2 - 2
include/clang/AST/ASTContext.h

@@ -411,7 +411,7 @@ public:
 
 
   const TargetInfo &getTargetInfo() const { return *Target; }
   const TargetInfo &getTargetInfo() const { return *Target; }
   
   
-  const LangOptions& getLangOptions() const { return LangOpts; }
+  const LangOptions& getLangOpts() const { return LangOpts; }
 
 
   DiagnosticsEngine &getDiagnostics() const;
   DiagnosticsEngine &getDiagnostics() const;
 
 
@@ -1058,7 +1058,7 @@ public:
 
 
   /// \brief The result type of logical operations, '<', '>', '!=', etc.
   /// \brief The result type of logical operations, '<', '>', '!=', etc.
   QualType getLogicalOperationType() const {
   QualType getLogicalOperationType() const {
-    return getLangOptions().CPlusPlus ? BoolTy : IntTy;
+    return getLangOpts().CPlusPlus ? BoolTy : IntTy;
   }
   }
 
 
   /// getObjCEncodingForType - Emit the ObjC type encoding for the
   /// getObjCEncodingForType - Emit the ObjC type encoding for the

+ 1 - 1
include/clang/Edit/EditedSource.h

@@ -50,7 +50,7 @@ public:
       StrAlloc(/*size=*/512) { }
       StrAlloc(/*size=*/512) { }
 
 
   const SourceManager &getSourceManager() const { return SourceMgr; }
   const SourceManager &getSourceManager() const { return SourceMgr; }
-  const LangOptions &getLangOptions() const { return LangOpts; }
+  const LangOptions &getLangOpts() const { return LangOpts; }
   const PreprocessingRecord *getPreprocessingRecord() const { return PPRec; }
   const PreprocessingRecord *getPreprocessingRecord() const { return PPRec; }
 
 
   bool canInsertInOffset(SourceLocation OrigLoc, FileOffset Offs);
   bool canInsertInOffset(SourceLocation OrigLoc, FileOffset Offs);

+ 15 - 15
include/clang/Lex/Lexer.h

@@ -51,7 +51,7 @@ class Lexer : public PreprocessorLexer {
   const char *BufferStart;       // Start of the buffer.
   const char *BufferStart;       // Start of the buffer.
   const char *BufferEnd;         // End of the buffer.
   const char *BufferEnd;         // End of the buffer.
   SourceLocation FileLoc;        // Location for start of file.
   SourceLocation FileLoc;        // Location for start of file.
-  LangOptions Features;          // Features enabled by this language (cache).
+  LangOptions LangOpts;          // LangOpts enabled by this language (cache).
   bool Is_PragmaLexer;           // True if lexer for _Pragma handling.
   bool Is_PragmaLexer;           // True if lexer for _Pragma handling.
   
   
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
@@ -99,14 +99,14 @@ public:
   /// Lexer constructor - Create a new raw lexer object.  This object is only
   /// Lexer constructor - Create a new raw lexer object.  This object is only
   /// suitable for calls to 'LexRawToken'.  This lexer assumes that the text
   /// suitable for calls to 'LexRawToken'.  This lexer assumes that the text
   /// range will outlive it, so it doesn't take ownership of it.
   /// range will outlive it, so it doesn't take ownership of it.
-  Lexer(SourceLocation FileLoc, const LangOptions &Features,
+  Lexer(SourceLocation FileLoc, const LangOptions &LangOpts,
         const char *BufStart, const char *BufPtr, const char *BufEnd);
         const char *BufStart, const char *BufPtr, const char *BufEnd);
 
 
   /// Lexer constructor - Create a new raw lexer object.  This object is only
   /// Lexer constructor - Create a new raw lexer object.  This object is only
   /// suitable for calls to 'LexRawToken'.  This lexer assumes that the text
   /// suitable for calls to 'LexRawToken'.  This lexer assumes that the text
   /// range will outlive it, so it doesn't take ownership of it.
   /// range will outlive it, so it doesn't take ownership of it.
   Lexer(FileID FID, const llvm::MemoryBuffer *InputBuffer,
   Lexer(FileID FID, const llvm::MemoryBuffer *InputBuffer,
-        const SourceManager &SM, const LangOptions &Features);
+        const SourceManager &SM, const LangOptions &LangOpts);
 
 
   /// Create_PragmaLexer: Lexer constructor - Create a new lexer object for
   /// Create_PragmaLexer: Lexer constructor - Create a new lexer object for
   /// _Pragma expansion.  This has a variety of magic semantics that this method
   /// _Pragma expansion.  This has a variety of magic semantics that this method
@@ -117,9 +117,9 @@ public:
                                    unsigned TokLen, Preprocessor &PP);
                                    unsigned TokLen, Preprocessor &PP);
 
 
 
 
-  /// getFeatures - Return the language features currently enabled.  NOTE: this
-  /// lexer modifies features as a file is parsed!
-  const LangOptions &getFeatures() const { return Features; }
+  /// getLangOpts - Return the language features currently enabled.
+  /// NOTE: this lexer modifies features as a file is parsed!
+  const LangOptions &getLangOpts() const { return LangOpts; }
 
 
   /// getFileLoc - Return the File Location for the file we are lexing out of.
   /// getFileLoc - Return the File Location for the file we are lexing out of.
   /// The physical location encodes the location where the characters come from,
   /// The physical location encodes the location where the characters come from,
@@ -240,7 +240,7 @@ public:
   /// if an internal buffer is returned.
   /// if an internal buffer is returned.
   static unsigned getSpelling(const Token &Tok, const char *&Buffer, 
   static unsigned getSpelling(const Token &Tok, const char *&Buffer, 
                               const SourceManager &SourceMgr,
                               const SourceManager &SourceMgr,
-                              const LangOptions &Features,
+                              const LangOptions &LangOpts,
                               bool *Invalid = 0);
                               bool *Invalid = 0);
   
   
   /// getSpelling() - Return the 'spelling' of the Tok token.  The spelling of a
   /// getSpelling() - Return the 'spelling' of the Tok token.  The spelling of a
@@ -250,7 +250,7 @@ public:
   /// UCNs, etc.
   /// UCNs, etc.
   static std::string getSpelling(const Token &Tok,
   static std::string getSpelling(const Token &Tok,
                                  const SourceManager &SourceMgr,
                                  const SourceManager &SourceMgr,
-                                 const LangOptions &Features, 
+                                 const LangOptions &LangOpts, 
                                  bool *Invalid = 0);
                                  bool *Invalid = 0);
 
 
   /// getSpelling - This method is used to get the spelling of the
   /// getSpelling - This method is used to get the spelling of the
@@ -264,7 +264,7 @@ public:
   static StringRef getSpelling(SourceLocation loc,
   static StringRef getSpelling(SourceLocation loc,
                                      SmallVectorImpl<char> &buffer,
                                      SmallVectorImpl<char> &buffer,
                                      const SourceManager &SourceMgr,
                                      const SourceManager &SourceMgr,
-                                     const LangOptions &Features,
+                                     const LangOptions &LangOpts,
                                      bool *invalid = 0);
                                      bool *invalid = 0);
   
   
   /// MeasureTokenLength - Relex the token at the specified location and return
   /// MeasureTokenLength - Relex the token at the specified location and return
@@ -290,7 +290,7 @@ public:
   static SourceLocation AdvanceToTokenCharacter(SourceLocation TokStart,
   static SourceLocation AdvanceToTokenCharacter(SourceLocation TokStart,
                                                 unsigned Character,
                                                 unsigned Character,
                                                 const SourceManager &SM,
                                                 const SourceManager &SM,
-                                                const LangOptions &Features);
+                                                const LangOptions &LangOpts);
   
   
   /// \brief Computes the source location just past the end of the
   /// \brief Computes the source location just past the end of the
   /// token at this source location.
   /// token at this source location.
@@ -309,7 +309,7 @@ public:
   /// a source location pointing to the last character in the token, etc.
   /// a source location pointing to the last character in the token, etc.
   static SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset,
   static SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset,
                                             const SourceManager &SM,
                                             const SourceManager &SM,
-                                            const LangOptions &Features);
+                                            const LangOptions &LangOpts);
 
 
   /// \brief Returns true if the given MacroID location points at the first
   /// \brief Returns true if the given MacroID location points at the first
   /// token of the macro expansion.
   /// token of the macro expansion.
@@ -372,7 +372,7 @@ public:
   /// of the file begins along with a boolean value indicating whether 
   /// of the file begins along with a boolean value indicating whether 
   /// the preamble ends at the beginning of a new line.
   /// the preamble ends at the beginning of a new line.
   static std::pair<unsigned, bool>
   static std::pair<unsigned, bool>
-  ComputePreamble(const llvm::MemoryBuffer *Buffer, const LangOptions &Features,
+  ComputePreamble(const llvm::MemoryBuffer *Buffer, const LangOptions &LangOpts,
                   unsigned MaxLines = 0);
                   unsigned MaxLines = 0);
                                         
                                         
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
@@ -486,7 +486,7 @@ public:
   /// getCharAndSizeNoWarn - Like the getCharAndSize method, but does not ever
   /// getCharAndSizeNoWarn - Like the getCharAndSize method, but does not ever
   /// emit a warning.
   /// emit a warning.
   static inline char getCharAndSizeNoWarn(const char *Ptr, unsigned &Size,
   static inline char getCharAndSizeNoWarn(const char *Ptr, unsigned &Size,
-                                          const LangOptions &Features) {
+                                          const LangOptions &LangOpts) {
     // If this is not a trigraph and not a UCN or escaped newline, return
     // If this is not a trigraph and not a UCN or escaped newline, return
     // quickly.
     // quickly.
     if (isObviouslySimpleCharacter(Ptr[0])) {
     if (isObviouslySimpleCharacter(Ptr[0])) {
@@ -495,7 +495,7 @@ public:
     }
     }
 
 
     Size = 0;
     Size = 0;
-    return getCharAndSizeSlowNoWarn(Ptr, Size, Features);
+    return getCharAndSizeSlowNoWarn(Ptr, Size, LangOpts);
   }
   }
 
 
   /// getEscapedNewLineSize - Return the size of the specified escaped newline,
   /// getEscapedNewLineSize - Return the size of the specified escaped newline,
@@ -524,7 +524,7 @@ private:
   /// getCharAndSizeSlowNoWarn - Same as getCharAndSizeSlow, but never emits a
   /// getCharAndSizeSlowNoWarn - Same as getCharAndSizeSlow, but never emits a
   /// diagnostic.
   /// diagnostic.
   static char getCharAndSizeSlowNoWarn(const char *Ptr, unsigned &Size,
   static char getCharAndSizeSlowNoWarn(const char *Ptr, unsigned &Size,
-                                       const LangOptions &Features);
+                                       const LangOptions &LangOpts);
 
 
   //===--------------------------------------------------------------------===//
   //===--------------------------------------------------------------------===//
   // Other lexer functions.
   // Other lexer functions.

+ 10 - 10
include/clang/Lex/Preprocessor.h

@@ -62,7 +62,7 @@ class ModuleLoader;
 ///
 ///
 class Preprocessor : public RefCountedBase<Preprocessor> {
 class Preprocessor : public RefCountedBase<Preprocessor> {
   DiagnosticsEngine        *Diags;
   DiagnosticsEngine        *Diags;
-  LangOptions       &Features;
+  LangOptions       &LangOpts;
   const TargetInfo  *Target;
   const TargetInfo  *Target;
   FileManager       &FileMgr;
   FileManager       &FileMgr;
   SourceManager     &SourceMgr;
   SourceManager     &SourceMgr;
@@ -357,7 +357,7 @@ public:
   DiagnosticsEngine &getDiagnostics() const { return *Diags; }
   DiagnosticsEngine &getDiagnostics() const { return *Diags; }
   void setDiagnostics(DiagnosticsEngine &D) { Diags = &D; }
   void setDiagnostics(DiagnosticsEngine &D) { Diags = &D; }
 
 
-  const LangOptions &getLangOptions() const { return Features; }
+  const LangOptions &getLangOpts() const { return LangOpts; }
   const TargetInfo &getTargetInfo() const { return *Target; }
   const TargetInfo &getTargetInfo() const { return *Target; }
   FileManager &getFileManager() const { return FileMgr; }
   FileManager &getFileManager() const { return FileMgr; }
   SourceManager &getSourceManager() const { return SourceMgr; }
   SourceManager &getSourceManager() const { return SourceMgr; }
@@ -782,7 +782,7 @@ public:
   StringRef getSpelling(SourceLocation loc,
   StringRef getSpelling(SourceLocation loc,
                               SmallVectorImpl<char> &buffer,
                               SmallVectorImpl<char> &buffer,
                               bool *invalid = 0) const {
                               bool *invalid = 0) const {
-    return Lexer::getSpelling(loc, buffer, SourceMgr, Features, invalid);
+    return Lexer::getSpelling(loc, buffer, SourceMgr, LangOpts, invalid);
   }
   }
 
 
   /// getSpelling() - Return the 'spelling' of the Tok token.  The spelling of a
   /// getSpelling() - Return the 'spelling' of the Tok token.  The spelling of a
@@ -793,7 +793,7 @@ public:
   ///
   ///
   /// \param Invalid If non-null, will be set \c true if an error occurs.
   /// \param Invalid If non-null, will be set \c true if an error occurs.
   std::string getSpelling(const Token &Tok, bool *Invalid = 0) const {
   std::string getSpelling(const Token &Tok, bool *Invalid = 0) const {
-    return Lexer::getSpelling(Tok, SourceMgr, Features, Invalid);
+    return Lexer::getSpelling(Tok, SourceMgr, LangOpts, Invalid);
   }
   }
 
 
   /// getSpelling - This method is used to get the spelling of a token into a
   /// getSpelling - This method is used to get the spelling of a token into a
@@ -808,7 +808,7 @@ public:
   /// if an internal buffer is returned.
   /// if an internal buffer is returned.
   unsigned getSpelling(const Token &Tok, const char *&Buffer,
   unsigned getSpelling(const Token &Tok, const char *&Buffer,
                        bool *Invalid = 0) const {
                        bool *Invalid = 0) const {
-    return Lexer::getSpelling(Tok, Buffer, SourceMgr, Features, Invalid);
+    return Lexer::getSpelling(Tok, Buffer, SourceMgr, LangOpts, Invalid);
   }
   }
 
 
   /// getSpelling - This method is used to get the spelling of a token into a
   /// getSpelling - This method is used to get the spelling of a token into a
@@ -843,7 +843,7 @@ public:
   /// refers to the SourceManager-owned buffer of the source where that macro
   /// refers to the SourceManager-owned buffer of the source where that macro
   /// name is spelled. Thus, the result shouldn't out-live the SourceManager.
   /// name is spelled. Thus, the result shouldn't out-live the SourceManager.
   StringRef getImmediateMacroName(SourceLocation Loc) {
   StringRef getImmediateMacroName(SourceLocation Loc) {
-    return Lexer::getImmediateMacroName(Loc, SourceMgr, getLangOptions());
+    return Lexer::getImmediateMacroName(Loc, SourceMgr, getLangOpts());
   }
   }
 
 
   /// CreateString - Plop the specified string into a scratch buffer and set the
   /// CreateString - Plop the specified string into a scratch buffer and set the
@@ -869,7 +869,7 @@ public:
   /// location pointing just past the end of the token; an offset of 1 produces
   /// location pointing just past the end of the token; an offset of 1 produces
   /// a source location pointing to the last character in the token, etc.
   /// a source location pointing to the last character in the token, etc.
   SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset = 0) {
   SourceLocation getLocForEndOfToken(SourceLocation Loc, unsigned Offset = 0) {
-    return Lexer::getLocForEndOfToken(Loc, Offset, SourceMgr, Features);
+    return Lexer::getLocForEndOfToken(Loc, Offset, SourceMgr, LangOpts);
   }
   }
 
 
   /// \brief Returns true if the given MacroID location points at the first
   /// \brief Returns true if the given MacroID location points at the first
@@ -879,7 +879,7 @@ public:
   /// begin location of the macro.
   /// begin location of the macro.
   bool isAtStartOfMacroExpansion(SourceLocation loc,
   bool isAtStartOfMacroExpansion(SourceLocation loc,
                                  SourceLocation *MacroBegin = 0) const {
                                  SourceLocation *MacroBegin = 0) const {
-    return Lexer::isAtStartOfMacroExpansion(loc, SourceMgr, Features,
+    return Lexer::isAtStartOfMacroExpansion(loc, SourceMgr, LangOpts,
                                             MacroBegin);
                                             MacroBegin);
   }
   }
 
 
@@ -890,7 +890,7 @@ public:
   /// end location of the macro.
   /// end location of the macro.
   bool isAtEndOfMacroExpansion(SourceLocation loc,
   bool isAtEndOfMacroExpansion(SourceLocation loc,
                                SourceLocation *MacroEnd = 0) const {
                                SourceLocation *MacroEnd = 0) const {
-    return Lexer::isAtEndOfMacroExpansion(loc, SourceMgr, Features, MacroEnd);
+    return Lexer::isAtEndOfMacroExpansion(loc, SourceMgr, LangOpts, MacroEnd);
   }
   }
 
 
   /// DumpToken - Print the token to stderr, used for debugging.
   /// DumpToken - Print the token to stderr, used for debugging.
@@ -903,7 +903,7 @@ public:
   /// token, return a new location that specifies a character within the token.
   /// token, return a new location that specifies a character within the token.
   SourceLocation AdvanceToTokenCharacter(SourceLocation TokStart,
   SourceLocation AdvanceToTokenCharacter(SourceLocation TokStart,
                                          unsigned Char) const {
                                          unsigned Char) const {
-    return Lexer::AdvanceToTokenCharacter(TokStart, Char, SourceMgr, Features);
+    return Lexer::AdvanceToTokenCharacter(TokStart, Char, SourceMgr, LangOpts);
   }
   }
 
 
   /// IncrementPasteCounter - Increment the counters for the number of token
   /// IncrementPasteCounter - Increment the counters for the number of token

+ 10 - 10
include/clang/Parse/Parser.h

@@ -202,7 +202,7 @@ public:
   Parser(Preprocessor &PP, Sema &Actions);
   Parser(Preprocessor &PP, Sema &Actions);
   ~Parser();
   ~Parser();
 
 
-  const LangOptions &getLang() const { return PP.getLangOptions(); }
+  const LangOptions &getLangOpts() const { return PP.getLangOpts(); }
   const TargetInfo &getTargetInfo() const { return PP.getTargetInfo(); }
   const TargetInfo &getTargetInfo() const { return PP.getTargetInfo(); }
   Preprocessor &getPreprocessor() const { return PP; }
   Preprocessor &getPreprocessor() const { return PP; }
   Sema &getActions() const { return Actions; }
   Sema &getActions() const { return Actions; }
@@ -544,7 +544,7 @@ private:
   bool TryAltiVecToken(DeclSpec &DS, SourceLocation Loc,
   bool TryAltiVecToken(DeclSpec &DS, SourceLocation Loc,
                        const char *&PrevSpec, unsigned &DiagID,
                        const char *&PrevSpec, unsigned &DiagID,
                        bool &isInvalid) {
                        bool &isInvalid) {
-    if (!getLang().AltiVec ||
+    if (!getLangOpts().AltiVec ||
         (Tok.getIdentifierInfo() != Ident_vector &&
         (Tok.getIdentifierInfo() != Ident_vector &&
          Tok.getIdentifierInfo() != Ident_pixel))
          Tok.getIdentifierInfo() != Ident_pixel))
       return false;
       return false;
@@ -556,7 +556,7 @@ private:
   /// identifier token, replacing it with the non-context-sensitive __vector.
   /// identifier token, replacing it with the non-context-sensitive __vector.
   /// This returns true if the token was replaced.
   /// This returns true if the token was replaced.
   bool TryAltiVecVectorToken() {
   bool TryAltiVecVectorToken() {
-    if (!getLang().AltiVec ||
+    if (!getLangOpts().AltiVec ||
         Tok.getIdentifierInfo() != Ident_vector) return false;
         Tok.getIdentifierInfo() != Ident_vector) return false;
     return TryAltiVecVectorTokenOutOfLine();
     return TryAltiVecVectorTokenOutOfLine();
   }
   }
@@ -1712,7 +1712,7 @@ private:
   /// expression statement, when parsing function bodies.
   /// expression statement, when parsing function bodies.
   /// Returns true for declaration, false for expression.
   /// Returns true for declaration, false for expression.
   bool isDeclarationStatement() {
   bool isDeclarationStatement() {
-    if (getLang().CPlusPlus)
+    if (getLangOpts().CPlusPlus)
       return isCXXDeclarationStatement();
       return isCXXDeclarationStatement();
     return isDeclarationSpecifier(true);
     return isDeclarationSpecifier(true);
   }
   }
@@ -1722,7 +1722,7 @@ private:
   // 'for-init-statement' part of a 'for' statement.
   // 'for-init-statement' part of a 'for' statement.
   /// Returns true for declaration, false for expression.
   /// Returns true for declaration, false for expression.
   bool isForInitDeclaration() {
   bool isForInitDeclaration() {
-    if (getLang().CPlusPlus)
+    if (getLangOpts().CPlusPlus)
       return isCXXSimpleDeclaration(/*AllowForRangeDecl=*/true);
       return isCXXSimpleDeclaration(/*AllowForRangeDecl=*/true);
     return isDeclarationSpecifier(true);
     return isDeclarationSpecifier(true);
   }
   }
@@ -1748,7 +1748,7 @@ private:
   /// whether the parens contain an expression or a type-id.
   /// whether the parens contain an expression or a type-id.
   /// Returns true for a type-id and false for an expression.
   /// Returns true for a type-id and false for an expression.
   bool isTypeIdInParens(bool &isAmbiguous) {
   bool isTypeIdInParens(bool &isAmbiguous) {
-    if (getLang().CPlusPlus)
+    if (getLangOpts().CPlusPlus)
       return isCXXTypeId(TypeIdInParens, isAmbiguous);
       return isCXXTypeId(TypeIdInParens, isAmbiguous);
     isAmbiguous = false;
     isAmbiguous = false;
     return isTypeSpecifierQualifier();
     return isTypeSpecifierQualifier();
@@ -1890,7 +1890,7 @@ private:
                              SourceLocation *EndLoc);
                              SourceLocation *EndLoc);
 
 
   void MaybeParseCXX0XAttributes(Declarator &D) {
   void MaybeParseCXX0XAttributes(Declarator &D) {
-    if (getLang().CPlusPlus0x && isCXX0XAttributeSpecifier()) {
+    if (getLangOpts().CPlusPlus0x && isCXX0XAttributeSpecifier()) {
       ParsedAttributesWithRange attrs(AttrFactory);
       ParsedAttributesWithRange attrs(AttrFactory);
       SourceLocation endLoc;
       SourceLocation endLoc;
       ParseCXX0XAttributes(attrs, &endLoc);
       ParseCXX0XAttributes(attrs, &endLoc);
@@ -1899,7 +1899,7 @@ private:
   }
   }
   void MaybeParseCXX0XAttributes(ParsedAttributes &attrs,
   void MaybeParseCXX0XAttributes(ParsedAttributes &attrs,
                                  SourceLocation *endLoc = 0) {
                                  SourceLocation *endLoc = 0) {
-    if (getLang().CPlusPlus0x && isCXX0XAttributeSpecifier()) {
+    if (getLangOpts().CPlusPlus0x && isCXX0XAttributeSpecifier()) {
       ParsedAttributesWithRange attrsWithRange(AttrFactory);
       ParsedAttributesWithRange attrsWithRange(AttrFactory);
       ParseCXX0XAttributes(attrsWithRange, endLoc);
       ParseCXX0XAttributes(attrsWithRange, endLoc);
       attrs.takeAllFrom(attrsWithRange);
       attrs.takeAllFrom(attrsWithRange);
@@ -1907,7 +1907,7 @@ private:
   }
   }
   void MaybeParseCXX0XAttributes(ParsedAttributesWithRange &attrs,
   void MaybeParseCXX0XAttributes(ParsedAttributesWithRange &attrs,
                                  SourceLocation *endLoc = 0) {
                                  SourceLocation *endLoc = 0) {
-    if (getLang().CPlusPlus0x && isCXX0XAttributeSpecifier())
+    if (getLangOpts().CPlusPlus0x && isCXX0XAttributeSpecifier())
       ParseCXX0XAttributes(attrs, endLoc);
       ParseCXX0XAttributes(attrs, endLoc);
   }
   }
 
 
@@ -1918,7 +1918,7 @@ private:
 
 
   void MaybeParseMicrosoftAttributes(ParsedAttributes &attrs,
   void MaybeParseMicrosoftAttributes(ParsedAttributes &attrs,
                                      SourceLocation *endLoc = 0) {
                                      SourceLocation *endLoc = 0) {
-    if (getLang().MicrosoftExt && Tok.is(tok::l_square))
+    if (getLangOpts().MicrosoftExt && Tok.is(tok::l_square))
       ParseMicrosoftAttributes(attrs, endLoc);
       ParseMicrosoftAttributes(attrs, endLoc);
   }
   }
   void ParseMicrosoftAttributes(ParsedAttributes &attrs,
   void ParseMicrosoftAttributes(ParsedAttributes &attrs,

+ 1 - 1
include/clang/Sema/Initialization.h

@@ -175,7 +175,7 @@ public:
   /// \brief Create the initialization entity for a parameter.
   /// \brief Create the initialization entity for a parameter.
   static InitializedEntity InitializeParameter(ASTContext &Context,
   static InitializedEntity InitializeParameter(ASTContext &Context,
                                                ParmVarDecl *Parm) {
                                                ParmVarDecl *Parm) {
-    bool Consumed = (Context.getLangOptions().ObjCAutoRefCount &&
+    bool Consumed = (Context.getLangOpts().ObjCAutoRefCount &&
                      Parm->hasAttr<NSConsumedAttr>());
                      Parm->hasAttr<NSConsumedAttr>());
 
 
     InitializedEntity Entity;
     InitializedEntity Entity;

+ 1 - 1
include/clang/Sema/Lookup.h

@@ -592,7 +592,7 @@ private:
   void diagnose() {
   void diagnose() {
     if (isAmbiguous())
     if (isAmbiguous())
       SemaRef.DiagnoseAmbiguousLookup(*this);
       SemaRef.DiagnoseAmbiguousLookup(*this);
-    else if (isClassLookup() && SemaRef.getLangOptions().AccessControl)
+    else if (isClassLookup() && SemaRef.getLangOpts().AccessControl)
       SemaRef.CheckLookupAccess(*this);
       SemaRef.CheckLookupAccess(*this);
   }
   }
 
 

+ 2 - 2
include/clang/Sema/Sema.h

@@ -745,7 +745,7 @@ public:
   /// initialized but before it parses anything.
   /// initialized but before it parses anything.
   void Initialize();
   void Initialize();
 
 
-  const LangOptions &getLangOptions() const { return LangOpts; }
+  const LangOptions &getLangOpts() const { return LangOpts; }
   OpenCLOptions &getOpenCLOptions() { return OpenCLFeatures; }
   OpenCLOptions &getOpenCLOptions() { return OpenCLFeatures; }
   FPOptions     &getFPOptions() { return FPFeatures; }
   FPOptions     &getFPOptions() { return FPFeatures; }
 
 
@@ -3024,7 +3024,7 @@ public:
   public:
   public:
     explicit ImplicitExceptionSpecification(ASTContext &Context)
     explicit ImplicitExceptionSpecification(ASTContext &Context)
       : Context(&Context), ComputedEST(EST_BasicNoexcept) {
       : Context(&Context), ComputedEST(EST_BasicNoexcept) {
-      if (!Context.getLangOptions().CPlusPlus0x)
+      if (!Context.getLangOpts().CPlusPlus0x)
         ComputedEST = EST_DynamicNone;
         ComputedEST = EST_DynamicNone;
     }
     }
 
 

+ 1 - 1
include/clang/StaticAnalyzer/Core/CheckerManager.h

@@ -128,7 +128,7 @@ public:
 
 
   void finishedCheckerRegistration();
   void finishedCheckerRegistration();
 
 
-  const LangOptions &getLangOptions() const { return LangOpts; }
+  const LangOptions &getLangOpts() const { return LangOpts; }
 
 
   typedef CheckerBase *CheckerRef;
   typedef CheckerBase *CheckerRef;
   typedef const void *CheckerTag;
   typedef const void *CheckerTag;

+ 3 - 3
include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h

@@ -38,7 +38,7 @@ class AnalysisManager : public BugReporterData {
 
 
   ASTContext &Ctx;
   ASTContext &Ctx;
   DiagnosticsEngine &Diags;
   DiagnosticsEngine &Diags;
-  const LangOptions &LangInfo;
+  const LangOptions &LangOpts;
 
 
   OwningPtr<PathDiagnosticConsumer> PD;
   OwningPtr<PathDiagnosticConsumer> PD;
 
 
@@ -148,8 +148,8 @@ public:
     return Diags;
     return Diags;
   }
   }
 
 
-  const LangOptions &getLangOptions() const {
-    return LangInfo;
+  const LangOptions &getLangOpts() const {
+    return LangOpts;
   }
   }
 
 
   virtual PathDiagnosticConsumer *getPathDiagnosticConsumer() {
   virtual PathDiagnosticConsumer *getPathDiagnosticConsumer() {

+ 2 - 2
include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h

@@ -78,8 +78,8 @@ public:
     return Eng.getContext();
     return Eng.getContext();
   }
   }
 
 
-  const LangOptions &getLangOptions() const {
-    return Eng.getContext().getLangOptions();
+  const LangOptions &getLangOpts() const {
+    return Eng.getContext().getLangOpts();
   }
   }
 
 
   const LocationContext *getLocationContext() const {
   const LocationContext *getLocationContext() const {

+ 7 - 7
lib/ARCMigrate/ARCMT.cpp

@@ -211,7 +211,7 @@ static void emitPremigrationErrors(const CapturedDiagList &arcDiags,
       new DiagnosticsEngine(DiagID, &printer, /*ShouldOwnClient=*/false));
       new DiagnosticsEngine(DiagID, &printer, /*ShouldOwnClient=*/false));
   Diags->setSourceManager(&PP.getSourceManager());
   Diags->setSourceManager(&PP.getSourceManager());
   
   
-  printer.BeginSourceFile(PP.getLangOptions(), &PP);
+  printer.BeginSourceFile(PP.getLangOpts(), &PP);
   arcDiags.reportDiagnostics(*Diags);
   arcDiags.reportDiagnostics(*Diags);
   printer.EndSourceFile();
   printer.EndSourceFile();
 }
 }
@@ -264,7 +264,7 @@ bool arcmt::checkForManualIssues(CompilerInvocation &origCI,
 
 
   if (Diags->hasFatalErrorOccurred()) {
   if (Diags->hasFatalErrorOccurred()) {
     Diags->Reset();
     Diags->Reset();
-    DiagClient->BeginSourceFile(Ctx.getLangOptions(), &Unit->getPreprocessor());
+    DiagClient->BeginSourceFile(Ctx.getLangOpts(), &Unit->getPreprocessor());
     capturedDiags.reportDiagnostics(*Diags);
     capturedDiags.reportDiagnostics(*Diags);
     DiagClient->EndSourceFile();
     DiagClient->EndSourceFile();
     return true;
     return true;
@@ -279,7 +279,7 @@ bool arcmt::checkForManualIssues(CompilerInvocation &origCI,
            I = capturedDiags.begin(), E = capturedDiags.end(); I != E; ++I)
            I = capturedDiags.begin(), E = capturedDiags.end(); I != E; ++I)
       arcDiags.push_back(*I);
       arcDiags.push_back(*I);
     writeARCDiagsToPlist(plistOut, arcDiags,
     writeARCDiagsToPlist(plistOut, arcDiags,
-                         Ctx.getSourceManager(), Ctx.getLangOptions());
+                         Ctx.getSourceManager(), Ctx.getLangOpts());
   }
   }
 
 
   // After parsing of source files ended, we want to reuse the
   // After parsing of source files ended, we want to reuse the
@@ -287,7 +287,7 @@ bool arcmt::checkForManualIssues(CompilerInvocation &origCI,
   // We call BeginSourceFile because DiagnosticConsumer requires that 
   // We call BeginSourceFile because DiagnosticConsumer requires that 
   // diagnostics with source range information are emitted only in between
   // diagnostics with source range information are emitted only in between
   // BeginSourceFile() and EndSourceFile().
   // BeginSourceFile() and EndSourceFile().
-  DiagClient->BeginSourceFile(Ctx.getLangOptions(), &Unit->getPreprocessor());
+  DiagClient->BeginSourceFile(Ctx.getLangOpts(), &Unit->getPreprocessor());
 
 
   // No macros will be added since we are just checking and we won't modify
   // No macros will be added since we are just checking and we won't modify
   // source code.
   // source code.
@@ -573,7 +573,7 @@ bool MigrationProcess::applyTransform(TransformFn trans,
 
 
   if (Diags->hasFatalErrorOccurred()) {
   if (Diags->hasFatalErrorOccurred()) {
     Diags->Reset();
     Diags->Reset();
-    DiagClient->BeginSourceFile(Ctx.getLangOptions(), &Unit->getPreprocessor());
+    DiagClient->BeginSourceFile(Ctx.getLangOpts(), &Unit->getPreprocessor());
     capturedDiags.reportDiagnostics(*Diags);
     capturedDiags.reportDiagnostics(*Diags);
     DiagClient->EndSourceFile();
     DiagClient->EndSourceFile();
     return true;
     return true;
@@ -584,9 +584,9 @@ bool MigrationProcess::applyTransform(TransformFn trans,
   // We call BeginSourceFile because DiagnosticConsumer requires that 
   // We call BeginSourceFile because DiagnosticConsumer requires that 
   // diagnostics with source range information are emitted only in between
   // diagnostics with source range information are emitted only in between
   // BeginSourceFile() and EndSourceFile().
   // BeginSourceFile() and EndSourceFile().
-  DiagClient->BeginSourceFile(Ctx.getLangOptions(), &Unit->getPreprocessor());
+  DiagClient->BeginSourceFile(Ctx.getLangOpts(), &Unit->getPreprocessor());
 
 
-  Rewriter rewriter(Ctx.getSourceManager(), Ctx.getLangOptions());
+  Rewriter rewriter(Ctx.getSourceManager(), Ctx.getLangOpts());
   TransformActions TA(*Diags, capturedDiags, Ctx, Unit->getPreprocessor());
   TransformActions TA(*Diags, capturedDiags, Ctx, Unit->getPreprocessor());
   MigrationPass pass(Ctx, OrigCI.getLangOpts()->getGC(),
   MigrationPass pass(Ctx, OrigCI.getLangOpts()->getGC(),
                      Unit->getSema(), TA, ARCMTMacroLocs);
                      Unit->getSema(), TA, ARCMTMacroLocs);

+ 2 - 2
lib/ARCMigrate/ObjCMT.cpp

@@ -58,7 +58,7 @@ protected:
   virtual void Initialize(ASTContext &Context) {
   virtual void Initialize(ASTContext &Context) {
     NSAPIObj.reset(new NSAPI(Context));
     NSAPIObj.reset(new NSAPI(Context));
     Editor.reset(new edit::EditedSource(Context.getSourceManager(),
     Editor.reset(new edit::EditedSource(Context.getSourceManager(),
-                                        Context.getLangOptions(),
+                                        Context.getLangOpts(),
                                         PPRec));
                                         PPRec));
   }
   }
 
 
@@ -180,7 +180,7 @@ public:
 }
 }
 
 
 void ObjCMigrateASTConsumer::HandleTranslationUnit(ASTContext &Ctx) {
 void ObjCMigrateASTConsumer::HandleTranslationUnit(ASTContext &Ctx) {
-  Rewriter rewriter(Ctx.getSourceManager(), Ctx.getLangOptions());
+  Rewriter rewriter(Ctx.getSourceManager(), Ctx.getLangOpts());
   RewritesReceiver Rec(rewriter);
   RewritesReceiver Rec(rewriter);
   Editor->applyRewrites(Rec);
   Editor->applyRewrites(Rec);
 
 

+ 1 - 1
lib/ARCMigrate/TransBlockObjCVariable.cpp

@@ -54,7 +54,7 @@ class RootBlockObjCVarRewriter :
           if (castE->getCastKind() == CK_LValueToRValue)
           if (castE->getCastKind() == CK_LValueToRValue)
             return true; // Using the value of the variable.
             return true; // Using the value of the variable.
           if (castE->getCastKind() == CK_NoOp && castE->isLValue() &&
           if (castE->getCastKind() == CK_NoOp && castE->isLValue() &&
-              Var->getASTContext().getLangOptions().CPlusPlus)
+              Var->getASTContext().getLangOpts().CPlusPlus)
             return true; // Binding to const C++ reference.
             return true; // Binding to const C++ reference.
         }
         }
       }
       }

+ 1 - 1
lib/ARCMigrate/TransGCAttrs.cpp

@@ -97,7 +97,7 @@ public:
     bool Invalid = false;
     bool Invalid = false;
     StringRef Spell = Lexer::getSpelling(
     StringRef Spell = Lexer::getSpelling(
                                   SM.getSpellingLoc(TL.getAttrEnumOperandLoc()),
                                   SM.getSpellingLoc(TL.getAttrEnumOperandLoc()),
-                                  Buf, SM, Ctx.getLangOptions(), &Invalid);
+                                  Buf, SM, Ctx.getLangOpts(), &Invalid);
     if (Invalid)
     if (Invalid)
       return false;
       return false;
     MigrationContext::GCAttrOccurrence::AttrKind Kind;
     MigrationContext::GCAttrOccurrence::AttrKind Kind;

+ 1 - 1
lib/ARCMigrate/TransRetainReleaseDealloc.cpp

@@ -173,7 +173,7 @@ private:
       return;
       return;
     SourceManager &SM = Pass.Ctx.getSourceManager();
     SourceManager &SM = Pass.Ctx.getSourceManager();
     StringRef MacroName = Lexer::getImmediateMacroName(Loc, SM,
     StringRef MacroName = Lexer::getImmediateMacroName(Loc, SM,
-                                                     Pass.Ctx.getLangOptions());
+                                                     Pass.Ctx.getLangOpts());
     bool isGCDOrXPC = llvm::StringSwitch<bool>(MacroName)
     bool isGCDOrXPC = llvm::StringSwitch<bool>(MacroName)
         .Case("dispatch_retain", true)
         .Case("dispatch_retain", true)
         .Case("dispatch_release", true)
         .Case("dispatch_release", true)

+ 7 - 7
lib/ARCMigrate/Transforms.cpp

@@ -67,7 +67,7 @@ static bool isClassInWeakBlacklist(ObjCInterfaceDecl *cls) {
 
 
 bool trans::canApplyWeak(ASTContext &Ctx, QualType type,
 bool trans::canApplyWeak(ASTContext &Ctx, QualType type,
                          bool AllowOnUnknownClass) {
                          bool AllowOnUnknownClass) {
-  if (!Ctx.getLangOptions().ObjCRuntimeHasWeak)
+  if (!Ctx.getLangOpts().ObjCRuntimeHasWeak)
     return false;
     return false;
 
 
   QualType T = type;
   QualType T = type;
@@ -111,10 +111,10 @@ SourceLocation trans::findSemiAfterLocation(SourceLocation loc,
                                             ASTContext &Ctx) {
                                             ASTContext &Ctx) {
   SourceManager &SM = Ctx.getSourceManager();
   SourceManager &SM = Ctx.getSourceManager();
   if (loc.isMacroID()) {
   if (loc.isMacroID()) {
-    if (!Lexer::isAtEndOfMacroExpansion(loc, SM, Ctx.getLangOptions(), &loc))
+    if (!Lexer::isAtEndOfMacroExpansion(loc, SM, Ctx.getLangOpts(), &loc))
       return SourceLocation();
       return SourceLocation();
   }
   }
-  loc = Lexer::getLocForEndOfToken(loc, /*Offset=*/0, SM, Ctx.getLangOptions());
+  loc = Lexer::getLocForEndOfToken(loc, /*Offset=*/0, SM, Ctx.getLangOpts());
 
 
   // Break down the source location.
   // Break down the source location.
   std::pair<FileID, unsigned> locInfo = SM.getDecomposedLoc(loc);
   std::pair<FileID, unsigned> locInfo = SM.getDecomposedLoc(loc);
@@ -129,7 +129,7 @@ SourceLocation trans::findSemiAfterLocation(SourceLocation loc,
 
 
   // Lex from the start of the given location.
   // Lex from the start of the given location.
   Lexer lexer(SM.getLocForStartOfFile(locInfo.first),
   Lexer lexer(SM.getLocForStartOfFile(locInfo.first),
-              Ctx.getLangOptions(),
+              Ctx.getLangOpts(),
               file.begin(), tokenBegin, file.end());
               file.begin(), tokenBegin, file.end());
   Token tok;
   Token tok;
   lexer.LexFromRawLexer(tok);
   lexer.LexFromRawLexer(tok);
@@ -375,7 +375,7 @@ bool MigrationContext::rewritePropertyAttribute(StringRef fromAttr,
 
 
   // Lex from the start of the given location.
   // Lex from the start of the given location.
   Lexer lexer(SM.getLocForStartOfFile(locInfo.first),
   Lexer lexer(SM.getLocForStartOfFile(locInfo.first),
-              Pass.Ctx.getLangOptions(),
+              Pass.Ctx.getLangOpts(),
               file.begin(), tokenBegin, file.end());
               file.begin(), tokenBegin, file.end());
   Token tok;
   Token tok;
   lexer.LexFromRawLexer(tok);
   lexer.LexFromRawLexer(tok);
@@ -458,7 +458,7 @@ bool MigrationContext::addPropertyAttribute(StringRef attr,
 
 
   // Lex from the start of the given location.
   // Lex from the start of the given location.
   Lexer lexer(SM.getLocForStartOfFile(locInfo.first),
   Lexer lexer(SM.getLocForStartOfFile(locInfo.first),
-              Pass.Ctx.getLangOptions(),
+              Pass.Ctx.getLangOpts(),
               file.begin(), tokenBegin, file.end());
               file.begin(), tokenBegin, file.end());
   Token tok;
   Token tok;
   lexer.LexFromRawLexer(tok);
   lexer.LexFromRawLexer(tok);
@@ -520,7 +520,7 @@ static void GCRewriteFinalize(MigrationPass &pass) {
                   "#if !__has_feature(objc_arc)\n");
                   "#if !__has_feature(objc_arc)\n");
         CharSourceRange::getTokenRange(FinalizeM->getSourceRange());
         CharSourceRange::getTokenRange(FinalizeM->getSourceRange());
         const SourceManager &SM = pass.Ctx.getSourceManager();
         const SourceManager &SM = pass.Ctx.getSourceManager();
-        const LangOptions &LangOpts = pass.Ctx.getLangOptions();
+        const LangOptions &LangOpts = pass.Ctx.getLangOpts();
         bool Invalid;
         bool Invalid;
         std::string str = "\n#endif\n";
         std::string str = "\n#endif\n";
         str += Lexer::getSourceText(
         str += Lexer::getSourceText(

+ 11 - 11
lib/AST/ASTContext.cpp

@@ -328,14 +328,14 @@ void ASTContext::PrintStats() const {
   llvm::errs() << NumImplicitCopyConstructorsDeclared << "/"
   llvm::errs() << NumImplicitCopyConstructorsDeclared << "/"
                << NumImplicitCopyConstructors
                << NumImplicitCopyConstructors
                << " implicit copy constructors created\n";
                << " implicit copy constructors created\n";
-  if (getLangOptions().CPlusPlus)
+  if (getLangOpts().CPlusPlus)
     llvm::errs() << NumImplicitMoveConstructorsDeclared << "/"
     llvm::errs() << NumImplicitMoveConstructorsDeclared << "/"
                  << NumImplicitMoveConstructors
                  << NumImplicitMoveConstructors
                  << " implicit move constructors created\n";
                  << " implicit move constructors created\n";
   llvm::errs() << NumImplicitCopyAssignmentOperatorsDeclared << "/"
   llvm::errs() << NumImplicitCopyAssignmentOperatorsDeclared << "/"
                << NumImplicitCopyAssignmentOperators
                << NumImplicitCopyAssignmentOperators
                << " implicit copy assignment operators created\n";
                << " implicit copy assignment operators created\n";
-  if (getLangOptions().CPlusPlus)
+  if (getLangOpts().CPlusPlus)
     llvm::errs() << NumImplicitMoveAssignmentOperatorsDeclared << "/"
     llvm::errs() << NumImplicitMoveAssignmentOperatorsDeclared << "/"
                  << NumImplicitMoveAssignmentOperators
                  << NumImplicitMoveAssignmentOperators
                  << " implicit move assignment operators created\n";
                  << " implicit move assignment operators created\n";
@@ -3190,7 +3190,7 @@ bool ASTContext::UnwrapSimilarPointerTypes(QualType &T1, QualType &T2) {
     return true;
     return true;
   }
   }
   
   
-  if (getLangOptions().ObjC1) {
+  if (getLangOpts().ObjC1) {
     const ObjCObjectPointerType *T1OPType = T1->getAs<ObjCObjectPointerType>(),
     const ObjCObjectPointerType *T1OPType = T1->getAs<ObjCObjectPointerType>(),
                                 *T2OPType = T2->getAs<ObjCObjectPointerType>();
                                 *T2OPType = T2->getAs<ObjCObjectPointerType>();
     if (T1OPType && T2OPType) {
     if (T1OPType && T2OPType) {
@@ -3769,7 +3769,7 @@ static RecordDecl *
 CreateRecordDecl(const ASTContext &Ctx, RecordDecl::TagKind TK,
 CreateRecordDecl(const ASTContext &Ctx, RecordDecl::TagKind TK,
                  DeclContext *DC, IdentifierInfo *Id) {
                  DeclContext *DC, IdentifierInfo *Id) {
   SourceLocation Loc;
   SourceLocation Loc;
-  if (Ctx.getLangOptions().CPlusPlus)
+  if (Ctx.getLangOpts().CPlusPlus)
     return CXXRecordDecl::Create(Ctx, TK, DC, Loc, Loc, Id);
     return CXXRecordDecl::Create(Ctx, TK, DC, Loc, Loc, Id);
   else
   else
     return RecordDecl::Create(Ctx, TK, DC, Loc, Loc, Id);
     return RecordDecl::Create(Ctx, TK, DC, Loc, Loc, Id);
@@ -3904,7 +3904,7 @@ QualType ASTContext::getBlockDescriptorExtendedType() const {
 bool ASTContext::BlockRequiresCopying(QualType Ty) const {
 bool ASTContext::BlockRequiresCopying(QualType Ty) const {
   if (Ty->isObjCRetainableType())
   if (Ty->isObjCRetainableType())
     return true;
     return true;
-  if (getLangOptions().CPlusPlus) {
+  if (getLangOpts().CPlusPlus) {
     if (const RecordType *RT = Ty->getAs<RecordType>()) {
     if (const RecordType *RT = Ty->getAs<RecordType>()) {
       CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
       CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
       return RD->hasConstCopyConstructor();
       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
   // information is not especially sensible, but we're stuck with it for
   // compatibility with GCC, although providing it breaks anything that
   // compatibility with GCC, although providing it breaks anything that
   // actually uses runtime introspection and wants to work on both runtimes...
   // 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 RecordDecl *RD = FD->getParent();
     const ASTRecordLayout &RL = Ctx->getASTRecordLayout(RD);
     const ASTRecordLayout &RL = Ctx->getASTRecordLayout(RD);
     S += llvm::utostr(RL.getFieldOffset(FD->getFieldIndex()));
     S += llvm::utostr(RL.getFieldOffset(FD->getFieldIndex()));
@@ -5118,10 +5118,10 @@ CanQualType ASTContext::getFromTargetType(unsigned Type) const {
 /// garbage collection attribute.
 /// garbage collection attribute.
 ///
 ///
 Qualifiers::GC ASTContext::getObjCGCAttrKind(QualType Ty) const {
 Qualifiers::GC ASTContext::getObjCGCAttrKind(QualType Ty) const {
-  if (getLangOptions().getGC() == LangOptions::NonGC)
+  if (getLangOpts().getGC() == LangOptions::NonGC)
     return Qualifiers::GCNone;
     return Qualifiers::GCNone;
 
 
-  assert(getLangOptions().ObjC1);
+  assert(getLangOpts().ObjC1);
   Qualifiers::GC GCAttrs = Ty.getObjCGCAttr();
   Qualifiers::GC GCAttrs = Ty.getObjCGCAttr();
 
 
   // Default behaviour under objective-C's gc is for ObjC pointers
   // 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.
 /// same. See 6.7.[2,3,5] for additional rules.
 bool ASTContext::typesAreCompatible(QualType LHS, QualType RHS,
 bool ASTContext::typesAreCompatible(QualType LHS, QualType RHS,
                                     bool CompareUnqualified) {
                                     bool CompareUnqualified) {
-  if (getLangOptions().CPlusPlus)
+  if (getLangOpts().CPlusPlus)
     return hasSameType(LHS, RHS);
     return hasSameType(LHS, RHS);
   
   
   return !mergeTypes(LHS, RHS, false, CompareUnqualified).isNull();
   return !mergeTypes(LHS, RHS, false, CompareUnqualified).isNull();
@@ -6568,7 +6568,7 @@ GVALinkage ASTContext::GetGVALinkageForFunction(const FunctionDecl *FD) {
   if (!FD->isInlined())
   if (!FD->isInlined())
     return External;
     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
     // GNU or C99 inline semantics. Determine whether this symbol should be
     // externally visible.
     // externally visible.
     if (FD->isInlineDefinitionExternallyVisible())
     if (FD->isInlineDefinitionExternallyVisible())
@@ -6600,7 +6600,7 @@ GVALinkage ASTContext::GetGVALinkageForVariable(const VarDecl *VD) {
     TSK = VD->getTemplateSpecializationKind();
     TSK = VD->getTemplateSpecializationKind();
 
 
   Linkage L = VD->getLinkage();
   Linkage L = VD->getLinkage();
-  if (L == ExternalLinkage && getLangOptions().CPlusPlus &&
+  if (L == ExternalLinkage && getLangOpts().CPlusPlus &&
       VD->getType()->getLinkage() == UniqueExternalLinkage)
       VD->getType()->getLinkage() == UniqueExternalLinkage)
     L = UniqueExternalLinkage;
     L = UniqueExternalLinkage;
 
 

+ 1 - 1
lib/AST/ASTDiagnostic.cpp

@@ -294,7 +294,7 @@ void clang::FormatASTNodeDiagnosticArgument(
       
       
       if (DC->isTranslationUnit()) {
       if (DC->isTranslationUnit()) {
         // FIXME: Get these strings from some localized place
         // FIXME: Get these strings from some localized place
-        if (Context.getLangOptions().CPlusPlus)
+        if (Context.getLangOpts().CPlusPlus)
           S = "the global namespace";
           S = "the global namespace";
         else
         else
           S = "the global scope";
           S = "the global scope";

+ 5 - 5
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 
     // The context we're importing from has an unsigned 'char'. If we're 
     // importing into a context with a signed 'char', translate to 
     // importing into a context with a signed 'char', translate to 
     // 'unsigned char' instead.
     // 'unsigned char' instead.
-    if (Importer.getToContext().getLangOptions().CharIsSigned)
+    if (Importer.getToContext().getLangOpts().CharIsSigned)
       return Importer.getToContext().UnsignedCharTy;
       return Importer.getToContext().UnsignedCharTy;
     
     
     return Importer.getToContext().CharTy;
     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 
     // The context we're importing from has an unsigned 'char'. If we're 
     // importing into a context with a signed 'char', translate to 
     // importing into a context with a signed 'char', translate to 
     // 'unsigned char' instead.
     // 'unsigned char' instead.
-    if (!Importer.getToContext().getLangOptions().CharIsSigned)
+    if (!Importer.getToContext().getLangOpts().CharIsSigned)
       return Importer.getToContext().SignedCharTy;
       return Importer.getToContext().SignedCharTy;
     
     
     return Importer.getToContext().CharTy;
     return Importer.getToContext().CharTy;
@@ -2243,7 +2243,7 @@ Decl *ASTNodeImporter::VisitEnumDecl(EnumDecl *D) {
   if (!SearchName && D->getTypedefNameForAnonDecl()) {
   if (!SearchName && D->getTypedefNameForAnonDecl()) {
     SearchName = Importer.Import(D->getTypedefNameForAnonDecl()->getDeclName());
     SearchName = Importer.Import(D->getTypedefNameForAnonDecl()->getDeclName());
     IDNS = Decl::IDNS_Ordinary;
     IDNS = Decl::IDNS_Ordinary;
-  } else if (Importer.getToContext().getLangOptions().CPlusPlus)
+  } else if (Importer.getToContext().getLangOpts().CPlusPlus)
     IDNS |= Decl::IDNS_Ordinary;
     IDNS |= Decl::IDNS_Ordinary;
   
   
   // We may already have an enum of the same name; try to find and match it.
   // 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()) {
   if (!SearchName && D->getTypedefNameForAnonDecl()) {
     SearchName = Importer.Import(D->getTypedefNameForAnonDecl()->getDeclName());
     SearchName = Importer.Import(D->getTypedefNameForAnonDecl()->getDeclName());
     IDNS = Decl::IDNS_Ordinary;
     IDNS = Decl::IDNS_Ordinary;
-  } else if (Importer.getToContext().getLangOptions().CPlusPlus)
+  } else if (Importer.getToContext().getLangOpts().CPlusPlus)
     IDNS |= Decl::IDNS_Ordinary;
     IDNS |= Decl::IDNS_Ordinary;
 
 
   // We may already have a record of the same name; try to find and match it.
   // 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.
           // Sema::IsOverload out to the AST library.
           
           
           // Function overloading is okay in C++.
           // Function overloading is okay in C++.
-          if (Importer.getToContext().getLangOptions().CPlusPlus)
+          if (Importer.getToContext().getLangOpts().CPlusPlus)
             continue;
             continue;
           
           
           // Complain about inconsistent function types.
           // Complain about inconsistent function types.

+ 22 - 22
lib/AST/Decl.cpp

@@ -222,7 +222,7 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D, LVFlags F) {
     //   and neither explicitly declared extern nor previously
     //   and neither explicitly declared extern nor previously
     //   declared to have external linkage; or
     //   declared to have external linkage; or
     // (there is no equivalent in C99)
     // (there is no equivalent in C99)
-    if (Context.getLangOptions().CPlusPlus &&
+    if (Context.getLangOpts().CPlusPlus &&
         Var->getType().isConstant(Context) && 
         Var->getType().isConstant(Context) && 
         Var->getStorageClass() != SC_Extern &&
         Var->getStorageClass() != SC_Extern &&
         Var->getStorageClass() != SC_PrivateExtern) {
         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
   //   scope and no storage-class specifier, its linkage is
   //   external.
   //   external.
   LinkageInfo LV;
   LinkageInfo LV;
-  LV.mergeVisibility(Context.getLangOptions().getVisibilityMode());
+  LV.mergeVisibility(Context.getLangOpts().getVisibilityMode());
 
 
   if (F.ConsiderVisibilityAttributes) {
   if (F.ConsiderVisibilityAttributes) {
     if (llvm::Optional<Visibility> Vis = D->getExplicitVisibility()) {
     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
     // Note that we don't want to make the variable non-external
     // because of this, but unique-external linkage suits us.
     // because of this, but unique-external linkage suits us.
-    if (Context.getLangOptions().CPlusPlus &&
+    if (Context.getLangOpts().CPlusPlus &&
         !Var->getDeclContext()->isExternCContext()) {
         !Var->getDeclContext()->isExternCContext()) {
       LinkageInfo TypeLV = getLVForType(Var->getType());
       LinkageInfo TypeLV = getLVForType(Var->getType());
       if (TypeLV.linkage() != ExternalLinkage)
       if (TypeLV.linkage() != ExternalLinkage)
@@ -342,7 +342,7 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D, LVFlags F) {
     if (Var->getStorageClass() == SC_PrivateExtern)
     if (Var->getStorageClass() == SC_PrivateExtern)
       LV.setVisibility(HiddenVisibility, true);
       LV.setVisibility(HiddenVisibility, true);
 
 
-    if (!Context.getLangOptions().CPlusPlus &&
+    if (!Context.getLangOpts().CPlusPlus &&
         (Var->getStorageClass() == SC_Extern ||
         (Var->getStorageClass() == SC_Extern ||
          Var->getStorageClass() == SC_PrivateExtern)) {
          Var->getStorageClass() == SC_PrivateExtern)) {
 
 
@@ -377,7 +377,7 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D, LVFlags F) {
     //   storage-class specifier, its linkage is determined exactly
     //   storage-class specifier, its linkage is determined exactly
     //   as if it were declared with the storage-class specifier
     //   as if it were declared with the storage-class specifier
     //   extern.
     //   extern.
-    if (!Context.getLangOptions().CPlusPlus &&
+    if (!Context.getLangOpts().CPlusPlus &&
         (Function->getStorageClass() == SC_Extern ||
         (Function->getStorageClass() == SC_Extern ||
          Function->getStorageClass() == SC_PrivateExtern ||
          Function->getStorageClass() == SC_PrivateExtern ||
          Function->getStorageClass() == SC_None)) {
          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
     // unique-external linkage, it's not legally usable from outside
     // this translation unit.  However, we should use the C linkage
     // this translation unit.  However, we should use the C linkage
     // rules instead for extern "C" declarations.
     // rules instead for extern "C" declarations.
-    if (Context.getLangOptions().CPlusPlus &&
+    if (Context.getLangOpts().CPlusPlus &&
         !Function->getDeclContext()->isExternCContext() &&
         !Function->getDeclContext()->isExternCContext() &&
         Function->getType()->getLinkage() == UniqueExternalLinkage)
         Function->getType()->getLinkage() == UniqueExternalLinkage)
       return LinkageInfo::uniqueExternal();
       return LinkageInfo::uniqueExternal();
@@ -447,7 +447,7 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D, LVFlags F) {
     // Consider -fvisibility unless the type has C linkage.
     // Consider -fvisibility unless the type has C linkage.
     if (F.ConsiderGlobalVisibility)
     if (F.ConsiderGlobalVisibility)
       F.ConsiderGlobalVisibility =
       F.ConsiderGlobalVisibility =
-        (Context.getLangOptions().CPlusPlus &&
+        (Context.getLangOpts().CPlusPlus &&
          !Tag->getDeclContext()->isExternCContext());
          !Tag->getDeclContext()->isExternCContext());
 
 
   //     - an enumerator belonging to an enumeration with external linkage;
   //     - an enumerator belonging to an enumeration with external linkage;
@@ -499,7 +499,7 @@ static LinkageInfo getLVForClassMember(const NamedDecl *D, LVFlags F) {
     return LinkageInfo::none();
     return LinkageInfo::none();
 
 
   LinkageInfo LV;
   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.
   // The flags we're going to use to compute the class's visibility.
   LVFlags ClassF = F;
   LVFlags ClassF = F;
@@ -563,7 +563,7 @@ static LinkageInfo getLVForClassMember(const NamedDecl *D, LVFlags F) {
     if (TSK != TSK_ExplicitInstantiationDeclaration &&
     if (TSK != TSK_ExplicitInstantiationDeclaration &&
         TSK != TSK_ExplicitInstantiationDefinition &&
         TSK != TSK_ExplicitInstantiationDefinition &&
         F.ConsiderGlobalVisibility &&
         F.ConsiderGlobalVisibility &&
-        MD->getASTContext().getLangOptions().InlineVisibilityHidden) {
+        MD->getASTContext().getLangOpts().InlineVisibilityHidden) {
       // InlineVisibilityHidden only applies to definitions, and
       // InlineVisibilityHidden only applies to definitions, and
       // isInlined() only gives meaningful answers on definitions
       // isInlined() only gives meaningful answers on definitions
       // anyway.
       // anyway.
@@ -845,7 +845,7 @@ static LinkageInfo getLVForDecl(const NamedDecl *D, LVFlags Flags) {
 }
 }
 
 
 std::string NamedDecl::getQualifiedNameAsString() const {
 std::string NamedDecl::getQualifiedNameAsString() const {
-  return getQualifiedNameAsString(getASTContext().getLangOptions());
+  return getQualifiedNameAsString(getASTContext().getLangOpts());
 }
 }
 
 
 std::string NamedDecl::getQualifiedNameAsString(const PrintingPolicy &P) const {
 std::string NamedDecl::getQualifiedNameAsString(const PrintingPolicy &P) const {
@@ -1207,7 +1207,7 @@ bool VarDecl::isExternC() const {
     return false;
     return false;
 
 
   ASTContext &Context = getASTContext();
   ASTContext &Context = getASTContext();
-  if (!Context.getLangOptions().CPlusPlus)
+  if (!Context.getLangOpts().CPlusPlus)
     return true;
     return true;
   return DC->isExternCContext();
   return DC->isExternCContext();
 }
 }
@@ -1260,7 +1260,7 @@ VarDecl::DefinitionKind VarDecl::isThisDeclarationADefinition(
   //   and without a storage class specifier or the scs 'static', constitutes
   //   and without a storage class specifier or the scs 'static', constitutes
   //   a tentative definition.
   //   a tentative definition.
   // No such thing in C++.
   // No such thing in C++.
-  if (!C.getLangOptions().CPlusPlus && isFileVarDecl())
+  if (!C.getLangOpts().CPlusPlus && isFileVarDecl())
     return TentativeDefinition;
     return TentativeDefinition;
 
 
   // What's left is (in C, block-scope) declarations without initializers or
   // 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 {
 bool VarDecl::isUsableInConstantExpressions(ASTContext &C) const {
-  const LangOptions &Lang = C.getLangOptions();
+  const LangOptions &Lang = C.getLangOpts();
 
 
   if (!Lang.CPlusPlus)
   if (!Lang.CPlusPlus)
     return false;
     return false;
@@ -1452,7 +1452,7 @@ APValue *VarDecl::evaluateValue(
 
 
   // In C++11, we have determined whether the initializer was a constant
   // In C++11, we have determined whether the initializer was a constant
   // expression as a side-effect.
   // expression as a side-effect.
-  if (getASTContext().getLangOptions().CPlusPlus0x && !Eval->CheckedICE) {
+  if (getASTContext().getLangOpts().CPlusPlus0x && !Eval->CheckedICE) {
     Eval->CheckedICE = true;
     Eval->CheckedICE = true;
     Eval->IsICE = Result && Notes.empty();
     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
   // In C++11, evaluate the initializer to check whether it's a constant
   // expression.
   // expression.
-  if (getASTContext().getLangOptions().CPlusPlus0x) {
+  if (getASTContext().getLangOpts().CPlusPlus0x) {
     llvm::SmallVector<PartialDiagnosticAt, 8> Notes;
     llvm::SmallVector<PartialDiagnosticAt, 8> Notes;
     evaluateValue(Notes);
     evaluateValue(Notes);
     return Eval->IsICE;
     return Eval->IsICE;
@@ -1693,7 +1693,7 @@ bool FunctionDecl::isMain() const {
   const TranslationUnitDecl *tunit =
   const TranslationUnitDecl *tunit =
     dyn_cast<TranslationUnitDecl>(getDeclContext()->getRedeclContext());
     dyn_cast<TranslationUnitDecl>(getDeclContext()->getRedeclContext());
   return tunit &&
   return tunit &&
-         !tunit->getASTContext().getLangOptions().Freestanding &&
+         !tunit->getASTContext().getLangOpts().Freestanding &&
          getIdentifier() &&
          getIdentifier() &&
          getIdentifier()->isStr("main");
          getIdentifier()->isStr("main");
 }
 }
@@ -1732,7 +1732,7 @@ bool FunctionDecl::isExternC() const {
     return false;
     return false;
 
 
   ASTContext &Context = getASTContext();
   ASTContext &Context = getASTContext();
-  if (!Context.getLangOptions().CPlusPlus)
+  if (!Context.getLangOpts().CPlusPlus)
     return true;
     return true;
 
 
   return isMain() || DC->isExternCContext();
   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
   // If this function is at translation-unit scope and we're not in
   // C++, it refers to the C library function.
   // C++, it refers to the C library function.
-  if (!Context.getLangOptions().CPlusPlus &&
+  if (!Context.getLangOpts().CPlusPlus &&
       getDeclContext()->isTranslationUnit())
       getDeclContext()->isTranslationUnit())
     return BuiltinID;
     return BuiltinID;
 
 
@@ -1875,7 +1875,7 @@ void FunctionDecl::setDeclsInPrototypeScope(llvm::ArrayRef<NamedDecl *> NewDecls
 /// function parameters, if some of the parameters have default
 /// function parameters, if some of the parameters have default
 /// arguments (in C++) or the last parameter is a parameter pack.
 /// arguments (in C++) or the last parameter is a parameter pack.
 unsigned FunctionDecl::getMinRequiredArguments() const {
 unsigned FunctionDecl::getMinRequiredArguments() const {
-  if (!getASTContext().getLangOptions().CPlusPlus)
+  if (!getASTContext().getLangOpts().CPlusPlus)
     return getNumParams();
     return getNumParams();
   
   
   unsigned NumRequiredArgs = getNumParams();  
   unsigned NumRequiredArgs = getNumParams();  
@@ -1965,7 +1965,7 @@ bool FunctionDecl::doesDeclarationForceExternallyVisibleDefinition() const {
 
 
   ASTContext &Context = getASTContext();
   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
     // With GNU inlining, a declaration with 'inline' but not 'extern', forces
     // an externally visible definition.
     // an externally visible definition.
     //
     //
@@ -1993,7 +1993,7 @@ bool FunctionDecl::doesDeclarationForceExternallyVisibleDefinition() const {
     return FoundBody;
     return FoundBody;
   }
   }
 
 
-  if (Context.getLangOptions().CPlusPlus)
+  if (Context.getLangOpts().CPlusPlus)
     return false;
     return false;
 
 
   // C99 6.7.4p6:
   // C99 6.7.4p6:
@@ -2034,7 +2034,7 @@ bool FunctionDecl::isInlineDefinitionExternallyVisible() const {
   assert(isInlined() && "Function must be inline");
   assert(isInlined() && "Function must be inline");
   ASTContext &Context = getASTContext();
   ASTContext &Context = getASTContext();
   
   
-  if (Context.getLangOptions().GNUInline || hasAttr<GNUInlineAttr>()) {
+  if (Context.getLangOpts().GNUInline || hasAttr<GNUInlineAttr>()) {
     // Note: If you change the logic here, please change
     // Note: If you change the logic here, please change
     // doesDeclarationForceExternallyVisibleDefinition as well.
     // doesDeclarationForceExternallyVisibleDefinition as well.
     //
     //

+ 1 - 1
lib/AST/DeclBase.cpp

@@ -423,7 +423,7 @@ bool Decl::canBeWeakImported(bool &IsDefinition) const {
     }
     }
   } else if (isa<ObjCPropertyDecl>(this) || isa<ObjCMethodDecl>(this))
   } else if (isa<ObjCPropertyDecl>(this) || isa<ObjCMethodDecl>(this))
     return false;
     return false;
-  else if (!(getASTContext().getLangOptions().ObjCNonFragileABI &&
+  else if (!(getASTContext().getLangOpts().ObjCNonFragileABI &&
              isa<ObjCInterfaceDecl>(this)))
              isa<ObjCInterfaceDecl>(this)))
     return false;
     return false;
 
 

+ 3 - 3
lib/AST/DeclCXX.cpp

@@ -636,7 +636,7 @@ NotASpecialMember:;
     // C++0x [dcl.init.aggr]p1:
     // C++0x [dcl.init.aggr]p1:
     //   An aggregate is an array or a class with no user-provided
     //   An aggregate is an array or a class with no user-provided
     //   constructors [...].
     //   constructors [...].
-    if (!getASTContext().getLangOptions().CPlusPlus0x || UserProvided)
+    if (!getASTContext().getLangOpts().CPlusPlus0x || UserProvided)
       data().Aggregate = false;
       data().Aggregate = false;
 
 
     // C++ [class]p4:
     // C++ [class]p4:
@@ -798,7 +798,7 @@ NotASpecialMember:;
     ASTContext &Context = getASTContext();
     ASTContext &Context = getASTContext();
     QualType T = Context.getBaseElementType(Field->getType());
     QualType T = Context.getBaseElementType(Field->getType());
     if (T->isObjCRetainableType() || T.isObjCGCStrong()) {
     if (T->isObjCRetainableType() || T.isObjCGCStrong()) {
-      if (!Context.getLangOptions().ObjCAutoRefCount ||
+      if (!Context.getLangOpts().ObjCAutoRefCount ||
           T.getObjCLifetime() != Qualifiers::OCL_ExplicitNone)
           T.getObjCLifetime() != Qualifiers::OCL_ExplicitNone)
         setHasObjectMember(true);
         setHasObjectMember(true);
     } else if (!T.isPODType(Context))
     } else if (!T.isPODType(Context))
@@ -1243,7 +1243,7 @@ void CXXRecordDecl::completeDefinition() {
 void CXXRecordDecl::completeDefinition(CXXFinalOverriderMap *FinalOverriders) {
 void CXXRecordDecl::completeDefinition(CXXFinalOverriderMap *FinalOverriders) {
   RecordDecl::completeDefinition();
   RecordDecl::completeDefinition();
   
   
-  if (hasObjectMember() && getASTContext().getLangOptions().ObjCAutoRefCount) {
+  if (hasObjectMember() && getASTContext().getLangOpts().ObjCAutoRefCount) {
     // Objective-C Automatic Reference Counting:
     // Objective-C Automatic Reference Counting:
     //   If a class has a non-static data member of Objective-C pointer
     //   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
     //   type (or array thereof), it is a non-POD type and its

+ 1 - 1
lib/AST/DeclObjC.cpp

@@ -628,7 +628,7 @@ void ObjCMethodDecl::createImplicitParams(ASTContext &Context,
   bool selfIsPseudoStrong = false;
   bool selfIsPseudoStrong = false;
   bool selfIsConsumed = false;
   bool selfIsConsumed = false;
   
   
-  if (Context.getLangOptions().ObjCAutoRefCount) {
+  if (Context.getLangOpts().ObjCAutoRefCount) {
     if (isInstanceMethod()) {
     if (isInstanceMethod()) {
       selfIsConsumed = hasAttr<NSConsumesSelfAttr>();
       selfIsConsumed = hasAttr<NSConsumesSelfAttr>();
 
 

+ 6 - 6
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
   //       -  an entity with reference type and is initialized with an
   //          expression that is value-dependent [C++11]
   //          expression that is value-dependent [C++11]
   if (VarDecl *Var = dyn_cast<VarDecl>(D)) {
   if (VarDecl *Var = dyn_cast<VarDecl>(D)) {
-    if ((Ctx.getLangOptions().CPlusPlus0x ?
+    if ((Ctx.getLangOpts().CPlusPlus0x ?
            Var->getType()->isLiteralType() :
            Var->getType()->isLiteralType() :
            Var->getType()->isIntegralOrEnumerationType()) &&
            Var->getType()->isIntegralOrEnumerationType()) &&
         (Var->getType().getCVRQualifiers() == Qualifiers::Const ||
         (Var->getType().getCVRQualifiers() == Qualifiers::Const ||
@@ -398,7 +398,7 @@ std::string PredefinedExpr::ComputeName(IdentType IT, const Decl *CurrentDecl) {
         Out << "static ";
         Out << "static ";
     }
     }
 
 
-    PrintingPolicy Policy(Context.getLangOptions());
+    PrintingPolicy Policy(Context.getLangOpts());
 
 
     std::string Proto = FD->getQualifiedNameAsString(Policy);
     std::string Proto = FD->getQualifiedNameAsString(Policy);
 
 
@@ -1750,7 +1750,7 @@ bool Expr::isUnusedResultAWarning(SourceLocation &Loc, SourceRange &R1,
 
 
   case ObjCMessageExprClass: {
   case ObjCMessageExprClass: {
     const ObjCMessageExpr *ME = cast<ObjCMessageExpr>(this);
     const ObjCMessageExpr *ME = cast<ObjCMessageExpr>(this);
-    if (Ctx.getLangOptions().ObjCAutoRefCount &&
+    if (Ctx.getLangOpts().ObjCAutoRefCount &&
         ME->isInstanceMessage() &&
         ME->isInstanceMessage() &&
         !ME->getType()->isVoidType() &&
         !ME->getType()->isVoidType() &&
         ME->getSelector().getIdentifierInfoForSlot(0) &&
         ME->getSelector().getIdentifierInfoForSlot(0) &&
@@ -2780,7 +2780,7 @@ Expr::isNullPointerConstant(ASTContext &Ctx,
 
 
   // Strip off a cast to void*, if it exists. Except in C++.
   // Strip off a cast to void*, if it exists. Except in C++.
   if (const ExplicitCastExpr *CE = dyn_cast<ExplicitCastExpr>(this)) {
   if (const ExplicitCastExpr *CE = dyn_cast<ExplicitCastExpr>(this)) {
-    if (!Ctx.getLangOptions().CPlusPlus) {
+    if (!Ctx.getLangOpts().CPlusPlus) {
       // Check that it is a cast to void*.
       // Check that it is a cast to void*.
       if (const PointerType *PT = CE->getType()->getAs<PointerType>()) {
       if (const PointerType *PT = CE->getType()->getAs<PointerType>()) {
         QualType Pointee = PT->getPointeeType();
         QualType Pointee = PT->getPointeeType();
@@ -2828,14 +2828,14 @@ Expr::isNullPointerConstant(ASTContext &Ctx,
       }
       }
   // This expression must be an integer type.
   // This expression must be an integer type.
   if (!getType()->isIntegerType() || 
   if (!getType()->isIntegerType() || 
-      (Ctx.getLangOptions().CPlusPlus && getType()->isEnumeralType()))
+      (Ctx.getLangOpts().CPlusPlus && getType()->isEnumeralType()))
     return NPCK_NotNull;
     return NPCK_NotNull;
 
 
   // If we have an integer constant expression, we need to *evaluate* it and
   // 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
   // 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
   // for this, for now; once the dust settles on core issue 903, we might only
   // allow a literal 0 here in C++11 mode.
   // allow a literal 0 here in C++11 mode.
-  if (Ctx.getLangOptions().CPlusPlus0x) {
+  if (Ctx.getLangOpts().CPlusPlus0x) {
     if (!isCXX98IntegralConstantExpr(Ctx))
     if (!isCXX98IntegralConstantExpr(Ctx))
       return NPCK_NotNull;
       return NPCK_NotNull;
   } else {
   } else {

+ 10 - 10
lib/AST/ExprClassification.cpp

@@ -55,7 +55,7 @@ Cl Expr::ClassifyImpl(ASTContext &Ctx, SourceLocation *Loc) const {
   Cl::Kinds kind = ClassifyInternal(Ctx, this);
   Cl::Kinds kind = ClassifyInternal(Ctx, this);
   // C99 6.3.2.1: An lvalue is an expression with an object type or an
   // C99 6.3.2.1: An lvalue is an expression with an object type or an
   //   incomplete type other than void.
   //   incomplete type other than void.
-  if (!Ctx.getLangOptions().CPlusPlus) {
+  if (!Ctx.getLangOpts().CPlusPlus) {
     // Thus, no functions.
     // Thus, no functions.
     if (TR->isFunctionType() || TR == Ctx.OverloadTy)
     if (TR->isFunctionType() || TR == Ctx.OverloadTy)
       kind = Cl::CL_Function;
       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) {
 static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) {
   // This function takes the first stab at classifying expressions.
   // This function takes the first stab at classifying expressions.
-  const LangOptions &Lang = Ctx.getLangOptions();
+  const LangOptions &Lang = Ctx.getLangOpts();
 
 
   switch (E->getStmtClass()) {
   switch (E->getStmtClass()) {
   case Stmt::NoStmtClass:
   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.
     // C99 6.5.2.5p5 says that compound literals are lvalues.
     // In C++, they're class temporaries.
     // In C++, they're class temporaries.
   case Expr::CompoundLiteralExprClass:
   case Expr::CompoundLiteralExprClass:
-    return Ctx.getLangOptions().CPlusPlus? Cl::CL_ClassTemporary 
+    return Ctx.getLangOpts().CPlusPlus? Cl::CL_ClassTemporary 
                                          : Cl::CL_LValue;
                                          : Cl::CL_LValue;
 
 
     // Expressions that are prvalues.
     // Expressions that are prvalues.
@@ -396,7 +396,7 @@ static Cl::Kinds ClassifyDecl(ASTContext &Ctx, const Decl *D) {
   else
   else
     islvalue = isa<VarDecl>(D) || isa<FieldDecl>(D) ||
     islvalue = isa<VarDecl>(D) || isa<FieldDecl>(D) ||
 	  isa<IndirectFieldDecl>(D) ||
 	  isa<IndirectFieldDecl>(D) ||
-      (Ctx.getLangOptions().CPlusPlus &&
+      (Ctx.getLangOpts().CPlusPlus &&
         (isa<FunctionDecl>(D) || isa<FunctionTemplateDecl>(D)));
         (isa<FunctionDecl>(D) || isa<FunctionTemplateDecl>(D)));
 
 
   return islvalue ? Cl::CL_LValue : Cl::CL_PRValue;
   return islvalue ? Cl::CL_LValue : Cl::CL_PRValue;
@@ -407,7 +407,7 @@ static Cl::Kinds ClassifyDecl(ASTContext &Ctx, const Decl *D) {
 /// calls and casts.
 /// calls and casts.
 static Cl::Kinds ClassifyUnnamed(ASTContext &Ctx, QualType T) {
 static Cl::Kinds ClassifyUnnamed(ASTContext &Ctx, QualType T) {
   // In C, function calls are always rvalues.
   // 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
   // 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
   //   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);
               ? Cl::CL_PRValue : Cl::CL_LValue);
 
 
   // Handle C first, it's easier.
   // Handle C first, it's easier.
-  if (!Ctx.getLangOptions().CPlusPlus) {
+  if (!Ctx.getLangOpts().CPlusPlus) {
     // C99 6.5.2.3p3
     // C99 6.5.2.3p3
     // For dot access, the expression is an lvalue if the first part is. For
     // For dot access, the expression is an lvalue if the first part is. For
     // arrow access, it always is an lvalue.
     // 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) {
 static Cl::Kinds ClassifyBinaryOp(ASTContext &Ctx, const BinaryOperator *E) {
-  assert(Ctx.getLangOptions().CPlusPlus &&
+  assert(Ctx.getLangOpts().CPlusPlus &&
          "This is only relevant for C++.");
          "This is only relevant for C++.");
   // C++ [expr.ass]p1: All [...] return an lvalue referring to the left operand.
   // C++ [expr.ass]p1: All [...] return an lvalue referring to the left operand.
   // Except we override this for writes to ObjC properties.
   // 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,
 static Cl::Kinds ClassifyConditional(ASTContext &Ctx, const Expr *True,
                                      const Expr *False) {
                                      const Expr *False) {
-  assert(Ctx.getLangOptions().CPlusPlus &&
+  assert(Ctx.getLangOpts().CPlusPlus &&
          "This is only relevant for C++.");
          "This is only relevant for C++.");
 
 
   // C++ [expr.cond]p2
   // C++ [expr.cond]p2
@@ -555,7 +555,7 @@ static Cl::ModifiableType IsModifiable(ASTContext &Ctx, const Expr *E,
 
 
   // This is the lvalue case.
   // This is the lvalue case.
   // Functions are lvalues in C++, but not modifiable. (C++ [basic.lval]p6)
   // 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;
     return Cl::CM_Function;
 
 
   // You cannot assign to a variable outside a block from within the block if
   // 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.
   // Records with any const fields (recursively) are not modifiable.
   if (const RecordType *R = CT->getAs<RecordType>()) {
   if (const RecordType *R = CT->getAs<RecordType>()) {
     assert((E->getObjectKind() == OK_ObjCProperty ||
     assert((E->getObjectKind() == OK_ObjCProperty ||
-            !Ctx.getLangOptions().CPlusPlus) &&
+            !Ctx.getLangOpts().CPlusPlus) &&
            "C++ struct assignment should be resolved by the "
            "C++ struct assignment should be resolved by the "
            "copy assignment operator.");
            "copy assignment operator.");
     if (R->hasConstFields())
     if (R->hasConstFields())

+ 9 - 9
lib/AST/ExprConstant.cpp

@@ -412,7 +412,7 @@ namespace {
       EvaluatingDeclValue = &Value;
       EvaluatingDeclValue = &Value;
     }
     }
 
 
-    const LangOptions &getLangOpts() const { return Ctx.getLangOptions(); }
+    const LangOptions &getLangOpts() const { return Ctx.getLangOpts(); }
 
 
     bool CheckCallLimit(SourceLocation Loc) {
     bool CheckCallLimit(SourceLocation Loc) {
       // Don't perform any constexpr calls (other than the call we're checking)
       // 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
   // FIXME: Evaluating values of large array and record types can cause
   // performance problems. Only do so in C++11 for now.
   // performance problems. Only do so in C++11 for now.
   if (isRValue() && (getType()->isArrayType() || getType()->isRecordType()) &&
   if (isRValue() && (getType()->isArrayType() || getType()->isRecordType()) &&
-      !Ctx.getLangOptions().CPlusPlus0x)
+      !Ctx.getLangOpts().CPlusPlus0x)
     return false;
     return false;
 
 
   EvalInfo Info(Ctx, Result);
   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
   // FIXME: Evaluating initializers for large array and record types can cause
   // performance problems. Only do so in C++11 for now.
   // performance problems. Only do so in C++11 for now.
   if (isRValue() && (getType()->isArrayType() || getType()->isRecordType()) &&
   if (isRValue() && (getType()->isArrayType() || getType()->isRecordType()) &&
-      !Ctx.getLangOptions().CPlusPlus0x)
+      !Ctx.getLangOpts().CPlusPlus0x)
     return false;
     return false;
 
 
   Expr::EvalStatus EStatus;
   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
   //  Variables with static storage duration or thread storage duration shall be
   //  zero-initialized before any other initialization takes place.
   //  zero-initialized before any other initialization takes place.
   // This behavior is not present in C.
   // This behavior is not present in C.
-  if (Ctx.getLangOptions().CPlusPlus && !VD->hasLocalStorage() &&
+  if (Ctx.getLangOpts().CPlusPlus && !VD->hasLocalStorage() &&
       !VD->getType()->isReferenceType()) {
       !VD->getType()->isReferenceType()) {
     ImplicitValueInitExpr VIE(VD->getType());
     ImplicitValueInitExpr VIE(VD->getType());
     if (!EvaluateInPlace(Value, InitInfo, LVal, &VIE, CCEK_Constant,
     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()))
     if (isa<EnumConstantDecl>(cast<DeclRefExpr>(E)->getDecl()))
       return NoDiag();
       return NoDiag();
     const ValueDecl *D = dyn_cast<ValueDecl>(cast<DeclRefExpr>(E)->getDecl());
     const ValueDecl *D = dyn_cast<ValueDecl>(cast<DeclRefExpr>(E)->getDecl());
-    if (Ctx.getLangOptions().CPlusPlus &&
+    if (Ctx.getLangOpts().CPlusPlus &&
         D && IsConstNonVolatile(D->getType())) {
         D && IsConstNonVolatile(D->getType())) {
       // Parameter variables are never constants.  Without this check,
       // Parameter variables are never constants.  Without this check,
       // getAnyInitializer() can find a default argument, which leads
       // 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 (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
           // C99 6.6p3 introduces a strange edge case: comma can be in an ICE
           // if it isn't evaluated.
           // if it isn't evaluated.
           if (LHSResult.Val == 0 && RHSResult.Val == 0)
           if (LHSResult.Val == 0 && RHSResult.Val == 0)
@@ -6593,7 +6593,7 @@ static bool EvaluateCPlusPlus11IntegralConstantExpr(ASTContext &Ctx,
 }
 }
 
 
 bool Expr::isIntegerConstantExpr(ASTContext &Ctx, SourceLocation *Loc) const {
 bool Expr::isIntegerConstantExpr(ASTContext &Ctx, SourceLocation *Loc) const {
-  if (Ctx.getLangOptions().CPlusPlus0x)
+  if (Ctx.getLangOpts().CPlusPlus0x)
     return EvaluateCPlusPlus11IntegralConstantExpr(Ctx, this, 0, Loc);
     return EvaluateCPlusPlus11IntegralConstantExpr(Ctx, this, 0, Loc);
 
 
   ICEDiag d = CheckICE(this, Ctx);
   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,
 bool Expr::isIntegerConstantExpr(llvm::APSInt &Value, ASTContext &Ctx,
                                  SourceLocation *Loc, bool isEvaluated) const {
                                  SourceLocation *Loc, bool isEvaluated) const {
-  if (Ctx.getLangOptions().CPlusPlus0x)
+  if (Ctx.getLangOpts().CPlusPlus0x)
     return EvaluateCPlusPlus11IntegralConstantExpr(Ctx, this, &Value, Loc);
     return EvaluateCPlusPlus11IntegralConstantExpr(Ctx, this, &Value, Loc);
 
 
   if (!isIntegerConstantExpr(Ctx, Loc))
   if (!isIntegerConstantExpr(Ctx, Loc))
@@ -6624,7 +6624,7 @@ bool Expr::isCXX11ConstantExpr(ASTContext &Ctx, APValue *Result,
                                SourceLocation *Loc) const {
                                SourceLocation *Loc) const {
   // We support this checking in C++98 mode in order to diagnose compatibility
   // We support this checking in C++98 mode in order to diagnose compatibility
   // issues.
   // issues.
-  assert(Ctx.getLangOptions().CPlusPlus);
+  assert(Ctx.getLangOpts().CPlusPlus);
 
 
   // Build evaluation settings.
   // Build evaluation settings.
   Expr::EvalStatus Status;
   Expr::EvalStatus Status;

+ 2 - 2
lib/AST/ItaniumMangle.cpp

@@ -375,7 +375,7 @@ static bool isInCLinkageSpecification(const Decl *D) {
 
 
 bool ItaniumMangleContext::shouldMangleDeclName(const NamedDecl *D) {
 bool ItaniumMangleContext::shouldMangleDeclName(const NamedDecl *D) {
   // In C, functions with no attributes never need to be mangled. Fastpath them.
   // 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;
     return false;
 
 
   // Any decl can be declared with __asm("foo") on it, and this takes precedence
   // 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;
     return true;
 
 
   // Otherwise, no mangling is done outside C++ mode.
   // Otherwise, no mangling is done outside C++ mode.
-  if (!getASTContext().getLangOptions().CPlusPlus)
+  if (!getASTContext().getLangOpts().CPlusPlus)
     return false;
     return false;
 
 
   // Variables at global scope with non-internal linkage are not mangled
   // Variables at global scope with non-internal linkage are not mangled

+ 2 - 2
lib/AST/MicrosoftMangle.cpp

@@ -119,7 +119,7 @@ static bool isInCLinkageSpecification(const Decl *D) {
 
 
 bool MicrosoftMangleContext::shouldMangleDeclName(const NamedDecl *D) {
 bool MicrosoftMangleContext::shouldMangleDeclName(const NamedDecl *D) {
   // In C, functions with no attributes never need to be mangled. Fastpath them.
   // 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;
     return false;
 
 
   // Any decl can be declared with __asm("foo") on it, and this takes precedence
   // 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;
     return true;
 
 
   // Otherwise, no mangling is done outside C++ mode.
   // Otherwise, no mangling is done outside C++ mode.
-  if (!getASTContext().getLangOptions().CPlusPlus)
+  if (!getASTContext().getLangOpts().CPlusPlus)
     return false;
     return false;
 
 
   // Variables at global scope with internal linkage are not mangled.
   // Variables at global scope with internal linkage are not mangled.

+ 6 - 6
lib/AST/RecordLayoutBuilder.cpp

@@ -1396,7 +1396,7 @@ void RecordLayoutBuilder::InitializeLayout(const Decl *D) {
   IsMsStruct = D->hasAttr<MsStructAttr>();
   IsMsStruct = D->hasAttr<MsStructAttr>();
 
 
   // Honor the default struct packing maximum alignment flag.
   // Honor the default struct packing maximum alignment flag.
-  if (unsigned DefaultMaxFieldAlignment = Context.getLangOptions().PackStruct) {
+  if (unsigned DefaultMaxFieldAlignment = Context.getLangOpts().PackStruct) {
     MaxFieldAlignment = CharUnits::fromQuantity(DefaultMaxFieldAlignment);
     MaxFieldAlignment = CharUnits::fromQuantity(DefaultMaxFieldAlignment);
   }
   }
 
 
@@ -1658,7 +1658,7 @@ void RecordLayoutBuilder::LayoutWideBitField(uint64_t FieldSize,
                                              uint64_t TypeSize,
                                              uint64_t TypeSize,
                                              bool FieldPacked,
                                              bool FieldPacked,
                                              const FieldDecl *D) {
                                              const FieldDecl *D) {
-  assert(Context.getLangOptions().CPlusPlus &&
+  assert(Context.getLangOpts().CPlusPlus &&
          "Can only have wide bit-fields in C++!");
          "Can only have wide bit-fields in C++!");
 
 
   // Itanium C++ ABI 2.4:
   // Itanium C++ ABI 2.4:
@@ -1900,7 +1900,7 @@ void RecordLayoutBuilder::LayoutField(const FieldDecl *D) {
       ZeroLengthBitfield = 0;
       ZeroLengthBitfield = 0;
     }
     }
 
 
-    if (Context.getLangOptions().MSBitfields || IsMsStruct) {
+    if (Context.getLangOpts().MSBitfields || IsMsStruct) {
       // If MS bitfield layout is required, figure out what type is being
       // If MS bitfield layout is required, figure out what type is being
       // laid out and align the field to the width of that type.
       // 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.
   // 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)) {
     if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(D)) {
       // Compatibility with gcc requires a class (pod or non-pod)
       // Compatibility with gcc requires a class (pod or non-pod)
       // which is not empty but of size 0; such as having fields of
       // 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;
   ASTRecordLayouts[D] = NewEntry;
 
 
-  if (getLangOptions().DumpRecordLayouts) {
+  if (getLangOpts().DumpRecordLayouts) {
     llvm::errs() << "\n*** Dumping AST Record Layout\n";
     llvm::errs() << "\n*** Dumping AST Record Layout\n";
-    DumpRecordLayout(D, llvm::errs(), getLangOptions().DumpRecordLayoutsSimple);
+    DumpRecordLayout(D, llvm::errs(), getLangOpts().DumpRecordLayoutsSimple);
   }
   }
 
 
   return *NewEntry;
   return *NewEntry;

+ 2 - 2
lib/AST/StmtDumper.cpp

@@ -254,7 +254,7 @@ void StmtDumper::DumpDeclarator(Decl *D) {
 
 
     std::string Name = VD->getNameAsString();
     std::string Name = VD->getNameAsString();
     VD->getType().getAsStringInternal(Name,
     VD->getType().getAsStringInternal(Name,
-                          PrintingPolicy(VD->getASTContext().getLangOptions()));
+                          PrintingPolicy(VD->getASTContext().getLangOpts()));
     OS << Name;
     OS << Name;
 
 
     // If this is a vardecl with an initializer, emit it.
     // 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 " : "";
     const char *tn = UD->isTypeName() ? "typename " : "";
     OS << '"' << UD->getDeclKindName() << tn;
     OS << '"' << UD->getDeclKindName() << tn;
     UD->getQualifier()->print(OS,
     UD->getQualifier()->print(OS,
-                        PrintingPolicy(UD->getASTContext().getLangOptions()));
+                        PrintingPolicy(UD->getASTContext().getLangOpts()));
     OS << ";\"";
     OS << ";\"";
   } else if (LabelDecl *LD = dyn_cast<LabelDecl>(D)) {
   } else if (LabelDecl *LD = dyn_cast<LabelDecl>(D)) {
     OS << "label " << *LD;
     OS << "label " << *LD;

+ 1 - 1
lib/AST/StmtPrinter.cpp

@@ -1833,7 +1833,7 @@ void StmtPrinter::VisitAsTypeExpr(AsTypeExpr *Node) {
 
 
 void Stmt::dumpPretty(ASTContext& Context) const {
 void Stmt::dumpPretty(ASTContext& Context) const {
   printPretty(llvm::errs(), Context, 0,
   printPretty(llvm::errs(), Context, 0,
-              PrintingPolicy(Context.getLangOptions()));
+              PrintingPolicy(Context.getLangOpts()));
 }
 }
 
 
 void Stmt::printPretty(raw_ostream &OS, ASTContext& Context,
 void Stmt::printPretty(raw_ostream &OS, ASTContext& Context,

+ 7 - 7
lib/AST/Type.cpp

@@ -580,7 +580,7 @@ bool Type::isIntegralType(ASTContext &Ctx) const {
     return BT->getKind() >= BuiltinType::Bool &&
     return BT->getKind() >= BuiltinType::Bool &&
     BT->getKind() <= BuiltinType::Int128;
     BT->getKind() <= BuiltinType::Int128;
   
   
-  if (!Ctx.getLangOptions().CPlusPlus)
+  if (!Ctx.getLangOpts().CPlusPlus)
     if (const EnumType *ET = dyn_cast<EnumType>(CanonicalType))
     if (const EnumType *ET = dyn_cast<EnumType>(CanonicalType))
       return ET->getDecl()->isComplete(); // Complete enum types are integral in C.
       return ET->getDecl()->isComplete(); // Complete enum types are integral in C.
   
   
@@ -907,7 +907,7 @@ bool QualType::isPODType(ASTContext &Context) const {
   if ((*this)->isIncompleteType())
   if ((*this)->isIncompleteType())
     return false;
     return false;
 
 
-  if (Context.getLangOptions().ObjCAutoRefCount) {
+  if (Context.getLangOpts().ObjCAutoRefCount) {
     switch (getObjCLifetime()) {
     switch (getObjCLifetime()) {
     case Qualifiers::OCL_ExplicitNone:
     case Qualifiers::OCL_ExplicitNone:
       return true;
       return true;
@@ -969,7 +969,7 @@ bool QualType::isTrivialType(ASTContext &Context) const {
   if ((*this)->isIncompleteType())
   if ((*this)->isIncompleteType())
     return false;
     return false;
   
   
-  if (Context.getLangOptions().ObjCAutoRefCount) {
+  if (Context.getLangOpts().ObjCAutoRefCount) {
     switch (getObjCLifetime()) {
     switch (getObjCLifetime()) {
     case Qualifiers::OCL_ExplicitNone:
     case Qualifiers::OCL_ExplicitNone:
       return true;
       return true;
@@ -1019,7 +1019,7 @@ bool QualType::isTriviallyCopyableType(ASTContext &Context) const {
   if ((*this)->isArrayType())
   if ((*this)->isArrayType())
     return Context.getBaseElementType(*this).isTrivialType(Context);
     return Context.getBaseElementType(*this).isTrivialType(Context);
 
 
-  if (Context.getLangOptions().ObjCAutoRefCount) {
+  if (Context.getLangOpts().ObjCAutoRefCount) {
     switch (getObjCLifetime()) {
     switch (getObjCLifetime()) {
     case Qualifiers::OCL_ExplicitNone:
     case Qualifiers::OCL_ExplicitNone:
       return true;
       return true;
@@ -1164,7 +1164,7 @@ bool QualType::isCXX11PODType(ASTContext &Context) const {
   if (ty->isDependentType())
   if (ty->isDependentType())
     return false;
     return false;
 
 
-  if (Context.getLangOptions().ObjCAutoRefCount) {
+  if (Context.getLangOpts().ObjCAutoRefCount) {
     switch (getObjCLifetime()) {
     switch (getObjCLifetime()) {
     case Qualifiers::OCL_ExplicitNone:
     case Qualifiers::OCL_ExplicitNone:
       return true;
       return true;
@@ -1467,7 +1467,7 @@ QualType QualType::getNonLValueExprType(ASTContext &Context) const {
   //   have cv-unqualified types.
   //   have cv-unqualified types.
   //
   //
   // See also C99 6.3.2.1p2.
   // See also C99 6.3.2.1p2.
-  if (!Context.getLangOptions().CPlusPlus ||
+  if (!Context.getLangOpts().CPlusPlus ||
       (!getTypePtr()->isDependentType() && !getTypePtr()->isRecordType()))
       (!getTypePtr()->isDependentType() && !getTypePtr()->isRecordType()))
     return getUnqualifiedType();
     return getUnqualifiedType();
   
   
@@ -2234,7 +2234,7 @@ bool QualType::hasTrivialAssignment(ASTContext &Context, bool Copying) const {
   case Qualifiers::OCL_Autoreleasing:
   case Qualifiers::OCL_Autoreleasing:
   case Qualifiers::OCL_Strong:
   case Qualifiers::OCL_Strong:
   case Qualifiers::OCL_Weak:
   case Qualifiers::OCL_Weak:
-    return !Context.getLangOptions().ObjCAutoRefCount;
+    return !Context.getLangOpts().ObjCAutoRefCount;
   }
   }
   
   
   if (const CXXRecordDecl *Record 
   if (const CXXRecordDecl *Record 

+ 2 - 2
lib/AST/VTableBuilder.cpp

@@ -996,7 +996,7 @@ public:
 
 
     LayoutVTable();
     LayoutVTable();
 
 
-    if (Context.getLangOptions().DumpVTableLayouts)
+    if (Context.getLangOpts().DumpVTableLayouts)
       dumpLayout(llvm::errs());
       dumpLayout(llvm::errs());
   }
   }
 
 
@@ -1580,7 +1580,7 @@ void VTableBuilder::LayoutVTable() {
   LayoutVTablesForVirtualBases(MostDerivedClass, VBases);
   LayoutVTablesForVirtualBases(MostDerivedClass, VBases);
 
 
   // -fapple-kext adds an extra entry at end of vtbl.
   // -fapple-kext adds an extra entry at end of vtbl.
-  bool IsAppleKext = Context.getLangOptions().AppleKext;
+  bool IsAppleKext = Context.getLangOpts().AppleKext;
   if (IsAppleKext)
   if (IsAppleKext)
     Components.push_back(VTableComponent::MakeVCallOffset(CharUnits::Zero()));
     Components.push_back(VTableComponent::MakeVCallOffset(CharUnits::Zero()));
 }
 }

+ 1 - 1
lib/Analysis/AnalysisDeclContext.cpp

@@ -180,7 +180,7 @@ CFGReverseBlockReachabilityAnalysis *AnalysisDeclContext::getCFGReachablityAnaly
 }
 }
 
 
 void AnalysisDeclContext::dumpCFG(bool ShowColors) {
 void AnalysisDeclContext::dumpCFG(bool ShowColors) {
-    getCFG()->dump(getASTContext().getLangOptions(), ShowColors);
+    getCFG()->dump(getASTContext().getLangOpts(), ShowColors);
 }
 }
 
 
 ParentMap &AnalysisDeclContext::getParentMap() {
 ParentMap &AnalysisDeclContext::getParentMap() {

+ 1 - 1
lib/Analysis/CFG.cpp

@@ -1239,7 +1239,7 @@ CFGBlock *CFGBuilder::VisitCallExpr(CallExpr *C, AddStmtChoice asc) {
   bool AddEHEdge = false;
   bool AddEHEdge = false;
 
 
   // Languages without exceptions are assumed to not throw.
   // Languages without exceptions are assumed to not throw.
-  if (Context->getLangOptions().Exceptions) {
+  if (Context->getLangOpts().Exceptions) {
     if (BuildOpts.AddEHEdges)
     if (BuildOpts.AddEHEdges)
       AddEHEdge = true;
       AddEHEdge = true;
   }
   }

+ 8 - 8
lib/CodeGen/CGBlocks.cpp

@@ -92,7 +92,7 @@ static llvm::Constant *buildBlockDescriptor(CodeGenModule &CGM,
                           CGM.GetAddrOfConstantCString(typeAtEncoding), i8p));
                           CGM.GetAddrOfConstantCString(typeAtEncoding), i8p));
   
   
   // GC layout.
   // GC layout.
-  if (C.getLangOptions().ObjC1)
+  if (C.getLangOpts().ObjC1)
     elements.push_back(CGM.getObjCRuntime().BuildGCBlockLayout(CGM, blockInfo));
     elements.push_back(CGM.getObjCRuntime().BuildGCBlockLayout(CGM, blockInfo));
   else
   else
     elements.push_back(llvm::Constant::getNullValue(i8p));
     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
   //   Except that any class member declared mutable can be
   //   modified, any attempt to modify a const object during its
   //   modified, any attempt to modify a const object during its
   //   lifetime results in undefined behavior.
   //   lifetime results in undefined behavior.
-  if (CGM.getLangOptions().CPlusPlus && !isSafeForCXXConstantCapture(type))
+  if (CGM.getLangOpts().CPlusPlus && !isSafeForCXXConstantCapture(type))
     return 0;
     return 0;
 
 
   // If the variable doesn't have any initializer (shouldn't this be
   // 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;
       info.HasCXXObject = true;
 
 
     // And so do types with destructors.
     // And so do types with destructors.
-    } else if (CGM.getLangOptions().CPlusPlus) {
+    } else if (CGM.getLangOpts().CPlusPlus) {
       if (const CXXRecordDecl *record =
       if (const CXXRecordDecl *record =
             variable->getType()->getAsCXXRecordDecl()) {
             variable->getType()->getAsCXXRecordDecl()) {
         if (!record->hasTrivialDestructor()) {
         if (!record->hasTrivialDestructor()) {
@@ -1251,7 +1251,7 @@ CodeGenFunction::GenerateCopyHelperFunction(const CGBlockInfo &blockInfo) {
         flags = BLOCK_FIELD_IS_BLOCK;
         flags = BLOCK_FIELD_IS_BLOCK;
 
 
       // Special rules for ARC captures:
       // Special rules for ARC captures:
-      if (getLangOptions().ObjCAutoRefCount) {
+      if (getLangOpts().ObjCAutoRefCount) {
         Qualifiers qs = type.getQualifiers();
         Qualifiers qs = type.getQualifiers();
 
 
         // Don't generate special copy logic for a captured object
         // Don't generate special copy logic for a captured object
@@ -1363,7 +1363,7 @@ CodeGenFunction::GenerateDestroyHelperFunction(const CGBlockInfo &blockInfo) {
         flags = BLOCK_FIELD_IS_BLOCK;
         flags = BLOCK_FIELD_IS_BLOCK;
 
 
       // Special rules for ARC captures.
       // Special rules for ARC captures.
-      if (getLangOptions().ObjCAutoRefCount) {
+      if (getLangOpts().ObjCAutoRefCount) {
         Qualifiers qs = type.getQualifiers();
         Qualifiers qs = type.getQualifiers();
 
 
         // Don't generate special dispose logic for a captured object
         // 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 we have lifetime, that dominates.
   if (Qualifiers::ObjCLifetime lifetime = qs.getObjCLifetime()) {
   if (Qualifiers::ObjCLifetime lifetime = qs.getObjCLifetime()) {
-    assert(getLangOptions().ObjCAutoRefCount);
+    assert(getLangOpts().ObjCAutoRefCount);
 
 
     switch (lifetime) {
     switch (lifetime) {
     case Qualifiers::OCL_None: llvm_unreachable("impossible");
     case Qualifiers::OCL_None: llvm_unreachable("impossible");
@@ -1979,7 +1979,7 @@ namespace {
 /// to be done externally.
 /// to be done externally.
 void CodeGenFunction::enterByrefCleanup(const AutoVarEmission &emission) {
 void CodeGenFunction::enterByrefCleanup(const AutoVarEmission &emission) {
   // We don't enter this cleanup if we're in pure-GC mode.
   // 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;
     return;
 
 
   EHStack.pushCleanup<CallBlockRelease>(NormalAndEHCleanup, emission.Address);
   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.
 /// Adjust the declaration of something from the blocks API.
 static void configureBlocksRuntimeObject(CodeGenModule &CGM,
 static void configureBlocksRuntimeObject(CodeGenModule &CGM,
                                          llvm::Constant *C) {
                                          llvm::Constant *C) {
-  if (!CGM.getLangOptions().BlocksRuntimeOptional) return;
+  if (!CGM.getLangOpts().BlocksRuntimeOptional) return;
 
 
   llvm::GlobalValue *GV = cast<llvm::GlobalValue>(C->stripPointerCasts());
   llvm::GlobalValue *GV = cast<llvm::GlobalValue>(C->stripPointerCasts());
   if (GV->isDeclaration() &&
   if (GV->isDeclaration() &&

+ 5 - 5
lib/CodeGen/CGCall.cpp

@@ -254,7 +254,7 @@ CodeGenTypes::arrangeObjCMessageSendSignature(const ObjCMethodDecl *MD,
   FunctionType::ExtInfo einfo;
   FunctionType::ExtInfo einfo;
   einfo = einfo.withCallingConv(getCallingConventionForDecl(MD));
   einfo = einfo.withCallingConv(getCallingConventionForDecl(MD));
 
 
-  if (getContext().getLangOptions().ObjCAutoRefCount &&
+  if (getContext().getLangOpts().ObjCAutoRefCount &&
       MD->hasAttr<NSReturnsRetainedAttr>())
       MD->hasAttr<NSReturnsRetainedAttr>())
     einfo = einfo.withProducesResult(true);
     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
     // In ARC, end functions that return a retainable type with a call
     // to objc_autoreleaseReturnValue.
     // to objc_autoreleaseReturnValue.
     if (AutoreleaseResult) {
     if (AutoreleaseResult) {
-      assert(getLangOptions().ObjCAutoRefCount &&
+      assert(getLangOpts().ObjCAutoRefCount &&
              !FI.isReturnsRetained() &&
              !FI.isReturnsRetained() &&
              RetTy->isObjCRetainableType());
              RetTy->isObjCRetainableType());
       RV = emitAutoreleaseOfResult(*this, RV);
       RV = emitAutoreleaseOfResult(*this, RV);
@@ -1662,7 +1662,7 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E,
                                   QualType type) {
                                   QualType type) {
   if (const ObjCIndirectCopyRestoreExpr *CRE
   if (const ObjCIndirectCopyRestoreExpr *CRE
         = dyn_cast<ObjCIndirectCopyRestoreExpr>(E)) {
         = dyn_cast<ObjCIndirectCopyRestoreExpr>(E)) {
-    assert(getContext().getLangOptions().ObjCAutoRefCount);
+    assert(getContext().getLangOpts().ObjCAutoRefCount);
     assert(getContext().hasSameType(E->getType(), type));
     assert(getContext().hasSameType(E->getType(), type));
     return emitWritebackArg(*this, args, CRE);
     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
   // In ObjC ARC mode with no ObjC ARC exception safety, tell the ARC
   // optimizer it can aggressively ignore unwind edges.
   // optimizer it can aggressively ignore unwind edges.
-  if (CGM.getLangOptions().ObjCAutoRefCount)
+  if (CGM.getLangOpts().ObjCAutoRefCount)
     AddObjCARCExceptionMetadata(Inst);
     AddObjCARCExceptionMetadata(Inst);
 
 
   return 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
   // In ObjC ARC mode with no ObjC ARC exception safety, tell the ARC
   // optimizer it can aggressively ignore unwind edges.
   // optimizer it can aggressively ignore unwind edges.
-  if (CGM.getLangOptions().ObjCAutoRefCount)
+  if (CGM.getLangOpts().ObjCAutoRefCount)
     AddObjCARCExceptionMetadata(CS.getInstruction());
     AddObjCARCExceptionMetadata(CS.getInstruction());
 
 
   // If the call doesn't return, finish the basic block and clear the
   // If the call doesn't return, finish the basic block and clear the

+ 7 - 7
lib/CodeGen/CGClass.cpp

@@ -405,7 +405,7 @@ static void EmitBaseInitializer(CodeGenFunction &CGF,
 
 
   CGF.EmitAggExpr(BaseInit->getInit(), AggSlot);
   CGF.EmitAggExpr(BaseInit->getInit(), AggSlot);
   
   
-  if (CGF.CGM.getLangOptions().Exceptions && 
+  if (CGF.CGM.getLangOpts().Exceptions && 
       !BaseClassDecl->hasTrivialDestructor())
       !BaseClassDecl->hasTrivialDestructor())
     CGF.EHStack.pushCleanup<CallBaseDtor>(EHCleanup, BaseClassDecl,
     CGF.EHStack.pushCleanup<CallBaseDtor>(EHCleanup, BaseClassDecl,
                                           isBaseVirtual);
                                           isBaseVirtual);
@@ -642,7 +642,7 @@ void CodeGenFunction::EmitInitializerForField(FieldDecl *Field,
     EmitAggMemberInitializer(*this, LHS, Init, ArrayIndexVar, FieldType,
     EmitAggMemberInitializer(*this, LHS, Init, ArrayIndexVar, FieldType,
                              ArrayIndexes, 0);
                              ArrayIndexes, 0);
     
     
-    if (!CGM.getLangOptions().Exceptions)
+    if (!CGM.getLangOpts().Exceptions)
       return;
       return;
 
 
     // FIXME: If we have an array of classes w/ non-trivial destructors, 
     // 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
     // -fapple-kext must inline any call to this dtor into
     // the caller's body.
     // the caller's body.
-    if (getContext().getLangOptions().AppleKext)
+    if (getContext().getLangOpts().AppleKext)
       CurFn->addFnAttr(llvm::Attribute::AlwaysInline);
       CurFn->addFnAttr(llvm::Attribute::AlwaysInline);
     break;
     break;
   }
   }
@@ -1172,7 +1172,7 @@ CodeGenFunction::EmitCXXAggrConstructorCall(const CXXConstructorDecl *ctor,
 
 
     // Evaluate the constructor and its arguments in a regular
     // Evaluate the constructor and its arguments in a regular
     // partial-destroy cleanup.
     // partial-destroy cleanup.
-    if (getLangOptions().Exceptions &&
+    if (getLangOpts().Exceptions &&
         !ctor->getParent()->hasTrivialDestructor()) {
         !ctor->getParent()->hasTrivialDestructor()) {
       Destroyer *destroyer = destroyCXXObject;
       Destroyer *destroyer = destroyCXXObject;
       pushRegularPartialArrayCleanup(arrayBegin, cur, type, *destroyer);
       pushRegularPartialArrayCleanup(arrayBegin, cur, type, *destroyer);
@@ -1376,7 +1376,7 @@ CodeGenFunction::EmitDelegatingCXXConstructorCall(const CXXConstructorDecl *Ctor
   EmitAggExpr(Ctor->init_begin()[0]->getInit(), AggSlot);
   EmitAggExpr(Ctor->init_begin()[0]->getInit(), AggSlot);
 
 
   const CXXRecordDecl *ClassDecl = Ctor->getParent();
   const CXXRecordDecl *ClassDecl = Ctor->getParent();
-  if (CGM.getLangOptions().Exceptions && !ClassDecl->hasTrivialDestructor()) {
+  if (CGM.getLangOpts().Exceptions && !ClassDecl->hasTrivialDestructor()) {
     CXXDtorType Type =
     CXXDtorType Type =
       CurGD.getCtorType() == Ctor_Complete ? Dtor_Complete : Dtor_Base;
       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), 
   llvm::Value *VTT = GetVTTParameter(*this, GlobalDecl(DD, Type), 
                                      ForVirtualBase);
                                      ForVirtualBase);
   llvm::Value *Callee = 0;
   llvm::Value *Callee = 0;
-  if (getContext().getLangOptions().AppleKext)
+  if (getContext().getLangOpts().AppleKext)
     Callee = BuildAppleKextVirtualDestructorCall(DD, Type, 
     Callee = BuildAppleKextVirtualDestructorCall(DD, Type, 
                                                  DD->getParent());
                                                  DD->getParent());
     
     
@@ -1711,7 +1711,7 @@ static bool UseVirtualCall(ASTContext &Context,
   
   
   // When building with -fapple-kext, all calls must go through the vtable since
   // When building with -fapple-kext, all calls must go through the vtable since
   // the kernel linker can do runtime patching of vtables.
   // the kernel linker can do runtime patching of vtables.
-  if (Context.getLangOptions().AppleKext)
+  if (Context.getLangOpts().AppleKext)
     return true;
     return true;
 
 
   return !canDevirtualizeMemberFunctionCall(CE->getArg(0), MD);
   return !canDevirtualizeMemberFunctionCall(CE->getArg(0), MD);

+ 10 - 10
lib/CodeGen/CGDebugInfo.cpp

@@ -183,7 +183,7 @@ CGDebugInfo::getClassName(const RecordDecl *RD) {
     NumArgs = TemplateArgs.size();
     NumArgs = TemplateArgs.size();
   }
   }
   Buffer = RD->getIdentifier()->getNameStart();
   Buffer = RD->getIdentifier()->getNameStart();
-  PrintingPolicy Policy(CGM.getLangOptions());
+  PrintingPolicy Policy(CGM.getLangOpts());
   Buffer += TemplateSpecializationType::PrintTemplateArgumentList(Args,
   Buffer += TemplateSpecializationType::PrintTemplateArgumentList(Args,
                                                                   NumArgs,
                                                                   NumArgs,
                                                                   Policy);
                                                                   Policy);
@@ -288,7 +288,7 @@ void CGDebugInfo::CreateCompileUnit() {
   StringRef Filename(FilenamePtr, MainFileName.length());
   StringRef Filename(FilenamePtr, MainFileName.length());
   
   
   unsigned LangTag;
   unsigned LangTag;
-  const LangOptions &LO = CGM.getLangOptions();
+  const LangOptions &LO = CGM.getLangOpts();
   if (LO.CPlusPlus) {
   if (LO.CPlusPlus) {
     if (LO.ObjC1)
     if (LO.ObjC1)
       LangTag = llvm::dwarf::DW_LANG_ObjC_plus_plus;
       LangTag = llvm::dwarf::DW_LANG_ObjC_plus_plus;
@@ -332,7 +332,7 @@ llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT) {
     llvm_unreachable("Unexpected builtin type");
     llvm_unreachable("Unexpected builtin type");
   case BuiltinType::NullPtr:
   case BuiltinType::NullPtr:
     return DBuilder.
     return DBuilder.
-      createNullPtrType(BT->getName(CGM.getContext().getLangOptions()));
+      createNullPtrType(BT->getName(CGM.getContext().getLangOpts()));
   case BuiltinType::Void:
   case BuiltinType::Void:
     return llvm::DIType();
     return llvm::DIType();
   case BuiltinType::ObjCClass:
   case BuiltinType::ObjCClass:
@@ -403,7 +403,7 @@ llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT) {
   case BuiltinType::ULong:     BTName = "long unsigned int"; break;
   case BuiltinType::ULong:     BTName = "long unsigned int"; break;
   case BuiltinType::ULongLong: BTName = "long long unsigned int"; break;
   case BuiltinType::ULongLong: BTName = "long long unsigned int"; break;
   default:
   default:
-    BTName = BT->getName(CGM.getContext().getLangOptions());
+    BTName = BT->getName(CGM.getContext().getLangOpts());
     break;
     break;
   }
   }
   // Bit size, align and offset of the type.
   // Bit size, align and offset of the type.
@@ -953,7 +953,7 @@ CGDebugInfo::CreateCXXMemberFunction(const CXXMethodDecl *Method,
                           MethodTy, /*isLocalToUnit=*/false, 
                           MethodTy, /*isLocalToUnit=*/false, 
                           /* isDefinition=*/ false,
                           /* isDefinition=*/ false,
                           Virtuality, VIndex, ContainingType,
                           Virtuality, VIndex, ContainingType,
-                          Flags, CGM.getLangOptions().Optimize);
+                          Flags, CGM.getLangOpts().Optimize);
   
   
   SPCache[Method->getCanonicalDecl()] = llvm::WeakVH(SP);
   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.
     // the non-fragile abi and the debugger should ignore the value anyways.
     // Call it the FieldNo+1 due to how debuggers use the information,
     // 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.
     // 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);
       : RL.getFieldOffset(FieldNo);
 
 
     unsigned Flags = 0;
     unsigned Flags = 0;
@@ -1996,7 +1996,7 @@ void CGDebugInfo::EmitFunctionStart(GlobalDecl GD, QualType FnType,
     DBuilder.createFunction(FDContext, Name, LinkageName, Unit,
     DBuilder.createFunction(FDContext, Name, LinkageName, Unit,
                             LineNo, getOrCreateFunctionType(D, FnType, Unit),
                             LineNo, getOrCreateFunctionType(D, FnType, Unit),
                             Fn->hasInternalLinkage(), true/*definition*/,
                             Fn->hasInternalLinkage(), true/*definition*/,
-                            Flags, CGM.getLangOptions().Optimize, Fn,
+                            Flags, CGM.getLangOpts().Optimize, Fn,
                             TParamsArray, SPDecl);
                             TParamsArray, SPDecl);
 
 
   // Push function on region stack.
   // Push function on region stack.
@@ -2227,7 +2227,7 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag,
     llvm::DIVariable D =
     llvm::DIVariable D =
       DBuilder.createLocalVariable(Tag, llvm::DIDescriptor(Scope), 
       DBuilder.createLocalVariable(Tag, llvm::DIDescriptor(Scope), 
                                    Name, Unit, Line, Ty, 
                                    Name, Unit, Line, Ty, 
-                                   CGM.getLangOptions().Optimize, Flags, ArgNo);
+                                   CGM.getLangOpts().Optimize, Flags, ArgNo);
     
     
     // Insert an llvm.dbg.declare into the current block.
     // Insert an llvm.dbg.declare into the current block.
     llvm::Instruction *Call =
     llvm::Instruction *Call =
@@ -2256,7 +2256,7 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag,
         llvm::DIVariable D =
         llvm::DIVariable D =
           DBuilder.createLocalVariable(Tag, llvm::DIDescriptor(Scope),
           DBuilder.createLocalVariable(Tag, llvm::DIDescriptor(Scope),
                                        FieldName, Unit, Line, FieldTy, 
                                        FieldName, Unit, Line, FieldTy, 
-                                       CGM.getLangOptions().Optimize, Flags,
+                                       CGM.getLangOpts().Optimize, Flags,
                                        ArgNo);
                                        ArgNo);
           
           
         // Insert an llvm.dbg.declare into the current block.
         // 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,
     DBuilder.createLocalVariable(llvm::dwarf::DW_TAG_arg_variable,
                                  llvm::DIDescriptor(scope), 
                                  llvm::DIDescriptor(scope), 
                                  name, tunit, line, type, 
                                  name, tunit, line, type, 
-                                 CGM.getLangOptions().Optimize, flags,
+                                 CGM.getLangOpts().Optimize, flags,
                                  cast<llvm::Argument>(addr)->getArgNo() + 1);
                                  cast<llvm::Argument>(addr)->getArgNo() + 1);
     
     
   // Insert an llvm.dbg.value into the current block.
   // Insert an llvm.dbg.value into the current block.

+ 5 - 5
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
     // 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.
     // standard way to agree on which variables are the same (i.e.
     // there's no mangling).
     // there's no mangling).
-    if (getContext().getLangOptions().CPlusPlus)
+    if (getContext().getLangOpts().CPlusPlus)
       if (llvm::GlobalValue::isWeakForLinker(CurFn->getLinkage()))
       if (llvm::GlobalValue::isWeakForLinker(CurFn->getLinkage()))
         Linkage = CurFn->getLinkage();
         Linkage = CurFn->getLinkage();
 
 
@@ -141,7 +141,7 @@ void CodeGenFunction::EmitVarDecl(const VarDecl &D) {
 static std::string GetStaticDeclName(CodeGenFunction &CGF, const VarDecl &D,
 static std::string GetStaticDeclName(CodeGenFunction &CGF, const VarDecl &D,
                                      const char *Separator) {
                                      const char *Separator) {
   CodeGenModule &CGM = CGF.CGM;
   CodeGenModule &CGM = CGF.CGM;
-  if (CGF.getContext().getLangOptions().CPlusPlus) {
+  if (CGF.getContext().getLangOpts().CPlusPlus) {
     StringRef Name = CGM.getMangledName(&D);
     StringRef Name = CGM.getMangledName(&D);
     return Name.str();
     return Name.str();
   }
   }
@@ -216,7 +216,7 @@ CodeGenFunction::AddInitializerToStaticVarDecl(const VarDecl &D,
   // If constant emission failed, then this should be a C++ static
   // If constant emission failed, then this should be a C++ static
   // initializer.
   // initializer.
   if (!Init) {
   if (!Init) {
-    if (!getContext().getLangOptions().CPlusPlus)
+    if (!getContext().getLangOpts().CPlusPlus)
       CGM.ErrorUnsupported(D.getInit(), "constant l-value expression");
       CGM.ErrorUnsupported(D.getInit(), "constant l-value expression");
     else if (Builder.GetInsertBlock()) {
     else if (Builder.GetInsertBlock()) {
       // Since we have a static initializer, this global variable can't
       // Since we have a static initializer, this global variable can't
@@ -770,7 +770,7 @@ CodeGenFunction::EmitAutoVarAlloca(const VarDecl &D) {
   llvm::Value *DeclPtr;
   llvm::Value *DeclPtr;
   if (Ty->isConstantSizeType()) {
   if (Ty->isConstantSizeType()) {
     if (!Target.useGlobalsForAutomaticVariables()) {
     if (!Target.useGlobalsForAutomaticVariables()) {
-      bool NRVO = getContext().getLangOptions().ElideConstructors &&
+      bool NRVO = getContext().getLangOpts().ElideConstructors &&
                   D.isNRVOVariable();
                   D.isNRVOVariable();
 
 
       // If this value is a POD array or struct with a statically
       // 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);
     emitAutoVarTypeCleanup(emission, dtorKind);
 
 
   // In GC mode, honor objc_precise_lifetime.
   // In GC mode, honor objc_precise_lifetime.
-  if (getLangOptions().getGC() != LangOptions::NonGC &&
+  if (getLangOpts().getGC() != LangOptions::NonGC &&
       D.hasAttr<ObjCPreciseLifetimeAttr>()) {
       D.hasAttr<ObjCPreciseLifetimeAttr>()) {
     EHStack.pushCleanup<ExtendGCLifetime>(NormalCleanup, &D);
     EHStack.pushCleanup<ExtendGCLifetime>(NormalCleanup, &D);
   }
   }

+ 3 - 3
lib/CodeGen/CGDeclCXX.cpp

@@ -199,14 +199,14 @@ CreateGlobalInitOrDestructFunction(CodeGenModule &CGM,
   llvm::Function *Fn =
   llvm::Function *Fn =
     llvm::Function::Create(FTy, llvm::GlobalValue::InternalLinkage,
     llvm::Function::Create(FTy, llvm::GlobalValue::InternalLinkage,
                            Name, &CGM.getModule());
                            Name, &CGM.getModule());
-  if (!CGM.getContext().getLangOptions().AppleKext) {
+  if (!CGM.getContext().getLangOpts().AppleKext) {
     // Set the section if needed.
     // Set the section if needed.
     if (const char *Section = 
     if (const char *Section = 
           CGM.getContext().getTargetInfo().getStaticInitSectionSpecifier())
           CGM.getContext().getTargetInfo().getStaticInitSectionSpecifier())
       Fn->setSection(Section);
       Fn->setSection(Section);
   }
   }
 
 
-  if (!CGM.getLangOptions().Exceptions)
+  if (!CGM.getLangOpts().Exceptions)
     Fn->setDoesNotThrow();
     Fn->setDoesNotThrow();
 
 
   return Fn;
   return Fn;
@@ -327,7 +327,7 @@ void CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn,
 
 
   // When building in Objective-C++ ARC mode, create an autorelease pool
   // When building in Objective-C++ ARC mode, create an autorelease pool
   // around the global initializers.
   // around the global initializers.
-  if (getLangOptions().ObjCAutoRefCount && getLangOptions().CPlusPlus) {    
+  if (getLangOpts().ObjCAutoRefCount && getLangOpts().CPlusPlus) {    
     llvm::Value *token = EmitObjCAutoreleasePoolPush();
     llvm::Value *token = EmitObjCAutoreleasePoolPush();
     EmitObjCAutoreleasePoolCleanup(token);
     EmitObjCAutoreleasePoolCleanup(token);
   }
   }

+ 13 - 13
lib/CodeGen/CGException.cpp

@@ -100,7 +100,7 @@ llvm::Constant *CodeGenFunction::getUnwindResumeFn() {
   llvm::FunctionType *FTy =
   llvm::FunctionType *FTy =
     llvm::FunctionType::get(VoidTy, Int8PtrTy, /*IsVarArgs=*/false);
     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_SjLj_Resume");
   return CGM.CreateRuntimeFunction(FTy, "_Unwind_Resume");
   return CGM.CreateRuntimeFunction(FTy, "_Unwind_Resume");
 }
 }
@@ -109,7 +109,7 @@ llvm::Constant *CodeGenFunction::getUnwindResumeOrRethrowFn() {
   llvm::FunctionType *FTy =
   llvm::FunctionType *FTy =
     llvm::FunctionType::get(VoidTy, Int8PtrTy, /*IsVarArgs=*/false);
     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_SjLj_Resume_or_Rethrow");
   return CGM.CreateRuntimeFunction(FTy, "_Unwind_Resume_or_Rethrow");
   return CGM.CreateRuntimeFunction(FTy, "_Unwind_Resume_or_Rethrow");
 }
 }
@@ -123,9 +123,9 @@ static llvm::Constant *getTerminateFn(CodeGenFunction &CGF) {
   StringRef name;
   StringRef name;
 
 
   // In C++, use std::terminate().
   // In C++, use std::terminate().
-  if (CGF.getLangOptions().CPlusPlus)
+  if (CGF.getLangOpts().CPlusPlus)
     name = "_ZSt9terminatev"; // FIXME: mangling!
     name = "_ZSt9terminatev"; // FIXME: mangling!
-  else if (CGF.getLangOptions().ObjC1 &&
+  else if (CGF.getLangOpts().ObjC1 &&
            CGF.CGM.getCodeGenOpts().ObjCRuntimeHasTerminate)
            CGF.CGM.getCodeGenOpts().ObjCRuntimeHasTerminate)
     name = "objc_terminate";
     name = "objc_terminate";
   else
   else
@@ -300,11 +300,11 @@ void CodeGenModule::SimplifyPersonality() {
     return;
     return;
 
 
   // If we're not in ObjC++ -fexceptions, there's nothing to do.
   // 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;
     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)
   if (&ObjCXX == &CXX)
     return;
     return;
 
 
@@ -470,7 +470,7 @@ void CodeGenFunction::EmitCXXThrowExpr(const CXXThrowExpr *E) {
 }
 }
 
 
 void CodeGenFunction::EmitStartEHSpec(const Decl *D) {
 void CodeGenFunction::EmitStartEHSpec(const Decl *D) {
-  if (!CGM.getLangOptions().CXXExceptions)
+  if (!CGM.getLangOpts().CXXExceptions)
     return;
     return;
   
   
   const FunctionDecl* FD = dyn_cast_or_null<FunctionDecl>(D);
   const FunctionDecl* FD = dyn_cast_or_null<FunctionDecl>(D);
@@ -538,7 +538,7 @@ static void emitFilterDispatchBlock(CodeGenFunction &CGF,
 }
 }
 
 
 void CodeGenFunction::EmitEndEHSpec(const Decl *D) {
 void CodeGenFunction::EmitEndEHSpec(const Decl *D) {
-  if (!CGM.getLangOptions().CXXExceptions)
+  if (!CGM.getLangOpts().CXXExceptions)
     return;
     return;
   
   
   const FunctionDecl* FD = dyn_cast_or_null<FunctionDecl>(D);
   const FunctionDecl* FD = dyn_cast_or_null<FunctionDecl>(D);
@@ -661,7 +661,7 @@ llvm::BasicBlock *CodeGenFunction::getInvokeDestImpl() {
   assert(EHStack.requiresLandingPad());
   assert(EHStack.requiresLandingPad());
   assert(!EHStack.empty());
   assert(!EHStack.empty());
 
 
-  if (!CGM.getLangOptions().Exceptions)
+  if (!CGM.getLangOpts().Exceptions)
     return 0;
     return 0;
 
 
   // Check the innermost scope for a cached landing pad.  If this is
   // 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.
   // Save the current IR generation state.
   CGBuilderTy::InsertPoint savedIP = Builder.saveAndClearIP();
   CGBuilderTy::InsertPoint savedIP = Builder.saveAndClearIP();
 
 
-  const EHPersonality &personality = EHPersonality::get(getLangOptions());
+  const EHPersonality &personality = EHPersonality::get(getLangOpts());
 
 
   // Create and configure the landing pad.
   // Create and configure the landing pad.
   llvm::BasicBlock *lpad = createBasicBlock("lpad");
   llvm::BasicBlock *lpad = createBasicBlock("lpad");
@@ -1494,7 +1494,7 @@ llvm::BasicBlock *CodeGenFunction::getTerminateLandingPad() {
   Builder.SetInsertPoint(TerminateLandingPad);
   Builder.SetInsertPoint(TerminateLandingPad);
 
 
   // Tell the backend that this is a landing pad.
   // 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 =
   llvm::LandingPadInst *LPadInst =
     Builder.CreateLandingPad(llvm::StructType::get(Int8PtrTy, Int32Ty, NULL),
     Builder.CreateLandingPad(llvm::StructType::get(Int8PtrTy, Int32Ty, NULL),
                              getOpaquePersonalityFn(CGM, Personality), 0);
                              getOpaquePersonalityFn(CGM, Personality), 0);
@@ -1541,7 +1541,7 @@ llvm::BasicBlock *CodeGenFunction::getEHResumeBlock() {
   EHResumeBlock = createBasicBlock("eh.resume");
   EHResumeBlock = createBasicBlock("eh.resume");
   Builder.SetInsertPoint(EHResumeBlock);
   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
   // This can always be a call because we necessarily didn't find
   // anything on the EH stack which needs our help.
   // anything on the EH stack which needs our help.

+ 10 - 10
lib/CodeGen/CGExpr.cpp

@@ -225,7 +225,7 @@ EmitExprForReferenceBinding(CodeGenFunction &CGF, const Expr *E,
     // Objective-C++ ARC:
     // Objective-C++ ARC:
     //   If we are binding a reference to a temporary that has ownership, we 
     //   If we are binding a reference to a temporary that has ownership, we 
     //   need to perform retain/release operations on the temporary.
     //   need to perform retain/release operations on the temporary.
-    if (CGF.getContext().getLangOptions().ObjCAutoRefCount &&        
+    if (CGF.getContext().getLangOpts().ObjCAutoRefCount &&        
         E->getType()->isObjCLifetimeType() &&
         E->getType()->isObjCLifetimeType() &&
         (E->getType().getObjCLifetime() == Qualifiers::OCL_Strong ||
         (E->getType().getObjCLifetime() == Qualifiers::OCL_Strong ||
          E->getType().getObjCLifetime() == Qualifiers::OCL_Weak ||
          E->getType().getObjCLifetime() == Qualifiers::OCL_Weak ||
@@ -1329,7 +1329,7 @@ void CodeGenFunction::EmitStoreThroughExtVectorComponentLValue(RValue Src,
 static void setObjCGCLValueClass(const ASTContext &Ctx, const Expr *E,
 static void setObjCGCLValueClass(const ASTContext &Ctx, const Expr *E,
                                  LValue &LV,
                                  LValue &LV,
                                  bool IsMemberAccess=false) {
                                  bool IsMemberAccess=false) {
-  if (Ctx.getLangOptions().getGC() == LangOptions::NonGC)
+  if (Ctx.getLangOpts().getGC() == LangOptions::NonGC)
     return;
     return;
   
   
   if (isa<ObjCIvarRefExpr>(E)) {
   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;
     // 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
     // But, we continue to generate __strong write barrier on indirect write
     // into a pointer to object.
     // 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.isObjCWeak())
       LV.setNonGC(!E->isOBJCGCCandidate(getContext()));
       LV.setNonGC(!E->isOBJCGCCandidate(getContext()));
     return LV;
     return LV;
@@ -1766,7 +1766,7 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) {
     // GEP indexes are signed, and scaling an index isn't permitted to
     // GEP indexes are signed, and scaling an index isn't permitted to
     // signed-overflow, so we use the same semantics for our explicit
     // signed-overflow, so we use the same semantics for our explicit
     // multiply.  We suppress this if overflow is not undefined behavior.
     // multiply.  We suppress this if overflow is not undefined behavior.
-    if (getLangOptions().isSignedOverflowDefined()) {
+    if (getLangOpts().isSignedOverflowDefined()) {
       Idx = Builder.CreateMul(Idx, numElements);
       Idx = Builder.CreateMul(Idx, numElements);
       Address = Builder.CreateGEP(Address, Idx, "arrayidx");
       Address = Builder.CreateGEP(Address, Idx, "arrayidx");
     } else {
     } else {
@@ -1801,14 +1801,14 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) {
     // Propagate the alignment from the array itself to the result.
     // Propagate the alignment from the array itself to the result.
     ArrayAlignment = ArrayLV.getAlignment();
     ArrayAlignment = ArrayLV.getAlignment();
 
 
-    if (getContext().getLangOptions().isSignedOverflowDefined())
+    if (getContext().getLangOpts().isSignedOverflowDefined())
       Address = Builder.CreateGEP(ArrayPtr, Args, "arrayidx");
       Address = Builder.CreateGEP(ArrayPtr, Args, "arrayidx");
     else
     else
       Address = Builder.CreateInBoundsGEP(ArrayPtr, Args, "arrayidx");
       Address = Builder.CreateInBoundsGEP(ArrayPtr, Args, "arrayidx");
   } else {
   } else {
     // The base must be a pointer, which is not an aggregate.  Emit it.
     // The base must be a pointer, which is not an aggregate.  Emit it.
     llvm::Value *Base = EmitScalarExpr(E->getBase());
     llvm::Value *Base = EmitScalarExpr(E->getBase());
-    if (getContext().getLangOptions().isSignedOverflowDefined())
+    if (getContext().getLangOpts().isSignedOverflowDefined())
       Address = Builder.CreateGEP(Base, Idx, "arrayidx");
       Address = Builder.CreateGEP(Base, Idx, "arrayidx");
     else
     else
       Address = Builder.CreateInBoundsGEP(Base, Idx, "arrayidx");
       Address = Builder.CreateInBoundsGEP(Base, Idx, "arrayidx");
@@ -1831,8 +1831,8 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E) {
 
 
   LV.getQuals().setAddressSpace(E->getBase()->getType().getAddressSpace());
   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()));
     LV.setNonGC(!E->isOBJCGCCandidate(getContext()));
     setObjCGCLValueClass(getContext(), E, LV);
     setObjCGCLValueClass(getContext(), E, LV);
   }
   }
@@ -2340,7 +2340,7 @@ RValue CodeGenFunction::EmitCallExpr(const CallExpr *E,
   if (const CXXPseudoDestructorExpr *PseudoDtor 
   if (const CXXPseudoDestructorExpr *PseudoDtor 
           = dyn_cast<CXXPseudoDestructorExpr>(E->getCallee()->IgnoreParens())) {
           = dyn_cast<CXXPseudoDestructorExpr>(E->getCallee()->IgnoreParens())) {
     QualType DestroyedType = PseudoDtor->getDestroyedType();
     QualType DestroyedType = PseudoDtor->getDestroyedType();
-    if (getContext().getLangOptions().ObjCAutoRefCount &&
+    if (getContext().getLangOpts().ObjCAutoRefCount &&
         DestroyedType->isObjCLifetimeType() &&
         DestroyedType->isObjCLifetimeType() &&
         (DestroyedType.getObjCLifetime() == Qualifiers::OCL_Strong ||
         (DestroyedType.getObjCLifetime() == Qualifiers::OCL_Strong ||
          DestroyedType.getObjCLifetime() == Qualifiers::OCL_Weak)) {
          DestroyedType.getObjCLifetime() == Qualifiers::OCL_Weak)) {

+ 5 - 5
lib/CodeGen/CGExprAgg.cpp

@@ -85,7 +85,7 @@ public:
                      QualType elementType, InitListExpr *E);
                      QualType elementType, InitListExpr *E);
 
 
   AggValueSlot::NeedsGCBarriers_t needsGC(QualType T) {
   AggValueSlot::NeedsGCBarriers_t needsGC(QualType T) {
-    if (CGF.getLangOptions().getGC() && TypeRequiresGCollection(T))
+    if (CGF.getLangOpts().getGC() && TypeRequiresGCollection(T))
       return AggValueSlot::NeedsGCBarriers;
       return AggValueSlot::NeedsGCBarriers;
     return AggValueSlot::DoesNotNeedGCBarriers;
     return AggValueSlot::DoesNotNeedGCBarriers;
   }
   }
@@ -254,7 +254,7 @@ void AggExprEmitter::EmitFinalDestCopy(const Expr *E, RValue Src, bool Ignore,
   // volatile.
   // volatile.
   if (Dest.isIgnored()) {
   if (Dest.isIgnored()) {
     if (!Src.isVolatileQualified() ||
     if (!Src.isVolatileQualified() ||
-        CGF.CGM.getLangOptions().CPlusPlus ||
+        CGF.CGM.getLangOpts().CPlusPlus ||
         (IgnoreResult && Ignore))
         (IgnoreResult && Ignore))
       return;
       return;
 
 
@@ -1123,7 +1123,7 @@ static void CheckAggExprForMemSetUse(AggValueSlot &Slot, const Expr *E,
   if (Slot.isZeroed() || Slot.isVolatile() || Slot.getAddr() == 0) return;
   if (Slot.isZeroed() || Slot.isVolatile() || Slot.getAddr() == 0) return;
 
 
   // C++ objects with a user-declared constructor don't need zero'ing.
   // 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()
     if (const RecordType *RT = CGF.getContext()
                        .getBaseElementType(E->getType())->getAs<RecordType>()) {
                        .getBaseElementType(E->getType())->getAs<RecordType>()) {
       const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
       const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
@@ -1195,7 +1195,7 @@ void CodeGenFunction::EmitAggregateCopy(llvm::Value *DestPtr,
                                         bool isVolatile, unsigned Alignment) {
                                         bool isVolatile, unsigned Alignment) {
   assert(!Ty->isAnyComplexType() && "Shouldn't happen for complex");
   assert(!Ty->isAnyComplexType() && "Shouldn't happen for complex");
 
 
-  if (getContext().getLangOptions().CPlusPlus) {
+  if (getContext().getLangOpts().CPlusPlus) {
     if (const RecordType *RT = Ty->getAs<RecordType>()) {
     if (const RecordType *RT = Ty->getAs<RecordType>()) {
       CXXRecordDecl *Record = cast<CXXRecordDecl>(RT->getDecl());
       CXXRecordDecl *Record = cast<CXXRecordDecl>(RT->getDecl());
       assert((Record->hasTrivialCopyConstructor() || 
       assert((Record->hasTrivialCopyConstructor() || 
@@ -1254,7 +1254,7 @@ void CodeGenFunction::EmitAggregateCopy(llvm::Value *DestPtr,
   SrcPtr = Builder.CreateBitCast(SrcPtr, SBP);
   SrcPtr = Builder.CreateBitCast(SrcPtr, SBP);
 
 
   // Don't do any of the memmove_collectable tests if GC isn't set.
   // 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
     // fall through
   } else if (const RecordType *RecordTy = Ty->getAs<RecordType>()) {
   } else if (const RecordType *RecordTy = Ty->getAs<RecordType>()) {
     RecordDecl *Record = RecordTy->getDecl();
     RecordDecl *Record = RecordTy->getDecl();

+ 5 - 5
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
   // When building with -fapple-kext, all calls must go through the vtable since
   // the kernel linker can do runtime patching of vtables.
   // the kernel linker can do runtime patching of vtables.
-  if (Context.getLangOptions().AppleKext)
+  if (Context.getLangOpts().AppleKext)
     return false;
     return false;
 
 
   // If the most derived class is marked final, we know that no subclass can
   // 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) {
     if (UseVirtualCall) {
       Callee = BuildVirtualCall(Dtor, Dtor_Complete, This, Ty);
       Callee = BuildVirtualCall(Dtor, Dtor_Complete, This, Ty);
     } else {
     } else {
-      if (getContext().getLangOptions().AppleKext &&
+      if (getContext().getLangOpts().AppleKext &&
           MD->isVirtual() &&
           MD->isVirtual() &&
           ME->hasQualifier())
           ME->hasQualifier())
         Callee = BuildAppleKextVirtualCall(MD, ME->getQualifier(), Ty);
         Callee = BuildAppleKextVirtualCall(MD, ME->getQualifier(), Ty);
@@ -269,7 +269,7 @@ RValue CodeGenFunction::EmitCXXMemberCallExpr(const CXXMemberCallExpr *CE,
   } else if (UseVirtualCall) {
   } else if (UseVirtualCall) {
       Callee = BuildVirtualCall(MD, This, Ty); 
       Callee = BuildVirtualCall(MD, This, Ty); 
   } else {
   } else {
-    if (getContext().getLangOptions().AppleKext &&
+    if (getContext().getLangOpts().AppleKext &&
         MD->isVirtual() &&
         MD->isVirtual() &&
         ME->hasQualifier())
         ME->hasQualifier())
       Callee = BuildAppleKextVirtualCall(MD, ME->getQualifier(), Ty);
       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.
   // Elide the constructor if we're constructing from a temporary.
   // The temporary check is required because Sema sets this on NRVO
   // The temporary check is required because Sema sets this on NRVO
   // returns.
   // returns.
-  if (getContext().getLangOptions().ElideConstructors && E->isElidable()) {
+  if (getContext().getLangOpts().ElideConstructors && E->isElidable()) {
     assert(getContext().hasSameUnqualifiedType(E->getType(),
     assert(getContext().hasSameUnqualifiedType(E->getType(),
                                                E->getArg(0)->getType()));
                                                E->getArg(0)->getType()));
     if (E->getArg(0)->isTemporaryObject(getContext(), CD->getParent())) {
     if (E->getArg(0)->isTemporaryObject(getContext(), CD->getParent())) {
@@ -1381,7 +1381,7 @@ static void EmitObjectDelete(CodeGenFunction &CGF,
   if (Dtor)
   if (Dtor)
     CGF.EmitCXXDestructorCall(Dtor, Dtor_Complete,
     CGF.EmitCXXDestructorCall(Dtor, Dtor_Complete,
                               /*ForVirtualBase=*/false, Ptr);
                               /*ForVirtualBase=*/false, Ptr);
-  else if (CGF.getLangOptions().ObjCAutoRefCount &&
+  else if (CGF.getLangOpts().ObjCAutoRefCount &&
            ElementType->isObjCLifetimeType()) {
            ElementType->isObjCLifetimeType()) {
     switch (ElementType.getObjCLifetime()) {
     switch (ElementType.getObjCLifetime()) {
     case Qualifiers::OCL_None:
     case Qualifiers::OCL_None:

+ 2 - 2
lib/CodeGen/CGExprComplex.cpp

@@ -640,7 +640,7 @@ EmitCompoundAssign(const CompoundAssignOperator *E,
   LValue LV = EmitCompoundAssignLValue(E, Func, Val);
   LValue LV = EmitCompoundAssignLValue(E, Func, Val);
 
 
   // The result of an assignment in C is the assigned r-value.
   // The result of an assignment in C is the assigned r-value.
-  if (!CGF.getContext().getLangOptions().CPlusPlus)
+  if (!CGF.getContext().getLangOpts().CPlusPlus)
     return Val;
     return Val;
 
 
   // If the lvalue is non-volatile, return the computed value of the assignment.
   // If the lvalue is non-volatile, return the computed value of the assignment.
@@ -675,7 +675,7 @@ ComplexPairTy ComplexExprEmitter::VisitBinAssign(const BinaryOperator *E) {
   LValue LV = EmitBinAssignLValue(E, Val);
   LValue LV = EmitBinAssignLValue(E, Val);
 
 
   // The result of an assignment in C is the assigned r-value.
   // The result of an assignment in C is the assigned r-value.
-  if (!CGF.getContext().getLangOptions().CPlusPlus)
+  if (!CGF.getContext().getLangOpts().CPlusPlus)
     return Val;
     return Val;
 
 
   // If the lvalue is non-volatile, return the computed value of the assignment.
   // If the lvalue is non-volatile, return the computed value of the assignment.

+ 16 - 16
lib/CodeGen/CGExprScalar.cpp

@@ -391,7 +391,7 @@ public:
   // Binary Operators.
   // Binary Operators.
   Value *EmitMul(const BinOpInfo &Ops) {
   Value *EmitMul(const BinOpInfo &Ops) {
     if (Ops.Ty->isSignedIntegerOrEnumerationType()) {
     if (Ops.Ty->isSignedIntegerOrEnumerationType()) {
-      switch (CGF.getContext().getLangOptions().getSignedOverflowBehavior()) {
+      switch (CGF.getContext().getLangOpts().getSignedOverflowBehavior()) {
       case LangOptions::SOB_Undefined:
       case LangOptions::SOB_Undefined:
         return Builder.CreateNSWMul(Ops.LHS, Ops.RHS, "mul");
         return Builder.CreateNSWMul(Ops.LHS, Ops.RHS, "mul");
       case LangOptions::SOB_Defined:
       case LangOptions::SOB_Defined:
@@ -406,7 +406,7 @@ public:
     return Builder.CreateMul(Ops.LHS, Ops.RHS, "mul");
     return Builder.CreateMul(Ops.LHS, Ops.RHS, "mul");
   }
   }
   bool isTrapvOverflowBehavior() {
   bool isTrapvOverflowBehavior() {
-    return CGF.getContext().getLangOptions().getSignedOverflowBehavior() 
+    return CGF.getContext().getLangOpts().getSignedOverflowBehavior() 
                == LangOptions::SOB_Trapping; 
                == LangOptions::SOB_Trapping; 
   }
   }
   /// Create a binary op that checks for overflow.
   /// Create a binary op that checks for overflow.
@@ -1247,7 +1247,7 @@ llvm::Value *ScalarExprEmitter::
 EmitAddConsiderOverflowBehavior(const UnaryOperator *E,
 EmitAddConsiderOverflowBehavior(const UnaryOperator *E,
                                 llvm::Value *InVal,
                                 llvm::Value *InVal,
                                 llvm::Value *NextVal, bool IsInc) {
                                 llvm::Value *NextVal, bool IsInc) {
-  switch (CGF.getContext().getLangOptions().getSignedOverflowBehavior()) {
+  switch (CGF.getContext().getLangOpts().getSignedOverflowBehavior()) {
   case LangOptions::SOB_Undefined:
   case LangOptions::SOB_Undefined:
     return Builder.CreateNSWAdd(InVal, NextVal, IsInc ? "inc" : "dec");
     return Builder.CreateNSWAdd(InVal, NextVal, IsInc ? "inc" : "dec");
   case LangOptions::SOB_Defined:
   case LangOptions::SOB_Defined:
@@ -1319,7 +1319,7 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV,
           = CGF.getContext().getAsVariableArrayType(type)) {
           = CGF.getContext().getAsVariableArrayType(type)) {
       llvm::Value *numElts = CGF.getVLASize(vla).first;
       llvm::Value *numElts = CGF.getVLASize(vla).first;
       if (!isInc) numElts = Builder.CreateNSWNeg(numElts, "vla.negsize");
       if (!isInc) numElts = Builder.CreateNSWNeg(numElts, "vla.negsize");
-      if (CGF.getContext().getLangOptions().isSignedOverflowDefined())
+      if (CGF.getContext().getLangOpts().isSignedOverflowDefined())
         value = Builder.CreateGEP(value, numElts, "vla.inc");
         value = Builder.CreateGEP(value, numElts, "vla.inc");
       else
       else
         value = Builder.CreateInBoundsGEP(value, numElts, "vla.inc");
         value = Builder.CreateInBoundsGEP(value, numElts, "vla.inc");
@@ -1329,7 +1329,7 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV,
       llvm::Value *amt = Builder.getInt32(amount);
       llvm::Value *amt = Builder.getInt32(amount);
 
 
       value = CGF.EmitCastToVoidPtr(value);
       value = CGF.EmitCastToVoidPtr(value);
-      if (CGF.getContext().getLangOptions().isSignedOverflowDefined())
+      if (CGF.getContext().getLangOpts().isSignedOverflowDefined())
         value = Builder.CreateGEP(value, amt, "incdec.funcptr");
         value = Builder.CreateGEP(value, amt, "incdec.funcptr");
       else
       else
         value = Builder.CreateInBoundsGEP(value, amt, "incdec.funcptr");
         value = Builder.CreateInBoundsGEP(value, amt, "incdec.funcptr");
@@ -1338,7 +1338,7 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV,
     // For everything else, we can just do a simple increment.
     // For everything else, we can just do a simple increment.
     } else {
     } else {
       llvm::Value *amt = Builder.getInt32(amount);
       llvm::Value *amt = Builder.getInt32(amount);
-      if (CGF.getContext().getLangOptions().isSignedOverflowDefined())
+      if (CGF.getContext().getLangOpts().isSignedOverflowDefined())
         value = Builder.CreateGEP(value, amt, "incdec.ptr");
         value = Builder.CreateGEP(value, amt, "incdec.ptr");
       else
       else
         value = Builder.CreateInBoundsGEP(value, amt, "incdec.ptr");
         value = Builder.CreateInBoundsGEP(value, amt, "incdec.ptr");
@@ -1399,7 +1399,7 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV,
     llvm::Value *sizeValue =
     llvm::Value *sizeValue =
       llvm::ConstantInt::get(CGF.SizeTy, size.getQuantity());
       llvm::ConstantInt::get(CGF.SizeTy, size.getQuantity());
 
 
-    if (CGF.getContext().getLangOptions().isSignedOverflowDefined())
+    if (CGF.getContext().getLangOpts().isSignedOverflowDefined())
       value = Builder.CreateGEP(value, sizeValue, "incdec.objptr");
       value = Builder.CreateGEP(value, sizeValue, "incdec.objptr");
     else
     else
       value = Builder.CreateInBoundsGEP(value, sizeValue, "incdec.objptr");
       value = Builder.CreateInBoundsGEP(value, sizeValue, "incdec.objptr");
@@ -1740,7 +1740,7 @@ Value *ScalarExprEmitter::EmitCompoundAssign(const CompoundAssignOperator *E,
     return 0;
     return 0;
 
 
   // The result of an assignment in C is the assigned r-value.
   // The result of an assignment in C is the assigned r-value.
-  if (!CGF.getContext().getLangOptions().CPlusPlus)
+  if (!CGF.getContext().getLangOpts().CPlusPlus)
     return RHS;
     return RHS;
 
 
   // If the lvalue is non-volatile, return the computed value of the assignment.
   // If the lvalue is non-volatile, return the computed value of the assignment.
@@ -1801,7 +1801,7 @@ Value *ScalarExprEmitter::EmitDiv(const BinOpInfo &Ops) {
   }
   }
   if (Ops.LHS->getType()->isFPOrFPVectorTy()) {
   if (Ops.LHS->getType()->isFPOrFPVectorTy()) {
     llvm::Value *Val = Builder.CreateFDiv(Ops.LHS, Ops.RHS, "div");
     llvm::Value *Val = Builder.CreateFDiv(Ops.LHS, Ops.RHS, "div");
-    if (CGF.getContext().getLangOptions().OpenCL) {
+    if (CGF.getContext().getLangOpts().OpenCL) {
       // OpenCL 1.1 7.4: minimum accuracy of single precision / is 2.5ulp
       // OpenCL 1.1 7.4: minimum accuracy of single precision / is 2.5ulp
       llvm::Type *ValTy = Val->getType();
       llvm::Type *ValTy = Val->getType();
       if (ValTy->isFloatTy() ||
       if (ValTy->isFloatTy() ||
@@ -1877,7 +1877,7 @@ Value *ScalarExprEmitter::EmitOverflowCheckedBinOp(const BinOpInfo &Ops) {
 
 
   // Handle overflow with llvm.trap.
   // Handle overflow with llvm.trap.
   const std::string *handlerName = 
   const std::string *handlerName = 
-    &CGF.getContext().getLangOptions().OverflowHandler;
+    &CGF.getContext().getLangOpts().OverflowHandler;
   if (handlerName->empty()) {
   if (handlerName->empty()) {
     EmitOverflowBB(overflowBB);
     EmitOverflowBB(overflowBB);
     Builder.SetInsertPoint(continueBB);
     Builder.SetInsertPoint(continueBB);
@@ -1976,7 +1976,7 @@ static Value *emitPointerArithmetic(CodeGenFunction &CGF,
     // GEP indexes are signed, and scaling an index isn't permitted to
     // GEP indexes are signed, and scaling an index isn't permitted to
     // signed-overflow, so we use the same semantics for our explicit
     // signed-overflow, so we use the same semantics for our explicit
     // multiply.  We suppress this if overflow is not undefined behavior.
     // multiply.  We suppress this if overflow is not undefined behavior.
-    if (CGF.getLangOptions().isSignedOverflowDefined()) {
+    if (CGF.getLangOpts().isSignedOverflowDefined()) {
       index = CGF.Builder.CreateMul(index, numElements, "vla.index");
       index = CGF.Builder.CreateMul(index, numElements, "vla.index");
       pointer = CGF.Builder.CreateGEP(pointer, index, "add.ptr");
       pointer = CGF.Builder.CreateGEP(pointer, index, "add.ptr");
     } else {
     } else {
@@ -1995,7 +1995,7 @@ static Value *emitPointerArithmetic(CodeGenFunction &CGF,
     return CGF.Builder.CreateBitCast(result, pointer->getType());
     return CGF.Builder.CreateBitCast(result, pointer->getType());
   }
   }
 
 
-  if (CGF.getLangOptions().isSignedOverflowDefined())
+  if (CGF.getLangOpts().isSignedOverflowDefined())
     return CGF.Builder.CreateGEP(pointer, index, "add.ptr");
     return CGF.Builder.CreateGEP(pointer, index, "add.ptr");
 
 
   return CGF.Builder.CreateInBoundsGEP(pointer, index, "add.ptr");
   return CGF.Builder.CreateInBoundsGEP(pointer, index, "add.ptr");
@@ -2007,7 +2007,7 @@ Value *ScalarExprEmitter::EmitAdd(const BinOpInfo &op) {
     return emitPointerArithmetic(CGF, op, /*subtraction*/ false);
     return emitPointerArithmetic(CGF, op, /*subtraction*/ false);
 
 
   if (op.Ty->isSignedIntegerOrEnumerationType()) {
   if (op.Ty->isSignedIntegerOrEnumerationType()) {
-    switch (CGF.getContext().getLangOptions().getSignedOverflowBehavior()) {
+    switch (CGF.getContext().getLangOpts().getSignedOverflowBehavior()) {
     case LangOptions::SOB_Undefined:
     case LangOptions::SOB_Undefined:
       return Builder.CreateNSWAdd(op.LHS, op.RHS, "add");
       return Builder.CreateNSWAdd(op.LHS, op.RHS, "add");
     case LangOptions::SOB_Defined:
     case LangOptions::SOB_Defined:
@@ -2027,7 +2027,7 @@ Value *ScalarExprEmitter::EmitSub(const BinOpInfo &op) {
   // The LHS is always a pointer if either side is.
   // The LHS is always a pointer if either side is.
   if (!op.LHS->getType()->isPointerTy()) {
   if (!op.LHS->getType()->isPointerTy()) {
     if (op.Ty->isSignedIntegerOrEnumerationType()) {
     if (op.Ty->isSignedIntegerOrEnumerationType()) {
-      switch (CGF.getContext().getLangOptions().getSignedOverflowBehavior()) {
+      switch (CGF.getContext().getLangOpts().getSignedOverflowBehavior()) {
       case LangOptions::SOB_Undefined:
       case LangOptions::SOB_Undefined:
         return Builder.CreateNSWSub(op.LHS, op.RHS, "sub");
         return Builder.CreateNSWSub(op.LHS, op.RHS, "sub");
       case LangOptions::SOB_Defined:
       case LangOptions::SOB_Defined:
@@ -2353,7 +2353,7 @@ Value *ScalarExprEmitter::VisitBinAssign(const BinaryOperator *E) {
     return 0;
     return 0;
 
 
   // The result of an assignment in C is the assigned r-value.
   // The result of an assignment in C is the assigned r-value.
-  if (!CGF.getContext().getLangOptions().CPlusPlus)
+  if (!CGF.getContext().getLangOpts().CPlusPlus)
     return RHS;
     return RHS;
 
 
   // If the lvalue is non-volatile, return the computed value of the assignment.
   // If the lvalue is non-volatile, return the computed value of the assignment.
@@ -2567,7 +2567,7 @@ VisitAbstractConditionalOperator(const AbstractConditionalOperator *E) {
 
 
   // OpenCL: If the condition is a vector, we can treat this condition like
   // OpenCL: If the condition is a vector, we can treat this condition like
   // the select function.
   // the select function.
-  if (CGF.getContext().getLangOptions().OpenCL 
+  if (CGF.getContext().getLangOpts().OpenCL 
       && condExpr->getType()->isVectorType()) {
       && condExpr->getType()->isVectorType()) {
     llvm::Value *CondV = CGF.EmitScalarExpr(condExpr);
     llvm::Value *CondV = CGF.EmitScalarExpr(condExpr);
     llvm::Value *LHS = Visit(lhsExpr);
     llvm::Value *LHS = Visit(lhsExpr);

+ 17 - 17
lib/CodeGen/CGObjC.cpp

@@ -279,7 +279,7 @@ RValue CodeGenFunction::EmitObjCMessageExpr(const ObjCMessageExpr *E,
   // though.
   // though.
   bool retainSelf =
   bool retainSelf =
     (!isDelegateInit &&
     (!isDelegateInit &&
-     CGM.getLangOptions().ObjCAutoRefCount &&
+     CGM.getLangOpts().ObjCAutoRefCount &&
      method &&
      method &&
      method->hasAttr<NSConsumesSelfAttr>());
      method->hasAttr<NSConsumesSelfAttr>());
 
 
@@ -333,7 +333,7 @@ RValue CodeGenFunction::EmitObjCMessageExpr(const ObjCMessageExpr *E,
   // In ARC, we sometimes want to "extend the lifetime"
   // In ARC, we sometimes want to "extend the lifetime"
   // (i.e. retain+autorelease) of receivers of returns-inner-pointer
   // (i.e. retain+autorelease) of receivers of returns-inner-pointer
   // messages.
   // messages.
-  if (getLangOptions().ObjCAutoRefCount && method &&
+  if (getLangOpts().ObjCAutoRefCount && method &&
       method->hasAttr<ObjCReturnsInnerPointerAttr>() &&
       method->hasAttr<ObjCReturnsInnerPointerAttr>() &&
       shouldExtendReceiverForInnerPointerMessage(E))
       shouldExtendReceiverForInnerPointerMessage(E))
     Receiver = EmitARCRetainAutorelease(ReceiverType, Receiver);
     Receiver = EmitARCRetainAutorelease(ReceiverType, Receiver);
@@ -352,7 +352,7 @@ RValue CodeGenFunction::EmitObjCMessageExpr(const ObjCMessageExpr *E,
   // be an undefined read and write of an object in unordered
   // be an undefined read and write of an object in unordered
   // expressions.
   // expressions.
   if (isDelegateInit) {
   if (isDelegateInit) {
-    assert(getLangOptions().ObjCAutoRefCount &&
+    assert(getLangOpts().ObjCAutoRefCount &&
            "delegate init calls should only be marked in ARC");
            "delegate init calls should only be marked in ARC");
 
 
     // Do an unsafe store of null into self.
     // Do an unsafe store of null into self.
@@ -458,7 +458,7 @@ void CodeGenFunction::StartObjCMethod(const ObjCMethodDecl *OMD,
   StartFunction(OMD, OMD->getResultType(), Fn, FI, args, StartLoc);
   StartFunction(OMD, OMD->getResultType(), Fn, FI, args, StartLoc);
 
 
   // In ARC, certain methods get an extra cleanup.
   // In ARC, certain methods get an extra cleanup.
-  if (CGM.getLangOptions().ObjCAutoRefCount &&
+  if (CGM.getLangOpts().ObjCAutoRefCount &&
       OMD->isInstanceMethod() &&
       OMD->isInstanceMethod() &&
       OMD->getSelector().isUnarySelector()) {
       OMD->getSelector().isUnarySelector()) {
     const IdentifierInfo *ident = 
     const IdentifierInfo *ident = 
@@ -604,13 +604,13 @@ PropertyImplStrategy::PropertyImplStrategy(CodeGenModule &CGM,
   // Handle retain.
   // Handle retain.
   if (setterKind == ObjCPropertyDecl::Retain) {
   if (setterKind == ObjCPropertyDecl::Retain) {
     // In GC-only, there's nothing special that needs to be done.
     // In GC-only, there's nothing special that needs to be done.
-    if (CGM.getLangOptions().getGC() == LangOptions::GCOnly) {
+    if (CGM.getLangOpts().getGC() == LangOptions::GCOnly) {
       // fallthrough
       // fallthrough
 
 
     // In ARC, if the property is non-atomic, use expression emission,
     // In ARC, if the property is non-atomic, use expression emission,
     // which translates to objc_storeStrong.  This isn't required, but
     // which translates to objc_storeStrong.  This isn't required, but
     // it's slightly nicer.
     // it's slightly nicer.
-    } else if (CGM.getLangOptions().ObjCAutoRefCount && !IsAtomic) {
+    } else if (CGM.getLangOpts().ObjCAutoRefCount && !IsAtomic) {
       Kind = Expression;
       Kind = Expression;
       return;
       return;
 
 
@@ -645,14 +645,14 @@ PropertyImplStrategy::PropertyImplStrategy(CodeGenModule &CGM,
   // expressions.  This actually works out to being atomic anyway,
   // expressions.  This actually works out to being atomic anyway,
   // except for ARC __strong, but that should trigger the above code.
   // except for ARC __strong, but that should trigger the above code.
   if (ivarType.hasNonTrivialObjCLifetime() ||
   if (ivarType.hasNonTrivialObjCLifetime() ||
-      (CGM.getLangOptions().getGC() &&
+      (CGM.getLangOpts().getGC() &&
        CGM.getContext().getObjCGCAttrKind(ivarType))) {
        CGM.getContext().getObjCGCAttrKind(ivarType))) {
     Kind = Expression;
     Kind = Expression;
     return;
     return;
   }
   }
 
 
   // Compute whether the ivar has strong members.
   // Compute whether the ivar has strong members.
-  if (CGM.getLangOptions().getGC())
+  if (CGM.getLangOpts().getGC())
     if (const RecordType *recordType = ivarType->getAs<RecordType>())
     if (const RecordType *recordType = ivarType->getAs<RecordType>())
       HasStrong = recordType->getDecl()->hasObjectMember();
       HasStrong = recordType->getDecl()->hasObjectMember();
 
 
@@ -1021,7 +1021,7 @@ static bool hasTrivialSetExpr(const ObjCPropertyImplDecl *PID) {
 }
 }
 
 
 static bool UseOptimizedSetter(CodeGenModule &CGM) {
 static bool UseOptimizedSetter(CodeGenModule &CGM) {
-  if (CGM.getLangOptions().getGC() != LangOptions::NonGC)
+  if (CGM.getLangOpts().getGC() != LangOptions::NonGC)
     return false;
     return false;
   const TargetInfo &Target = CGM.getContext().getTargetInfo();
   const TargetInfo &Target = CGM.getContext().getTargetInfo();
 
 
@@ -1334,7 +1334,7 @@ bool CodeGenFunction::IndirectObjCSetterArg(const CGFunctionInfo &FI) {
 }
 }
 
 
 bool CodeGenFunction::IvarTypeWithAggrGCObjects(QualType Ty) {
 bool CodeGenFunction::IvarTypeWithAggrGCObjects(QualType Ty) {
-  if (CGM.getLangOptions().getGC() == LangOptions::NonGC)
+  if (CGM.getLangOpts().getGC() == LangOptions::NonGC)
     return false;
     return false;
   if (const RecordType *FDTTy = Ty.getTypePtr()->getAs<RecordType>())
   if (const RecordType *FDTTy = Ty.getTypePtr()->getAs<RecordType>())
     return FDTTy->getDecl()->hasObjectMember();
     return FDTTy->getDecl()->hasObjectMember();
@@ -1399,7 +1399,7 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){
 
 
   // Emit the collection pointer.  In ARC, we do a retain.
   // Emit the collection pointer.  In ARC, we do a retain.
   llvm::Value *Collection;
   llvm::Value *Collection;
-  if (getLangOptions().ObjCAutoRefCount) {
+  if (getLangOpts().ObjCAutoRefCount) {
     Collection = EmitARCRetainScalarExpr(S.getCollection());
     Collection = EmitARCRetainScalarExpr(S.getCollection());
 
 
     // Enter a cleanup to do the release.
     // Enter a cleanup to do the release.
@@ -1624,7 +1624,7 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){
     DI->EmitLexicalBlockEnd(Builder, S.getSourceRange().getEnd());
     DI->EmitLexicalBlockEnd(Builder, S.getSourceRange().getEnd());
 
 
   // Leave the cleanup we entered in ARC.
   // Leave the cleanup we entered in ARC.
-  if (getLangOptions().ObjCAutoRefCount)
+  if (getLangOpts().ObjCAutoRefCount)
     PopCleanupBlock();
     PopCleanupBlock();
 
 
   EmitBlock(LoopEnd.getBlock());
   EmitBlock(LoopEnd.getBlock());
@@ -2241,7 +2241,7 @@ namespace {
 }
 }
 
 
 void CodeGenFunction::EmitObjCAutoreleasePoolCleanup(llvm::Value *Ptr) {
 void CodeGenFunction::EmitObjCAutoreleasePoolCleanup(llvm::Value *Ptr) {
-  if (CGM.getLangOptions().ObjCAutoRefCount)
+  if (CGM.getLangOpts().ObjCAutoRefCount)
     EHStack.pushCleanup<CallObjCAutoreleasePoolObject>(NormalCleanup, Ptr);
     EHStack.pushCleanup<CallObjCAutoreleasePoolObject>(NormalCleanup, Ptr);
   else
   else
     EHStack.pushCleanup<CallObjCMRRAutoreleasePoolObject>(NormalCleanup, Ptr);
     EHStack.pushCleanup<CallObjCMRRAutoreleasePoolObject>(NormalCleanup, Ptr);
@@ -2292,7 +2292,7 @@ static TryEmitResult tryEmitARCRetainLoadOfScalar(CodeGenFunction &CGF,
   // As a very special optimization, in ARC++, if the l-value is the
   // As a very special optimization, in ARC++, if the l-value is the
   // result of a non-volatile assignment, do a simple retain of the
   // result of a non-volatile assignment, do a simple retain of the
   // result of the call to objc_storeWeak instead of reloading.
   // result of the call to objc_storeWeak instead of reloading.
-  if (CGF.getLangOptions().CPlusPlus &&
+  if (CGF.getLangOpts().CPlusPlus &&
       !type.isVolatileQualified() &&
       !type.isVolatileQualified() &&
       type.getObjCLifetime() == Qualifiers::OCL_Weak &&
       type.getObjCLifetime() == Qualifiers::OCL_Weak &&
       isa<BinaryOperator>(e) &&
       isa<BinaryOperator>(e) &&
@@ -2637,7 +2637,7 @@ llvm::Value *CodeGenFunction::EmitARCExtendBlockObject(const Expr *e) {
 
 
 llvm::Value *CodeGenFunction::EmitObjCThrowOperand(const Expr *expr) {
 llvm::Value *CodeGenFunction::EmitObjCThrowOperand(const Expr *expr) {
   // In ARC, retain and autorelease the expression.
   // In ARC, retain and autorelease the expression.
-  if (getLangOptions().ObjCAutoRefCount) {
+  if (getLangOpts().ObjCAutoRefCount) {
     // Do so before running any cleanups for the full-expression.
     // Do so before running any cleanups for the full-expression.
     // tryEmitARCRetainScalarExpr does make an effort to do things
     // tryEmitARCRetainScalarExpr does make an effort to do things
     // inside cleanups, but there are crazy cases like
     // inside cleanups, but there are crazy cases like
@@ -2754,7 +2754,7 @@ llvm::Constant *
 CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(
 CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction(
                                         const ObjCPropertyImplDecl *PID) {
                                         const ObjCPropertyImplDecl *PID) {
   // FIXME. This api is for NeXt runtime only for now.
   // FIXME. This api is for NeXt runtime only for now.
-  if (!getLangOptions().CPlusPlus || !getLangOptions().NeXTRuntime)
+  if (!getLangOpts().CPlusPlus || !getLangOpts().NeXTRuntime)
     return 0;
     return 0;
   QualType Ty = PID->getPropertyIvarDecl()->getType();
   QualType Ty = PID->getPropertyIvarDecl()->getType();
   if (!Ty->isRecordType())
   if (!Ty->isRecordType())
@@ -2837,7 +2837,7 @@ llvm::Constant *
 CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(
 CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction(
                                             const ObjCPropertyImplDecl *PID) {
                                             const ObjCPropertyImplDecl *PID) {
   // FIXME. This api is for NeXt runtime only for now.
   // FIXME. This api is for NeXt runtime only for now.
-  if (!getLangOptions().CPlusPlus || !getLangOptions().NeXTRuntime)
+  if (!getLangOpts().CPlusPlus || !getLangOpts().NeXTRuntime)
     return 0;
     return 0;
   const ObjCPropertyDecl *PD = PID->getPropertyDecl();
   const ObjCPropertyDecl *PD = PID->getPropertyDecl();
   QualType Ty = PD->getType();
   QualType Ty = PD->getType();

+ 15 - 15
lib/CodeGen/CGObjCGNU.cpp

@@ -641,7 +641,7 @@ class CGObjCGNUstep : public CGObjCGNU {
       SlotLookupSuperFn.init(&CGM, "objc_slot_lookup_super", SlotTy,
       SlotLookupSuperFn.init(&CGM, "objc_slot_lookup_super", SlotTy,
               PtrToObjCSuperTy, SelectorTy, NULL);
               PtrToObjCSuperTy, SelectorTy, NULL);
       // If we're in ObjC++ mode, then we want to make 
       // If we're in ObjC++ mode, then we want to make 
-      if (CGM.getLangOptions().CPlusPlus) {
+      if (CGM.getLangOpts().CPlusPlus) {
         llvm::Type *VoidTy = llvm::Type::getVoidTy(VMContext);
         llvm::Type *VoidTy = llvm::Type::getVoidTy(VMContext);
         // void *__cxa_begin_catch(void *e)
         // void *__cxa_begin_catch(void *e)
         EnterCatchFn.init(&CGM, "__cxa_begin_catch", PtrTy, PtrTy, NULL);
         EnterCatchFn.init(&CGM, "__cxa_begin_catch", PtrTy, PtrTy, NULL);
@@ -773,7 +773,7 @@ CGObjCGNU::CGObjCGNU(CodeGenModule &cgm, unsigned runtimeABIVersion,
   IMPTy = llvm::PointerType::getUnqual(llvm::FunctionType::get(IdTy, IMPArgs,
   IMPTy = llvm::PointerType::getUnqual(llvm::FunctionType::get(IdTy, IMPArgs,
               true));
               true));
 
 
-  const LangOptions &Opts = CGM.getLangOptions();
+  const LangOptions &Opts = CGM.getLangOpts();
   if ((Opts.getGC() != LangOptions::NonGC) || Opts.ObjCAutoRefCount)
   if ((Opts.getGC() != LangOptions::NonGC) || Opts.ObjCAutoRefCount)
     RuntimeVersion = 10;
     RuntimeVersion = 10;
 
 
@@ -882,14 +882,14 @@ llvm::Value *CGObjCGNU::GetSelector(CGBuilderTy &Builder, const ObjCMethodDecl
 }
 }
 
 
 llvm::Constant *CGObjCGNU::GetEHType(QualType T) {
 llvm::Constant *CGObjCGNU::GetEHType(QualType T) {
-  if (!CGM.getLangOptions().CPlusPlus) {
+  if (!CGM.getLangOpts().CPlusPlus) {
       if (T->isObjCIdType()
       if (T->isObjCIdType()
           || T->isObjCQualifiedIdType()) {
           || T->isObjCQualifiedIdType()) {
         // With the old ABI, there was only one kind of catchall, which broke
         // With the old ABI, there was only one kind of catchall, which broke
         // foreign exceptions.  With the new ABI, we use __objc_id_typeinfo as
         // foreign exceptions.  With the new ABI, we use __objc_id_typeinfo as
         // a pointer indicating object catchalls, and NULL to indicate real
         // a pointer indicating object catchalls, and NULL to indicate real
         // catchalls
         // catchalls
-        if (CGM.getLangOptions().ObjCNonFragileABI) {
+        if (CGM.getLangOpts().ObjCNonFragileABI) {
           return MakeConstantString("@id");
           return MakeConstantString("@id");
         } else {
         } else {
           return 0;
           return 0;
@@ -973,7 +973,7 @@ llvm::Constant *CGObjCGNU::GenerateConstantString(const StringLiteral *SL) {
   if (old != ObjCStrings.end())
   if (old != ObjCStrings.end())
     return old->getValue();
     return old->getValue();
 
 
-  StringRef StringClass = CGM.getLangOptions().ObjCConstantStringClass;
+  StringRef StringClass = CGM.getLangOpts().ObjCConstantStringClass;
 
 
   if (StringClass.empty()) StringClass = "NXConstantString";
   if (StringClass.empty()) StringClass = "NXConstantString";
 
 
@@ -1016,7 +1016,7 @@ CGObjCGNU::GenerateMessageSendSuper(CodeGenFunction &CGF,
                                     const CallArgList &CallArgs,
                                     const CallArgList &CallArgs,
                                     const ObjCMethodDecl *Method) {
                                     const ObjCMethodDecl *Method) {
   CGBuilderTy &Builder = CGF.Builder;
   CGBuilderTy &Builder = CGF.Builder;
-  if (CGM.getLangOptions().getGC() == LangOptions::GCOnly) {
+  if (CGM.getLangOpts().getGC() == LangOptions::GCOnly) {
     if (Sel == RetainSel || Sel == AutoreleaseSel) {
     if (Sel == RetainSel || Sel == AutoreleaseSel) {
       return RValue::get(EnforceType(Builder, Receiver,
       return RValue::get(EnforceType(Builder, Receiver,
                   CGM.getTypes().ConvertType(ResultType)));
                   CGM.getTypes().ConvertType(ResultType)));
@@ -1119,7 +1119,7 @@ CGObjCGNU::GenerateMessageSend(CodeGenFunction &CGF,
   CGBuilderTy &Builder = CGF.Builder;
   CGBuilderTy &Builder = CGF.Builder;
 
 
   // Strip out message sends to retain / release in GC mode
   // Strip out message sends to retain / release in GC mode
-  if (CGM.getLangOptions().getGC() == LangOptions::GCOnly) {
+  if (CGM.getLangOpts().getGC() == LangOptions::GCOnly) {
     if (Sel == RetainSel || Sel == AutoreleaseSel) {
     if (Sel == RetainSel || Sel == AutoreleaseSel) {
       return RValue::get(EnforceType(Builder, Receiver,
       return RValue::get(EnforceType(Builder, Receiver,
                   CGM.getTypes().ConvertType(ResultType)));
                   CGM.getTypes().ConvertType(ResultType)));
@@ -1983,7 +1983,7 @@ void CGObjCGNU::GenerateClass(const ObjCImplementationDecl *OID) {
     Context.getASTObjCInterfaceLayout(SuperClassDecl).getSize().getQuantity();
     Context.getASTObjCInterfaceLayout(SuperClassDecl).getSize().getQuantity();
   // For non-fragile ivars, set the instance size to 0 - {the size of just this
   // For non-fragile ivars, set the instance size to 0 - {the size of just this
   // class}.  The runtime will then set this to the correct value on load.
   // class}.  The runtime will then set this to the correct value on load.
-  if (CGM.getContext().getLangOptions().ObjCNonFragileABI) {
+  if (CGM.getContext().getLangOpts().ObjCNonFragileABI) {
     instanceSize = 0 - (instanceSize - superInstanceSize);
     instanceSize = 0 - (instanceSize - superInstanceSize);
   }
   }
 
 
@@ -1998,7 +1998,7 @@ void CGObjCGNU::GenerateClass(const ObjCImplementationDecl *OID) {
       // Get the offset
       // Get the offset
       uint64_t BaseOffset = ComputeIvarBaseOffset(CGM, OID, IVD);
       uint64_t BaseOffset = ComputeIvarBaseOffset(CGM, OID, IVD);
       uint64_t Offset = BaseOffset;
       uint64_t Offset = BaseOffset;
-      if (CGM.getContext().getLangOptions().ObjCNonFragileABI) {
+      if (CGM.getContext().getLangOpts().ObjCNonFragileABI) {
         Offset = BaseOffset - superInstanceSize;
         Offset = BaseOffset - superInstanceSize;
       }
       }
       llvm::Constant *OffsetValue = llvm::ConstantInt::get(IntTy, Offset);
       llvm::Constant *OffsetValue = llvm::ConstantInt::get(IntTy, Offset);
@@ -2192,7 +2192,7 @@ llvm::Function *CGObjCGNU::ModuleInitFunction() {
         ConstantStrings.size() + 1);
         ConstantStrings.size() + 1);
     ConstantStrings.push_back(NULLPtr);
     ConstantStrings.push_back(NULLPtr);
 
 
-    StringRef StringClass = CGM.getLangOptions().ObjCConstantStringClass;
+    StringRef StringClass = CGM.getLangOpts().ObjCConstantStringClass;
 
 
     if (StringClass.empty()) StringClass = "NXConstantString";
     if (StringClass.empty()) StringClass = "NXConstantString";
 
 
@@ -2320,12 +2320,12 @@ llvm::Function *CGObjCGNU::ModuleInitFunction() {
   Elements.push_back(SymTab);
   Elements.push_back(SymTab);
 
 
   if (RuntimeVersion >= 10)
   if (RuntimeVersion >= 10)
-    switch (CGM.getLangOptions().getGC()) {
+    switch (CGM.getLangOpts().getGC()) {
       case LangOptions::GCOnly:
       case LangOptions::GCOnly:
         Elements.push_back(llvm::ConstantInt::get(IntTy, 2));
         Elements.push_back(llvm::ConstantInt::get(IntTy, 2));
         break;
         break;
       case LangOptions::NonGC:
       case LangOptions::NonGC:
-        if (CGM.getLangOptions().ObjCAutoRefCount)
+        if (CGM.getLangOpts().ObjCAutoRefCount)
           Elements.push_back(llvm::ConstantInt::get(IntTy, 1));
           Elements.push_back(llvm::ConstantInt::get(IntTy, 1));
         else
         else
           Elements.push_back(llvm::ConstantInt::get(IntTy, 0));
           Elements.push_back(llvm::ConstantInt::get(IntTy, 0));
@@ -2592,7 +2592,7 @@ llvm::GlobalVariable *CGObjCGNU::ObjCIvarOffsetVariable(
     // to replace it with the real version for a library.  In non-PIC code you
     // to replace it with the real version for a library.  In non-PIC code you
     // must compile with the fragile ABI if you want to use ivars from a
     // must compile with the fragile ABI if you want to use ivars from a
     // GCC-compiled class.
     // GCC-compiled class.
-    if (CGM.getLangOptions().PICLevel) {
+    if (CGM.getLangOpts().PICLevel) {
       llvm::GlobalVariable *IvarOffsetGV = new llvm::GlobalVariable(TheModule,
       llvm::GlobalVariable *IvarOffsetGV = new llvm::GlobalVariable(TheModule,
             Int32Ty, false,
             Int32Ty, false,
             llvm::GlobalValue::PrivateLinkage, OffsetGuess, Name+".guess");
             llvm::GlobalValue::PrivateLinkage, OffsetGuess, Name+".guess");
@@ -2638,7 +2638,7 @@ static const ObjCInterfaceDecl *FindIvarInterface(ASTContext &Context,
 llvm::Value *CGObjCGNU::EmitIvarOffset(CodeGenFunction &CGF,
 llvm::Value *CGObjCGNU::EmitIvarOffset(CodeGenFunction &CGF,
                          const ObjCInterfaceDecl *Interface,
                          const ObjCInterfaceDecl *Interface,
                          const ObjCIvarDecl *Ivar) {
                          const ObjCIvarDecl *Ivar) {
-  if (CGM.getLangOptions().ObjCNonFragileABI) {
+  if (CGM.getLangOpts().ObjCNonFragileABI) {
     Interface = FindIvarInterface(CGM.getContext(), Interface, Ivar);
     Interface = FindIvarInterface(CGM.getContext(), Interface, Ivar);
     if (RuntimeVersion < 10)
     if (RuntimeVersion < 10)
       return CGF.Builder.CreateZExtOrBitCast(
       return CGF.Builder.CreateZExtOrBitCast(
@@ -2660,7 +2660,7 @@ llvm::Value *CGObjCGNU::EmitIvarOffset(CodeGenFunction &CGF,
 
 
 CGObjCRuntime *
 CGObjCRuntime *
 clang::CodeGen::CreateGNUObjCRuntime(CodeGenModule &CGM) {
 clang::CodeGen::CreateGNUObjCRuntime(CodeGenModule &CGM) {
-  if (CGM.getLangOptions().ObjCNonFragileABI)
+  if (CGM.getLangOpts().ObjCNonFragileABI)
     return new CGObjCGNUstep(CGM);
     return new CGObjCGNUstep(CGM);
   return new CGObjCGCC(CGM);
   return new CGObjCGCC(CGM);
 }
 }

+ 18 - 18
lib/CodeGen/CGObjCMac.cpp

@@ -1615,7 +1615,7 @@ llvm::Constant *CGObjCMac::GetEHType(QualType T) {
 
 
 llvm::Constant *CGObjCCommonMac::GenerateConstantString(
 llvm::Constant *CGObjCCommonMac::GenerateConstantString(
   const StringLiteral *SL) {
   const StringLiteral *SL) {
-  return (CGM.getLangOptions().NoConstantCFStrings == 0 ? 
+  return (CGM.getLangOpts().NoConstantCFStrings == 0 ? 
           CGM.GetAddrOfConstantCFString(SL) :
           CGM.GetAddrOfConstantCFString(SL) :
           CGM.GetAddrOfConstantString(SL));
           CGM.GetAddrOfConstantString(SL));
 }
 }
@@ -1747,7 +1747,7 @@ CGObjCCommonMac::EmitMessageSend(CodeGen::CodeGenFunction &CGF,
   }
   }
   
   
   bool requiresnullCheck = false;
   bool requiresnullCheck = false;
-  if (CGM.getLangOptions().ObjCAutoRefCount && Method)
+  if (CGM.getLangOpts().ObjCAutoRefCount && Method)
     for (ObjCMethodDecl::param_const_iterator i = Method->param_begin(),
     for (ObjCMethodDecl::param_const_iterator i = Method->param_begin(),
          e = Method->param_end(); i != e; ++i) {
          e = Method->param_end(); i != e; ++i) {
       const ParmVarDecl *ParamDecl = (*i);
       const ParmVarDecl *ParamDecl = (*i);
@@ -1789,8 +1789,8 @@ llvm::Constant *CGObjCCommonMac::BuildGCBlockLayout(CodeGenModule &CGM,
                                                 const CGBlockInfo &blockInfo) {
                                                 const CGBlockInfo &blockInfo) {
   llvm::Constant *nullPtr = llvm::Constant::getNullValue(CGM.Int8PtrTy);
   llvm::Constant *nullPtr = llvm::Constant::getNullValue(CGM.Int8PtrTy);
 
 
-  if (CGM.getLangOptions().getGC() == LangOptions::NonGC &&
-      !CGM.getLangOptions().ObjCAutoRefCount)
+  if (CGM.getLangOpts().getGC() == LangOptions::NonGC &&
+      !CGM.getLangOpts().ObjCAutoRefCount)
     return nullPtr;
     return nullPtr;
 
 
   bool hasUnion = false;
   bool hasUnion = false;
@@ -1858,7 +1858,7 @@ llvm::Constant *CGObjCCommonMac::BuildGCBlockLayout(CodeGenModule &CGM,
   
   
   std::string BitMap;
   std::string BitMap;
   llvm::Constant *C = BuildIvarLayoutBitmap(BitMap);
   llvm::Constant *C = BuildIvarLayoutBitmap(BitMap);
-  if (CGM.getLangOptions().ObjCGCBitmapPrint) {
+  if (CGM.getLangOpts().ObjCGCBitmapPrint) {
     printf("\n block variable layout for block: ");
     printf("\n block variable layout for block: ");
     const unsigned char *s = (unsigned char*)BitMap.c_str();
     const unsigned char *s = (unsigned char*)BitMap.c_str();
     for (unsigned i = 0, e = BitMap.size(); i < e; i++)
     for (unsigned i = 0, e = BitMap.size(); i < e; i++)
@@ -3630,7 +3630,7 @@ void CGObjCCommonMac::EmitImageInfo() {
   Mod.addModuleFlag(llvm::Module::Error, "Objective-C Image Info Section",
   Mod.addModuleFlag(llvm::Module::Error, "Objective-C Image Info Section",
                     llvm::MDString::get(VMContext,Section));
                     llvm::MDString::get(VMContext,Section));
 
 
-  if (CGM.getLangOptions().getGC() == LangOptions::NonGC) {
+  if (CGM.getLangOpts().getGC() == LangOptions::NonGC) {
     // Non-GC overrides those files which specify GC.
     // Non-GC overrides those files which specify GC.
     Mod.addModuleFlag(llvm::Module::Override,
     Mod.addModuleFlag(llvm::Module::Override,
                       "Objective-C Garbage Collection", (uint32_t)0);
                       "Objective-C Garbage Collection", (uint32_t)0);
@@ -3640,7 +3640,7 @@ void CGObjCCommonMac::EmitImageInfo() {
                       "Objective-C Garbage Collection",
                       "Objective-C Garbage Collection",
                       eImageInfo_GarbageCollected);
                       eImageInfo_GarbageCollected);
 
 
-    if (CGM.getLangOptions().getGC() == LangOptions::GCOnly) {
+    if (CGM.getLangOpts().getGC() == LangOptions::GCOnly) {
       // Add the ObjC GC Only value.
       // Add the ObjC GC Only value.
       Mod.addModuleFlag(llvm::Module::Error, "Objective-C GC Only",
       Mod.addModuleFlag(llvm::Module::Error, "Objective-C GC Only",
                         eImageInfo_GCOnly);
                         eImageInfo_GCOnly);
@@ -3837,7 +3837,7 @@ void CGObjCCommonMac::BuildAggrIvarLayout(const ObjCImplementationDecl *OI,
     return;
     return;
   unsigned WordSizeInBits = CGM.getContext().getTargetInfo().getPointerWidth(0);
   unsigned WordSizeInBits = CGM.getContext().getTargetInfo().getPointerWidth(0);
   unsigned ByteSizeInBits = CGM.getContext().getTargetInfo().getCharWidth();
   unsigned ByteSizeInBits = CGM.getContext().getTargetInfo().getCharWidth();
-  if (!RD && CGM.getLangOptions().ObjCAutoRefCount) {
+  if (!RD && CGM.getLangOpts().ObjCAutoRefCount) {
     const FieldDecl *FirstField = RecFields[0];
     const FieldDecl *FirstField = RecFields[0];
     FirstFieldDelta = 
     FirstFieldDelta = 
       ComputeIvarBaseOffset(CGM, OI, cast<ObjCIvarDecl>(FirstField));
       ComputeIvarBaseOffset(CGM, OI, cast<ObjCIvarDecl>(FirstField));
@@ -4131,13 +4131,13 @@ llvm::Constant *CGObjCCommonMac::BuildIvarLayout(
   bool hasUnion = false;
   bool hasUnion = false;
 
 
   llvm::Type *PtrTy = CGM.Int8PtrTy;
   llvm::Type *PtrTy = CGM.Int8PtrTy;
-  if (CGM.getLangOptions().getGC() == LangOptions::NonGC &&
-      !CGM.getLangOptions().ObjCAutoRefCount)
+  if (CGM.getLangOpts().getGC() == LangOptions::NonGC &&
+      !CGM.getLangOpts().ObjCAutoRefCount)
     return llvm::Constant::getNullValue(PtrTy);
     return llvm::Constant::getNullValue(PtrTy);
 
 
   const ObjCInterfaceDecl *OI = OMD->getClassInterface();
   const ObjCInterfaceDecl *OI = OMD->getClassInterface();
   SmallVector<const FieldDecl*, 32> RecFields;
   SmallVector<const FieldDecl*, 32> RecFields;
-  if (CGM.getLangOptions().ObjCAutoRefCount) {
+  if (CGM.getLangOpts().ObjCAutoRefCount) {
     for (const ObjCIvarDecl *IVD = OI->all_declared_ivar_begin(); 
     for (const ObjCIvarDecl *IVD = OI->all_declared_ivar_begin(); 
          IVD; IVD = IVD->getNextIvar())
          IVD; IVD = IVD->getNextIvar())
       RecFields.push_back(cast<FieldDecl>(IVD));
       RecFields.push_back(cast<FieldDecl>(IVD));
@@ -4169,7 +4169,7 @@ llvm::Constant *CGObjCCommonMac::BuildIvarLayout(
   std::string BitMap;
   std::string BitMap;
   llvm::Constant *C = BuildIvarLayoutBitmap(BitMap);
   llvm::Constant *C = BuildIvarLayoutBitmap(BitMap);
   
   
-   if (CGM.getLangOptions().ObjCGCBitmapPrint) {
+   if (CGM.getLangOpts().ObjCGCBitmapPrint) {
     printf("\n%s ivar layout for class '%s': ",
     printf("\n%s ivar layout for class '%s': ",
            ForStrongLayout ? "strong" : "weak",
            ForStrongLayout ? "strong" : "weak",
            OMD->getClassInterface()->getName().data());
            OMD->getClassInterface()->getName().data());
@@ -4891,7 +4891,7 @@ bool CGObjCNonFragileABIMac::isVTableDispatchedSelector(Selector Sel) {
 
 
     // These are vtable-based if GC is disabled.
     // These are vtable-based if GC is disabled.
     // Optimistically use vtable dispatch for hybrid compiles.
     // Optimistically use vtable dispatch for hybrid compiles.
-    if (CGM.getLangOptions().getGC() != LangOptions::GCOnly) {
+    if (CGM.getLangOpts().getGC() != LangOptions::GCOnly) {
       VTableDispatchMethods.insert(GetNullarySelector("retain"));
       VTableDispatchMethods.insert(GetNullarySelector("retain"));
       VTableDispatchMethods.insert(GetNullarySelector("release"));
       VTableDispatchMethods.insert(GetNullarySelector("release"));
       VTableDispatchMethods.insert(GetNullarySelector("autorelease"));
       VTableDispatchMethods.insert(GetNullarySelector("autorelease"));
@@ -4907,7 +4907,7 @@ bool CGObjCNonFragileABIMac::isVTableDispatchedSelector(Selector Sel) {
 
 
     // These are vtable-based if GC is enabled.
     // These are vtable-based if GC is enabled.
     // Optimistically use vtable dispatch for hybrid compiles.
     // Optimistically use vtable dispatch for hybrid compiles.
-    if (CGM.getLangOptions().getGC() != LangOptions::NonGC) {
+    if (CGM.getLangOpts().getGC() != LangOptions::NonGC) {
       VTableDispatchMethods.insert(GetNullarySelector("hash"));
       VTableDispatchMethods.insert(GetNullarySelector("hash"));
       VTableDispatchMethods.insert(GetUnarySelector("addObject"));
       VTableDispatchMethods.insert(GetUnarySelector("addObject"));
     
     
@@ -4961,7 +4961,7 @@ llvm::GlobalVariable * CGObjCNonFragileABIMac::BuildClassRoTInitializer(
   std::string ClassName = ID->getNameAsString();
   std::string ClassName = ID->getNameAsString();
   llvm::Constant *Values[10]; // 11 for 64bit targets!
   llvm::Constant *Values[10]; // 11 for 64bit targets!
 
 
-  if (CGM.getLangOptions().ObjCAutoRefCount)
+  if (CGM.getLangOpts().ObjCAutoRefCount)
     flags |= CLS_COMPILED_BY_ARC;
     flags |= CLS_COMPILED_BY_ARC;
 
 
   Values[ 0] = llvm::ConstantInt::get(ObjCTypes.IntTy, flags);
   Values[ 0] = llvm::ConstantInt::get(ObjCTypes.IntTy, flags);
@@ -5877,7 +5877,7 @@ CGObjCNonFragileABIMac::EmitVTableMessageSend(CodeGenFunction &CGF,
   }
   }
   
   
   bool requiresnullCheck = false;
   bool requiresnullCheck = false;
-  if (CGM.getLangOptions().ObjCAutoRefCount && method)
+  if (CGM.getLangOpts().ObjCAutoRefCount && method)
     for (ObjCMethodDecl::param_const_iterator i = method->param_begin(),
     for (ObjCMethodDecl::param_const_iterator i = method->param_begin(),
          e = method->param_end(); i != e; ++i) {
          e = method->param_end(); i != e; ++i) {
       const ParmVarDecl *ParamDecl = (*i);
       const ParmVarDecl *ParamDecl = (*i);
@@ -6344,7 +6344,7 @@ CGObjCNonFragileABIMac::GetInterfaceEHType(const ObjCInterfaceDecl *ID,
                                       ID->getIdentifier()->getName()));
                                       ID->getIdentifier()->getName()));
   }
   }
 
 
-  if (CGM.getLangOptions().getVisibilityMode() == HiddenVisibility)
+  if (CGM.getLangOpts().getVisibilityMode() == HiddenVisibility)
     Entry->setVisibility(llvm::GlobalValue::HiddenVisibility);
     Entry->setVisibility(llvm::GlobalValue::HiddenVisibility);
   Entry->setAlignment(CGM.getTargetData().getABITypeAlignment(
   Entry->setAlignment(CGM.getTargetData().getABITypeAlignment(
       ObjCTypes.EHTypeTy));
       ObjCTypes.EHTypeTy));
@@ -6363,7 +6363,7 @@ CGObjCNonFragileABIMac::GetInterfaceEHType(const ObjCInterfaceDecl *ID,
 
 
 CodeGen::CGObjCRuntime *
 CodeGen::CGObjCRuntime *
 CodeGen::CreateMacObjCRuntime(CodeGen::CodeGenModule &CGM) {
 CodeGen::CreateMacObjCRuntime(CodeGen::CodeGenModule &CGM) {
-  if (CGM.getLangOptions().ObjCNonFragileABI)
+  if (CGM.getLangOpts().ObjCNonFragileABI)
     return new CGObjCNonFragileABIMac(CGM);
     return new CGObjCNonFragileABIMac(CGM);
   return new CGObjCMac(CGM);
   return new CGObjCMac(CGM);
 }
 }

+ 1 - 1
lib/CodeGen/CGObjCRuntime.cpp

@@ -310,7 +310,7 @@ void CGObjCRuntime::EmitAtSynchronizedStmt(CodeGenFunction &CGF,
   // ARC release and lock-release cleanups.
   // ARC release and lock-release cleanups.
   const Expr *lockExpr = S.getSynchExpr();
   const Expr *lockExpr = S.getSynchExpr();
   llvm::Value *lock;
   llvm::Value *lock;
-  if (CGF.getLangOptions().ObjCAutoRefCount) {
+  if (CGF.getLangOpts().ObjCAutoRefCount) {
     lock = CGF.EmitARCRetainScalarExpr(lockExpr);
     lock = CGF.EmitARCRetainScalarExpr(lockExpr);
     lock = CGF.EmitObjCConsumeObject(lockExpr->getType(), lock);
     lock = CGF.EmitObjCConsumeObject(lockExpr->getType(), lock);
   } else {
   } else {

+ 4 - 4
lib/CodeGen/CGRTTI.cpp

@@ -249,7 +249,7 @@ static bool ShouldUseExternalRTTIDescriptor(CodeGenModule &CGM, QualType Ty) {
   ASTContext &Context = CGM.getContext();
   ASTContext &Context = CGM.getContext();
 
 
   // If RTTI is disabled, don't consider key functions.
   // If RTTI is disabled, don't consider key functions.
-  if (!Context.getLangOptions().RTTI) return false;
+  if (!Context.getLangOpts().RTTI) return false;
 
 
   if (const RecordType *RecordTy = dyn_cast<RecordType>(Ty)) {
   if (const RecordType *RecordTy = dyn_cast<RecordType>(Ty)) {
     const CXXRecordDecl *RD = cast<CXXRecordDecl>(RecordTy->getDecl());
     const CXXRecordDecl *RD = cast<CXXRecordDecl>(RecordTy->getDecl());
@@ -326,7 +326,7 @@ getTypeInfoLinkage(CodeGenModule &CGM, QualType Ty) {
     return llvm::GlobalValue::InternalLinkage;
     return llvm::GlobalValue::InternalLinkage;
 
 
   case ExternalLinkage:
   case ExternalLinkage:
-    if (!CGM.getLangOptions().RTTI) {
+    if (!CGM.getLangOpts().RTTI) {
       // RTTI is not enabled, which means that this type info struct is going
       // RTTI is not enabled, which means that this type info struct is going
       // to be used for exception handling. Give it linkonce_odr linkage.
       // to be used for exception handling. Give it linkonce_odr linkage.
       return llvm::GlobalValue::LinkOnceODRLinkage;
       return llvm::GlobalValue::LinkOnceODRLinkage;
@@ -982,10 +982,10 @@ llvm::Constant *CodeGenModule::GetAddrOfRTTIDescriptor(QualType Ty,
   // Return a bogus pointer if RTTI is disabled, unless it's for EH.
   // Return a bogus pointer if RTTI is disabled, unless it's for EH.
   // FIXME: should we even be calling this method if RTTI is disabled
   // FIXME: should we even be calling this method if RTTI is disabled
   // and it's not for EH?
   // and it's not for EH?
-  if (!ForEH && !getContext().getLangOptions().RTTI)
+  if (!ForEH && !getContext().getLangOpts().RTTI)
     return llvm::Constant::getNullValue(Int8PtrTy);
     return llvm::Constant::getNullValue(Int8PtrTy);
   
   
-  if (ForEH && Ty->isObjCObjectPointerType() && !Features.NeXTRuntime)
+  if (ForEH && Ty->isObjCObjectPointerType() && !LangOpts.NeXTRuntime)
     return ObjCRuntime->GetEHType(Ty);
     return ObjCRuntime->GetEHType(Ty);
 
 
   return RTTIBuilder(*this).BuildTypeInfo(Ty);
   return RTTIBuilder(*this).BuildTypeInfo(Ty);

+ 2 - 2
lib/CodeGen/CGRecordLayoutBuilder.cpp

@@ -972,7 +972,7 @@ void CGRecordLayoutBuilder::CheckZeroInitializable(QualType T) {
     return;
     return;
 
 
   // Can only have member pointers if we're compiling C++.
   // Can only have member pointers if we're compiling C++.
-  if (!Types.getContext().getLangOptions().CPlusPlus)
+  if (!Types.getContext().getLangOpts().CPlusPlus)
     return;
     return;
 
 
   const Type *elementType = T->getBaseElementTypeUnsafe();
   const Type *elementType = T->getBaseElementTypeUnsafe();
@@ -1017,7 +1017,7 @@ CGRecordLayout *CodeGenTypes::ComputeRecordLayout(const RecordDecl *D,
   RL->BitFields.swap(Builder.BitFields);
   RL->BitFields.swap(Builder.BitFields);
 
 
   // Dump the layout, if requested.
   // Dump the layout, if requested.
-  if (getContext().getLangOptions().DumpRecordLayouts) {
+  if (getContext().getLangOpts().DumpRecordLayouts) {
     llvm::errs() << "\n*** Dumping IRgen Record Layout\n";
     llvm::errs() << "\n*** Dumping IRgen Record Layout\n";
     llvm::errs() << "Record: ";
     llvm::errs() << "Record: ";
     D->dump();
     D->dump();

+ 1 - 1
lib/CodeGen/CGStmt.cpp

@@ -1370,7 +1370,7 @@ static llvm::MDNode *getAsmSrcLocInfo(const StringLiteral *Str,
   StringRef StrVal = Str->getString();
   StringRef StrVal = Str->getString();
   if (!StrVal.empty()) {
   if (!StrVal.empty()) {
     const SourceManager &SM = CGF.CGM.getContext().getSourceManager();
     const SourceManager &SM = CGF.CGM.getContext().getSourceManager();
-    const LangOptions &LangOpts = CGF.CGM.getLangOptions();
+    const LangOptions &LangOpts = CGF.CGM.getLangOpts();
     
     
     // Add the location of the start of each subsequent line of the asm to the
     // Add the location of the start of each subsequent line of the asm to the
     // MDNode.
     // MDNode.

+ 1 - 1
lib/CodeGen/CGVTables.cpp

@@ -52,7 +52,7 @@ bool CodeGenVTables::ShouldEmitVTableInThisTU(const CXXRecordDecl *RD) {
   // If we're building with optimization, we always emit VTables since that
   // If we're building with optimization, we always emit VTables since that
   // allows for virtual function calls to be devirtualized.
   // allows for virtual function calls to be devirtualized.
   // (We don't want to do this in -fapple-kext mode however).
   // (We don't want to do this in -fapple-kext mode however).
-  if (CGM.getCodeGenOpts().OptimizationLevel && !CGM.getLangOptions().AppleKext)
+  if (CGM.getCodeGenOpts().OptimizationLevel && !CGM.getLangOpts().AppleKext)
     return true;
     return true;
 
 
   return KeyFunction->hasBody();
   return KeyFunction->hasBody();

+ 5 - 5
lib/CodeGen/CodeGenFunction.cpp

@@ -40,7 +40,7 @@ CodeGenFunction::CodeGenFunction(CodeGenModule &cgm)
     CXXVTTValue(0), OutermostConditional(0), TerminateLandingPad(0),
     CXXVTTValue(0), OutermostConditional(0), TerminateLandingPad(0),
     TerminateHandler(0), TrapBB(0) {
     TerminateHandler(0), TrapBB(0) {
 
 
-  CatchUndefined = getContext().getLangOptions().CatchUndefined;
+  CatchUndefined = getContext().getLangOpts().CatchUndefined;
   CGM.getCXXABI().getMangleContext().startNewFunction();
   CGM.getCXXABI().getMangleContext().startNewFunction();
 }
 }
 
 
@@ -274,7 +274,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
         break;
         break;
       }
       }
 
 
-  if (getContext().getLangOptions().OpenCL) {
+  if (getContext().getLangOpts().OpenCL) {
     // Add metadata for a kernel function.
     // Add metadata for a kernel function.
     if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D))
     if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D))
       if (FD->hasAttr<OpenCLKernelAttr>()) {
       if (FD->hasAttr<OpenCLKernelAttr>()) {
@@ -340,7 +340,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy,
     // Tell the epilog emitter to autorelease the result.  We do this
     // Tell the epilog emitter to autorelease the result.  We do this
     // now so that various specialized functions can suppress it
     // now so that various specialized functions can suppress it
     // during their IR-generation.
     // during their IR-generation.
-    if (getLangOptions().ObjCAutoRefCount &&
+    if (getLangOpts().ObjCAutoRefCount &&
         !CurFnInfo->isReturnsRetained() &&
         !CurFnInfo->isReturnsRetained() &&
         RetTy->isObjCRetainableType())
         RetTy->isObjCRetainableType())
       AutoreleaseResult = true;
       AutoreleaseResult = true;
@@ -442,7 +442,7 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn,
     EmitDestructorBody(Args);
     EmitDestructorBody(Args);
   else if (isa<CXXConstructorDecl>(FD))
   else if (isa<CXXConstructorDecl>(FD))
     EmitConstructorBody(Args);
     EmitConstructorBody(Args);
-  else if (getContext().getLangOptions().CUDA &&
+  else if (getContext().getLangOpts().CUDA &&
            !CGM.getCodeGenOpts().CUDAIsDevice &&
            !CGM.getCodeGenOpts().CUDAIsDevice &&
            FD->hasAttr<CUDAGlobalAttr>())
            FD->hasAttr<CUDAGlobalAttr>())
     CGM.getCUDARuntime().EmitDeviceStubBody(*this, Args);
     CGM.getCUDARuntime().EmitDeviceStubBody(*this, Args);
@@ -731,7 +731,7 @@ static void emitNonZeroVLAInit(CodeGenFunction &CGF, QualType baseType,
 void
 void
 CodeGenFunction::EmitNullInitialization(llvm::Value *DestPtr, QualType Ty) {
 CodeGenFunction::EmitNullInitialization(llvm::Value *DestPtr, QualType Ty) {
   // Ignore empty classes in C++.
   // Ignore empty classes in C++.
-  if (getContext().getLangOptions().CPlusPlus) {
+  if (getContext().getLangOpts().CPlusPlus) {
     if (const RecordType *RT = Ty->getAs<RecordType>()) {
     if (const RecordType *RT = Ty->getAs<RecordType>()) {
       if (cast<CXXRecordDecl>(RT->getDecl())->isEmpty())
       if (cast<CXXRecordDecl>(RT->getDecl())->isEmpty())
         return;
         return;

+ 3 - 3
lib/CodeGen/CodeGenFunction.h

@@ -1210,7 +1210,7 @@ public:
     return CGM.getCodeGenOpts().OptimizationLevel == 0;
     return CGM.getCodeGenOpts().OptimizationLevel == 0;
   }
   }
 
 
-  const LangOptions &getLangOptions() const { return CGM.getLangOptions(); }
+  const LangOptions &getLangOpts() const { return CGM.getLangOpts(); }
 
 
   /// Returns a pointer to the function's exception object and selector slot,
   /// Returns a pointer to the function's exception object and selector slot,
   /// which is assigned in every landing pad.
   /// which is assigned in every landing pad.
@@ -1278,9 +1278,9 @@ public:
       return false;
       return false;
     case QualType::DK_cxx_destructor:
     case QualType::DK_cxx_destructor:
     case QualType::DK_objc_weak_lifetime:
     case QualType::DK_objc_weak_lifetime:
-      return getLangOptions().Exceptions;
+      return getLangOpts().Exceptions;
     case QualType::DK_objc_strong_lifetime:
     case QualType::DK_objc_strong_lifetime:
-      return getLangOptions().Exceptions &&
+      return getLangOpts().Exceptions &&
              CGM.getCodeGenOpts().ObjCAutoRefCountExceptions;
              CGM.getCodeGenOpts().ObjCAutoRefCountExceptions;
     }
     }
     llvm_unreachable("bad destruction kind");
     llvm_unreachable("bad destruction kind");

+ 40 - 40
lib/CodeGen/CodeGenModule.cpp

@@ -64,7 +64,7 @@ static CGCXXABI &createCXXABI(CodeGenModule &CGM) {
 CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO,
 CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO,
                              llvm::Module &M, const llvm::TargetData &TD,
                              llvm::Module &M, const llvm::TargetData &TD,
                              DiagnosticsEngine &diags)
                              DiagnosticsEngine &diags)
-  : Context(C), Features(C.getLangOptions()), CodeGenOpts(CGO), TheModule(M),
+  : Context(C), LangOpts(C.getLangOpts()), CodeGenOpts(CGO), TheModule(M),
     TheTargetData(TD), TheTargetCodeGenInfo(0), Diags(diags),
     TheTargetData(TD), TheTargetCodeGenInfo(0), Diags(diags),
     ABI(createCXXABI(*this)), 
     ABI(createCXXABI(*this)), 
     Types(*this),
     Types(*this),
@@ -95,16 +95,16 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO,
   Int8PtrTy = Int8Ty->getPointerTo(0);
   Int8PtrTy = Int8Ty->getPointerTo(0);
   Int8PtrPtrTy = Int8PtrTy->getPointerTo(0);
   Int8PtrPtrTy = Int8PtrTy->getPointerTo(0);
 
 
-  if (Features.ObjC1)
+  if (LangOpts.ObjC1)
     createObjCRuntime();
     createObjCRuntime();
-  if (Features.OpenCL)
+  if (LangOpts.OpenCL)
     createOpenCLRuntime();
     createOpenCLRuntime();
-  if (Features.CUDA)
+  if (LangOpts.CUDA)
     createCUDARuntime();
     createCUDARuntime();
 
 
   // Enable TBAA unless it's suppressed.
   // Enable TBAA unless it's suppressed.
   if (!CodeGenOpts.RelaxedAliasing && CodeGenOpts.OptimizationLevel > 0)
   if (!CodeGenOpts.RelaxedAliasing && CodeGenOpts.OptimizationLevel > 0)
-    TBAA = new CodeGenTBAA(Context, VMContext, getLangOptions(),
+    TBAA = new CodeGenTBAA(Context, VMContext, getLangOpts(),
                            ABI.getMangleContext());
                            ABI.getMangleContext());
 
 
   // If debug info or coverage generation is enabled, create the CGDebugInfo
   // If debug info or coverage generation is enabled, create the CGDebugInfo
@@ -115,7 +115,7 @@ CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO,
 
 
   Block.GlobalUniqueCount = 0;
   Block.GlobalUniqueCount = 0;
 
 
-  if (C.getLangOptions().ObjCAutoRefCount)
+  if (C.getLangOpts().ObjCAutoRefCount)
     ARCData = new ARCEntrypoints();
     ARCData = new ARCEntrypoints();
   RRData = new RREntrypoints();
   RRData = new RREntrypoints();
 }
 }
@@ -133,7 +133,7 @@ CodeGenModule::~CodeGenModule() {
 }
 }
 
 
 void CodeGenModule::createObjCRuntime() {
 void CodeGenModule::createObjCRuntime() {
-  if (!Features.NeXTRuntime)
+  if (!LangOpts.NeXTRuntime)
     ObjCRuntime = CreateGNUObjCRuntime(*this);
     ObjCRuntime = CreateGNUObjCRuntime(*this);
   else
   else
     ObjCRuntime = CreateMacObjCRuntime(*this);
     ObjCRuntime = CreateMacObjCRuntime(*this);
@@ -296,7 +296,7 @@ void CodeGenModule::setTypeVisibility(llvm::GlobalValue *GV,
   // If there's a key function, there may be translation units
   // If there's a key function, there may be translation units
   // that don't have the key function's definition.  But ignore
   // that don't have the key function's definition.  But ignore
   // this if we're emitting RTTI under -fno-rtti.
   // this if we're emitting RTTI under -fno-rtti.
-  if (!(TVK != TVK_ForRTTI) || Features.RTTI) {
+  if (!(TVK != TVK_ForRTTI) || LangOpts.RTTI) {
     if (Context.getKeyFunction(RD))
     if (Context.getKeyFunction(RD))
       return;
       return;
   }
   }
@@ -434,7 +434,7 @@ CodeGenModule::getFunctionLinkage(const FunctionDecl *D) {
   // merged with other definitions. c) C++ has the ODR, so we know the
   // merged with other definitions. c) C++ has the ODR, so we know the
   // definition is dependable.
   // definition is dependable.
   if (Linkage == GVA_CXXInline || Linkage == GVA_TemplateInstantiation)
   if (Linkage == GVA_CXXInline || Linkage == GVA_TemplateInstantiation)
-    return !Context.getLangOptions().AppleKext 
+    return !Context.getLangOpts().AppleKext 
              ? llvm::Function::LinkOnceODRLinkage 
              ? llvm::Function::LinkOnceODRLinkage 
              : llvm::Function::InternalLinkage;
              : llvm::Function::InternalLinkage;
   
   
@@ -443,7 +443,7 @@ CodeGenModule::getFunctionLinkage(const FunctionDecl *D) {
   // and must all be equivalent. However, we are not allowed to
   // and must all be equivalent. However, we are not allowed to
   // throw away these explicit instantiations.
   // throw away these explicit instantiations.
   if (Linkage == GVA_ExplicitTemplateInstantiation)
   if (Linkage == GVA_ExplicitTemplateInstantiation)
-    return !Context.getLangOptions().AppleKext
+    return !Context.getLangOpts().AppleKext
              ? llvm::Function::WeakODRLinkage
              ? llvm::Function::WeakODRLinkage
              : llvm::Function::ExternalLinkage;
              : llvm::Function::ExternalLinkage;
   
   
@@ -478,16 +478,16 @@ void CodeGenModule::SetLLVMFunctionAttributes(const Decl *D,
 /// except under the fragile ObjC ABI with only ObjC exceptions
 /// except under the fragile ObjC ABI with only ObjC exceptions
 /// enabled.  This means, for example, that C with -fexceptions
 /// enabled.  This means, for example, that C with -fexceptions
 /// enables this.
 /// enables this.
-static bool hasUnwindExceptions(const LangOptions &Features) {
+static bool hasUnwindExceptions(const LangOptions &LangOpts) {
   // If exceptions are completely disabled, obviously this is false.
   // If exceptions are completely disabled, obviously this is false.
-  if (!Features.Exceptions) return false;
+  if (!LangOpts.Exceptions) return false;
 
 
   // If C++ exceptions are enabled, this is true.
   // If C++ exceptions are enabled, this is true.
-  if (Features.CXXExceptions) return true;
+  if (LangOpts.CXXExceptions) return true;
 
 
   // If ObjC exceptions are enabled, this depends on the ABI.
   // If ObjC exceptions are enabled, this depends on the ABI.
-  if (Features.ObjCExceptions) {
-    if (!Features.ObjCNonFragileABI) return false;
+  if (LangOpts.ObjCExceptions) {
+    if (!LangOpts.ObjCNonFragileABI) return false;
   }
   }
 
 
   return true;
   return true;
@@ -498,7 +498,7 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
   if (CodeGenOpts.UnwindTables)
   if (CodeGenOpts.UnwindTables)
     F->setHasUWTable();
     F->setHasUWTable();
 
 
-  if (!hasUnwindExceptions(Features))
+  if (!hasUnwindExceptions(LangOpts))
     F->addFnAttr(llvm::Attribute::NoUnwind);
     F->addFnAttr(llvm::Attribute::NoUnwind);
 
 
   if (D->hasAttr<NakedAttr>()) {
   if (D->hasAttr<NakedAttr>()) {
@@ -518,12 +518,12 @@ void CodeGenModule::SetLLVMFunctionAttributesForDefinition(const Decl *D,
   if (isa<CXXConstructorDecl>(D) || isa<CXXDestructorDecl>(D))
   if (isa<CXXConstructorDecl>(D) || isa<CXXDestructorDecl>(D))
     F->setUnnamedAddr(true);
     F->setUnnamedAddr(true);
 
 
-  if (Features.getStackProtector() == LangOptions::SSPOn)
+  if (LangOpts.getStackProtector() == LangOptions::SSPOn)
     F->addFnAttr(llvm::Attribute::StackProtect);
     F->addFnAttr(llvm::Attribute::StackProtect);
-  else if (Features.getStackProtector() == LangOptions::SSPReq)
+  else if (LangOpts.getStackProtector() == LangOptions::SSPReq)
     F->addFnAttr(llvm::Attribute::StackProtectReq);
     F->addFnAttr(llvm::Attribute::StackProtectReq);
   
   
-  if (Features.AddressSanitizer) {
+  if (LangOpts.AddressSanitizer) {
     // When AddressSanitizer is enabled, set AddressSafety attribute
     // When AddressSanitizer is enabled, set AddressSafety attribute
     // unless __attribute__((no_address_safety_analysis)) is used.
     // unless __attribute__((no_address_safety_analysis)) is used.
     if (!D->hasAttr<NoAddressSafetyAnalysisAttr>())
     if (!D->hasAttr<NoAddressSafetyAnalysisAttr>())
@@ -752,7 +752,7 @@ void CodeGenModule::AddGlobalAnnotations(const ValueDecl *D,
 
 
 bool CodeGenModule::MayDeferGeneration(const ValueDecl *Global) {
 bool CodeGenModule::MayDeferGeneration(const ValueDecl *Global) {
   // Never defer when EmitAllDecls is specified.
   // Never defer when EmitAllDecls is specified.
-  if (Features.EmitAllDecls)
+  if (LangOpts.EmitAllDecls)
     return false;
     return false;
 
 
   return !getContext().DeclMustBeEmitted(Global);
   return !getContext().DeclMustBeEmitted(Global);
@@ -796,7 +796,7 @@ void CodeGenModule::EmitGlobal(GlobalDecl GD) {
     return EmitAliasDefinition(GD);
     return EmitAliasDefinition(GD);
 
 
   // If this is CUDA, be selective about which declarations we emit.
   // If this is CUDA, be selective about which declarations we emit.
-  if (Features.CUDA) {
+  if (LangOpts.CUDA) {
     if (CodeGenOpts.CUDAIsDevice) {
     if (CodeGenOpts.CUDAIsDevice) {
       if (!Global->hasAttr<CUDADeviceAttr>() &&
       if (!Global->hasAttr<CUDADeviceAttr>() &&
           !Global->hasAttr<CUDAGlobalAttr>() &&
           !Global->hasAttr<CUDAGlobalAttr>() &&
@@ -848,7 +848,7 @@ void CodeGenModule::EmitGlobal(GlobalDecl GD) {
 
 
   // If we're deferring emission of a C++ variable with an
   // If we're deferring emission of a C++ variable with an
   // initializer, remember the order in which it appeared in the file.
   // initializer, remember the order in which it appeared in the file.
-  if (getLangOptions().CPlusPlus && isa<VarDecl>(Global) &&
+  if (getLangOpts().CPlusPlus && isa<VarDecl>(Global) &&
       cast<VarDecl>(Global)->hasInit()) {
       cast<VarDecl>(Global)->hasInit()) {
     DelayedCXXInitPosition[Global] = CXXGlobalInits.size();
     DelayedCXXInitPosition[Global] = CXXGlobalInits.size();
     CXXGlobalInits.push_back(0);
     CXXGlobalInits.push_back(0);
@@ -1048,7 +1048,7 @@ CodeGenModule::GetOrCreateLLVMFunction(StringRef MangledName,
   //
   //
   // We also don't emit a definition for a function if it's going to be an entry
   // We also don't emit a definition for a function if it's going to be an entry
   // in a vtable, unless it's already marked as used.
   // in a vtable, unless it's already marked as used.
-  } else if (getLangOptions().CPlusPlus && D.getDecl()) {
+  } else if (getLangOpts().CPlusPlus && D.getDecl()) {
     // Look for a declaration that's lexically in a record.
     // Look for a declaration that's lexically in a record.
     const FunctionDecl *FD = cast<FunctionDecl>(D.getDecl());
     const FunctionDecl *FD = cast<FunctionDecl>(D.getDecl());
     do {
     do {
@@ -1110,7 +1110,7 @@ bool CodeGenModule::isTypeConstant(QualType Ty, bool ExcludeCtor) {
   if (!Ty.isConstant(Context) && !Ty->isReferenceType())
   if (!Ty.isConstant(Context) && !Ty->isReferenceType())
     return false;
     return false;
 
 
-  if (Context.getLangOptions().CPlusPlus) {
+  if (Context.getLangOpts().CPlusPlus) {
     if (const CXXRecordDecl *Record
     if (const CXXRecordDecl *Record
           = Context.getBaseElementType(Ty)->getAsCXXRecordDecl())
           = Context.getBaseElementType(Ty)->getAsCXXRecordDecl())
       return ExcludeCtor && !Record->hasMutableFields() &&
       return ExcludeCtor && !Record->hasMutableFields() &&
@@ -1309,19 +1309,19 @@ CodeGenModule::getVTableLinkage(const CXXRecordDecl *RD) {
           return llvm::GlobalVariable::AvailableExternallyLinkage;
           return llvm::GlobalVariable::AvailableExternallyLinkage;
 
 
         if (KeyFunction->isInlined())
         if (KeyFunction->isInlined())
-          return !Context.getLangOptions().AppleKext ?
+          return !Context.getLangOpts().AppleKext ?
                    llvm::GlobalVariable::LinkOnceODRLinkage :
                    llvm::GlobalVariable::LinkOnceODRLinkage :
                    llvm::Function::InternalLinkage;
                    llvm::Function::InternalLinkage;
         
         
         return llvm::GlobalVariable::ExternalLinkage;
         return llvm::GlobalVariable::ExternalLinkage;
         
         
       case TSK_ImplicitInstantiation:
       case TSK_ImplicitInstantiation:
-        return !Context.getLangOptions().AppleKext ?
+        return !Context.getLangOpts().AppleKext ?
                  llvm::GlobalVariable::LinkOnceODRLinkage :
                  llvm::GlobalVariable::LinkOnceODRLinkage :
                  llvm::Function::InternalLinkage;
                  llvm::Function::InternalLinkage;
 
 
       case TSK_ExplicitInstantiationDefinition:
       case TSK_ExplicitInstantiationDefinition:
-        return !Context.getLangOptions().AppleKext ?
+        return !Context.getLangOpts().AppleKext ?
                  llvm::GlobalVariable::WeakODRLinkage :
                  llvm::GlobalVariable::WeakODRLinkage :
                  llvm::Function::InternalLinkage;
                  llvm::Function::InternalLinkage;
   
   
@@ -1329,13 +1329,13 @@ CodeGenModule::getVTableLinkage(const CXXRecordDecl *RD) {
         // FIXME: Use available_externally linkage. However, this currently
         // FIXME: Use available_externally linkage. However, this currently
         // breaks LLVM's build due to undefined symbols.
         // breaks LLVM's build due to undefined symbols.
         //      return llvm::GlobalVariable::AvailableExternallyLinkage;
         //      return llvm::GlobalVariable::AvailableExternallyLinkage;
-        return !Context.getLangOptions().AppleKext ?
+        return !Context.getLangOpts().AppleKext ?
                  llvm::GlobalVariable::LinkOnceODRLinkage :
                  llvm::GlobalVariable::LinkOnceODRLinkage :
                  llvm::Function::InternalLinkage;
                  llvm::Function::InternalLinkage;
     }
     }
   }
   }
   
   
-  if (Context.getLangOptions().AppleKext)
+  if (Context.getLangOpts().AppleKext)
     return llvm::Function::InternalLinkage;
     return llvm::Function::InternalLinkage;
   
   
   switch (RD->getTemplateSpecializationKind()) {
   switch (RD->getTemplateSpecializationKind()) {
@@ -1515,7 +1515,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
       if (D->getType()->isReferenceType())
       if (D->getType()->isReferenceType())
         T = D->getType();
         T = D->getType();
 
 
-      if (getLangOptions().CPlusPlus) {
+      if (getLangOpts().CPlusPlus) {
         Init = EmitNullConstant(T);
         Init = EmitNullConstant(T);
         NeedsGlobalCtor = true;
         NeedsGlobalCtor = true;
       } else {
       } else {
@@ -1526,7 +1526,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
       // We don't need an initializer, so remove the entry for the delayed
       // We don't need an initializer, so remove the entry for the delayed
       // initializer position (just in case this entry was delayed) if we
       // initializer position (just in case this entry was delayed) if we
       // also don't need to register a destructor.
       // also don't need to register a destructor.
-      if (getLangOptions().CPlusPlus && !NeedsGlobalDtor)
+      if (getLangOpts().CPlusPlus && !NeedsGlobalDtor)
         DelayedCXXInitPosition.erase(D);
         DelayedCXXInitPosition.erase(D);
     }
     }
   }
   }
@@ -1622,7 +1622,7 @@ CodeGenModule::GetLLVMLinkageVarDefinition(const VarDecl *D,
   } else if (Linkage == GVA_TemplateInstantiation ||
   } else if (Linkage == GVA_TemplateInstantiation ||
              Linkage == GVA_ExplicitTemplateInstantiation)
              Linkage == GVA_ExplicitTemplateInstantiation)
     return llvm::GlobalVariable::WeakODRLinkage;
     return llvm::GlobalVariable::WeakODRLinkage;
-  else if (!getLangOptions().CPlusPlus && 
+  else if (!getLangOpts().CPlusPlus && 
            ((!CodeGenOpts.NoCommon && !D->getAttr<NoCommonAttr>()) ||
            ((!CodeGenOpts.NoCommon && !D->getAttr<NoCommonAttr>()) ||
              D->getAttr<CommonAttr>()) &&
              D->getAttr<CommonAttr>()) &&
            !D->hasExternalStorage() && !D->getInit() &&
            !D->hasExternalStorage() && !D->getInit() &&
@@ -2036,7 +2036,7 @@ static RecordDecl *
 CreateRecordDecl(const ASTContext &Ctx, RecordDecl::TagKind TK,
 CreateRecordDecl(const ASTContext &Ctx, RecordDecl::TagKind TK,
                  DeclContext *DC, IdentifierInfo *Id) {
                  DeclContext *DC, IdentifierInfo *Id) {
   SourceLocation Loc;
   SourceLocation Loc;
-  if (Ctx.getLangOptions().CPlusPlus)
+  if (Ctx.getLangOpts().CPlusPlus)
     return CXXRecordDecl::Create(Ctx, TK, DC, Loc, Loc, Id);
     return CXXRecordDecl::Create(Ctx, TK, DC, Loc, Loc, Id);
   else
   else
     return RecordDecl::Create(Ctx, TK, DC, Loc, Loc, Id);
     return RecordDecl::Create(Ctx, TK, DC, Loc, Loc, Id);
@@ -2056,10 +2056,10 @@ CodeGenModule::GetAddrOfConstantString(const StringLiteral *Literal) {
   
   
   // If we don't already have it, get _NSConstantStringClassReference.
   // If we don't already have it, get _NSConstantStringClassReference.
   if (!ConstantStringClassRef) {
   if (!ConstantStringClassRef) {
-    std::string StringClass(getLangOptions().ObjCConstantStringClass);
+    std::string StringClass(getLangOpts().ObjCConstantStringClass);
     llvm::Type *Ty = getTypes().ConvertType(getContext().IntTy);
     llvm::Type *Ty = getTypes().ConvertType(getContext().IntTy);
     llvm::Constant *GV;
     llvm::Constant *GV;
-    if (Features.ObjCNonFragileABI) {
+    if (LangOpts.ObjCNonFragileABI) {
       std::string str = 
       std::string str = 
         StringClass.empty() ? "OBJC_CLASS_$_NSConstantString" 
         StringClass.empty() ? "OBJC_CLASS_$_NSConstantString" 
                             : "OBJC_CLASS_$_" + StringClass;
                             : "OBJC_CLASS_$_" + StringClass;
@@ -2126,7 +2126,7 @@ CodeGenModule::GetAddrOfConstantString(const StringLiteral *Literal) {
   llvm::GlobalValue::LinkageTypes Linkage;
   llvm::GlobalValue::LinkageTypes Linkage;
   bool isConstant;
   bool isConstant;
   Linkage = llvm::GlobalValue::PrivateLinkage;
   Linkage = llvm::GlobalValue::PrivateLinkage;
-  isConstant = !Features.WritableStrings;
+  isConstant = !LangOpts.WritableStrings;
   
   
   llvm::GlobalVariable *GV =
   llvm::GlobalVariable *GV =
   new llvm::GlobalVariable(getModule(), C->getType(), isConstant, Linkage, C,
   new llvm::GlobalVariable(getModule(), C->getType(), isConstant, Linkage, C,
@@ -2147,7 +2147,7 @@ CodeGenModule::GetAddrOfConstantString(const StringLiteral *Literal) {
                                 "_unnamed_nsstring_");
                                 "_unnamed_nsstring_");
   // FIXME. Fix section.
   // FIXME. Fix section.
   if (const char *Sect = 
   if (const char *Sect = 
-        Features.ObjCNonFragileABI 
+        LangOpts.ObjCNonFragileABI 
           ? getContext().getTargetInfo().getNSStringNonFragileABISection() 
           ? getContext().getTargetInfo().getNSStringNonFragileABISection() 
           : getContext().getTargetInfo().getNSStringSection())
           : getContext().getTargetInfo().getNSStringSection())
     GV->setSection(Sect);
     GV->setSection(Sect);
@@ -2250,7 +2250,7 @@ CodeGenModule::GetAddrOfConstantStringFromLiteral(const StringLiteral *S) {
   llvm::Constant *C = GetConstantArrayFromStringLiteral(S);
   llvm::Constant *C = GetConstantArrayFromStringLiteral(S);
   llvm::GlobalVariable *GV =
   llvm::GlobalVariable *GV =
     new llvm::GlobalVariable(getModule(),C->getType(),
     new llvm::GlobalVariable(getModule(),C->getType(),
-                             !Features.WritableStrings,
+                             !LangOpts.WritableStrings,
                              llvm::GlobalValue::PrivateLinkage,
                              llvm::GlobalValue::PrivateLinkage,
                              C,".str");
                              C,".str");
 
 
@@ -2306,7 +2306,7 @@ llvm::Constant *CodeGenModule::GetAddrOfConstantString(StringRef Str,
     GlobalName = ".str";
     GlobalName = ".str";
 
 
   // Don't share any string literals if strings aren't constant.
   // Don't share any string literals if strings aren't constant.
-  if (Features.WritableStrings)
+  if (LangOpts.WritableStrings)
     return GenerateStringLiteral(Str, false, *this, GlobalName, Alignment);
     return GenerateStringLiteral(Str, false, *this, GlobalName, Alignment);
 
 
   llvm::StringMapEntry<llvm::GlobalVariable *> &Entry =
   llvm::StringMapEntry<llvm::GlobalVariable *> &Entry =
@@ -2530,7 +2530,7 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) {
 
 
   case Decl::ObjCImplementation: {
   case Decl::ObjCImplementation: {
     ObjCImplementationDecl *OMD = cast<ObjCImplementationDecl>(D);
     ObjCImplementationDecl *OMD = cast<ObjCImplementationDecl>(D);
-    if (Features.ObjCNonFragileABI2 && OMD->hasSynthBitfield())
+    if (LangOpts.ObjCNonFragileABI2 && OMD->hasSynthBitfield())
       Context.ResetObjCLayout(OMD->getClassInterface());
       Context.ResetObjCLayout(OMD->getClassInterface());
     EmitObjCPropertyImplementations(OMD);
     EmitObjCPropertyImplementations(OMD);
     EmitObjCIvarInitializations(OMD);
     EmitObjCIvarInitializations(OMD);

+ 3 - 3
lib/CodeGen/CodeGenModule.h

@@ -215,7 +215,7 @@ class CodeGenModule : public CodeGenTypeCache {
   typedef std::vector<std::pair<llvm::Constant*, int> > CtorList;
   typedef std::vector<std::pair<llvm::Constant*, int> > CtorList;
 
 
   ASTContext &Context;
   ASTContext &Context;
-  const LangOptions &Features;
+  const LangOptions &LangOpts;
   const CodeGenOptions &CodeGenOpts;
   const CodeGenOptions &CodeGenOpts;
   llvm::Module &TheModule;
   llvm::Module &TheModule;
   const llvm::TargetData &TheTargetData;
   const llvm::TargetData &TheTargetData;
@@ -388,7 +388,7 @@ public:
   CGCXXABI &getCXXABI() { return ABI; }
   CGCXXABI &getCXXABI() { return ABI; }
 
 
   ARCEntrypoints &getARCEntrypoints() const {
   ARCEntrypoints &getARCEntrypoints() const {
-    assert(getLangOptions().ObjCAutoRefCount && ARCData != 0);
+    assert(getLangOpts().ObjCAutoRefCount && ARCData != 0);
     return *ARCData;
     return *ARCData;
   }
   }
 
 
@@ -433,7 +433,7 @@ public:
 
 
   ASTContext &getContext() const { return Context; }
   ASTContext &getContext() const { return Context; }
   const CodeGenOptions &getCodeGenOpts() const { return CodeGenOpts; }
   const CodeGenOptions &getCodeGenOpts() const { return CodeGenOpts; }
-  const LangOptions &getLangOptions() const { return Features; }
+  const LangOptions &getLangOpts() const { return LangOpts; }
   llvm::Module &getModule() const { return TheModule; }
   llvm::Module &getModule() const { return TheModule; }
   CodeGenTypes &getTypes() { return Types; }
   CodeGenTypes &getTypes() { return Types; }
   CodeGenVTables &getVTables() { return VTables; }
   CodeGenVTables &getVTables() { return VTables; }

+ 1 - 1
lib/CodeGen/CodeGenTypes.cpp

@@ -651,7 +651,7 @@ CodeGenTypes::getCGRecordLayout(const RecordDecl *RD) {
 
 
 bool CodeGenTypes::isZeroInitializable(QualType T) {
 bool CodeGenTypes::isZeroInitializable(QualType T) {
   // No need to check for member pointers when not compiling C++.
   // No need to check for member pointers when not compiling C++.
-  if (!Context.getLangOptions().CPlusPlus)
+  if (!Context.getLangOpts().CPlusPlus)
     return true;
     return true;
   
   
   T = Context.getBaseElementType(T);
   T = Context.getBaseElementType(T);

+ 2 - 2
lib/CodeGen/ItaniumCXXABI.cpp

@@ -805,7 +805,7 @@ bool ItaniumCXXABI::NeedsArrayCookie(const CXXNewExpr *expr) {
   // Automatic Reference Counting:
   // Automatic Reference Counting:
   //   We need an array cookie for pointers with strong or weak lifetime.
   //   We need an array cookie for pointers with strong or weak lifetime.
   QualType AllocatedType = expr->getAllocatedType();
   QualType AllocatedType = expr->getAllocatedType();
-  if (getContext().getLangOptions().ObjCAutoRefCount &&
+  if (getContext().getLangOpts().ObjCAutoRefCount &&
       AllocatedType->isObjCLifetimeType()) {
       AllocatedType->isObjCLifetimeType()) {
     switch (AllocatedType.getObjCLifetime()) {
     switch (AllocatedType.getObjCLifetime()) {
     case Qualifiers::OCL_None:
     case Qualifiers::OCL_None:
@@ -1071,7 +1071,7 @@ void ItaniumCXXABI::EmitGuardedInit(CodeGenFunction &CGF,
   // We only need to use thread-safe statics for local variables;
   // We only need to use thread-safe statics for local variables;
   // global initialization is always single-threaded.
   // global initialization is always single-threaded.
   bool threadsafe =
   bool threadsafe =
-    (getContext().getLangOptions().ThreadsafeStatics && D.isLocalVarDecl());
+    (getContext().getLangOpts().ThreadsafeStatics && D.isLocalVarDecl());
 
 
   llvm::IntegerType *GuardTy;
   llvm::IntegerType *GuardTy;
 
 

+ 1 - 1
lib/CodeGen/ModuleBuilder.cpp

@@ -79,7 +79,7 @@ namespace {
       
       
       // In C++, we may have member functions that need to be emitted at this 
       // In C++, we may have member functions that need to be emitted at this 
       // point.
       // point.
-      if (Ctx->getLangOptions().CPlusPlus && !D->isDependentContext()) {
+      if (Ctx->getLangOpts().CPlusPlus && !D->isDependentContext()) {
         for (DeclContext::decl_iterator M = D->decls_begin(), 
         for (DeclContext::decl_iterator M = D->decls_begin(), 
                                      MEnd = D->decls_end();
                                      MEnd = D->decls_end();
              M != MEnd; ++M)
              M != MEnd; ++M)

+ 4 - 4
lib/CodeGen/TargetInfo.cpp

@@ -2882,7 +2882,7 @@ void PTXABIInfo::computeInfo(CGFunctionInfo &FI) const {
 
 
   // Calling convention as default by an ABI.
   // Calling convention as default by an ABI.
   llvm::CallingConv::ID DefaultCC;
   llvm::CallingConv::ID DefaultCC;
-  const LangOptions &LangOpts = getContext().getLangOptions();
+  const LangOptions &LangOpts = getContext().getLangOpts();
   if (LangOpts.OpenCL || LangOpts.CUDA) {
   if (LangOpts.OpenCL || LangOpts.CUDA) {
     // If we are in OpenCL or CUDA mode, then default to device functions
     // If we are in OpenCL or CUDA mode, then default to device functions
     DefaultCC = llvm::CallingConv::PTX_Device;
     DefaultCC = llvm::CallingConv::PTX_Device;
@@ -2913,7 +2913,7 @@ void PTXTargetCodeGenInfo::SetTargetAttributes(const Decl *D,
   llvm::Function *F = cast<llvm::Function>(GV);
   llvm::Function *F = cast<llvm::Function>(GV);
 
 
   // Perform special handling in OpenCL mode
   // Perform special handling in OpenCL mode
-  if (M.getLangOptions().OpenCL) {
+  if (M.getLangOpts().OpenCL) {
     // Use OpenCL function attributes to set proper calling conventions
     // Use OpenCL function attributes to set proper calling conventions
     // By default, all functions are device functions
     // By default, all functions are device functions
     if (FD->hasAttr<OpenCLKernelAttr>()) {
     if (FD->hasAttr<OpenCLKernelAttr>()) {
@@ -2925,7 +2925,7 @@ void PTXTargetCodeGenInfo::SetTargetAttributes(const Decl *D,
   }
   }
 
 
   // Perform special handling in CUDA mode.
   // Perform special handling in CUDA mode.
-  if (M.getLangOptions().CUDA) {
+  if (M.getLangOpts().CUDA) {
     // CUDA __global__ functions get a kernel calling convention.  Since
     // CUDA __global__ functions get a kernel calling convention.  Since
     // __global__ functions cannot be called from the device, we do not
     // __global__ functions cannot be called from the device, we do not
     // need to set the noinline attribute.
     // need to set the noinline attribute.
@@ -3420,7 +3420,7 @@ void TCETargetCodeGenInfo::SetTargetAttributes(const Decl *D,
 
 
   llvm::Function *F = cast<llvm::Function>(GV);
   llvm::Function *F = cast<llvm::Function>(GV);
   
   
-  if (M.getLangOptions().OpenCL) {
+  if (M.getLangOpts().OpenCL) {
     if (FD->hasAttr<OpenCLKernelAttr>()) {
     if (FD->hasAttr<OpenCLKernelAttr>()) {
       // OpenCL C Kernel functions are not subject to inlining
       // OpenCL C Kernel functions are not subject to inlining
       F->addFnAttr(llvm::Attribute::NoInline);
       F->addFnAttr(llvm::Attribute::NoInline);

+ 1 - 1
lib/Edit/Commit.cpp

@@ -36,7 +36,7 @@ CharSourceRange Commit::Edit::getInsertFromRange(SourceManager &SM) const {
 }
 }
 
 
 Commit::Commit(EditedSource &Editor)
 Commit::Commit(EditedSource &Editor)
-  : SourceMgr(Editor.getSourceManager()), LangOpts(Editor.getLangOptions()),
+  : SourceMgr(Editor.getSourceManager()), LangOpts(Editor.getLangOpts()),
     PPRec(Editor.getPreprocessingRecord()),
     PPRec(Editor.getPreprocessingRecord()),
     Editor(&Editor), IsCommitable(true) { }
     Editor(&Editor), IsCommitable(true) { }
 
 

+ 1 - 1
lib/Edit/RewriteObjCFoundationAPI.cpp

@@ -392,7 +392,7 @@ static bool getLiteralInfo(SourceRange literalRange,
     return false;
     return false;
   StringRef text = Lexer::getSourceText(
   StringRef text = Lexer::getSourceText(
                                   CharSourceRange::getTokenRange(literalRange),
                                   CharSourceRange::getTokenRange(literalRange),
-                                  Ctx.getSourceManager(), Ctx.getLangOptions());
+                                  Ctx.getSourceManager(), Ctx.getLangOpts());
   if (text.empty())
   if (text.empty())
     return false;
     return false;
 
 

+ 1 - 1
lib/Frontend/ASTMerge.cpp

@@ -34,7 +34,7 @@ bool ASTMergeAction::BeginSourceFileAction(CompilerInstance &CI,
 void ASTMergeAction::ExecuteAction() {
 void ASTMergeAction::ExecuteAction() {
   CompilerInstance &CI = getCompilerInstance();
   CompilerInstance &CI = getCompilerInstance();
   CI.getDiagnostics().getClient()->BeginSourceFile(
   CI.getDiagnostics().getClient()->BeginSourceFile(
-                                         CI.getASTContext().getLangOptions());
+                                         CI.getASTContext().getLangOpts());
   CI.getDiagnostics().SetArgToStringFn(&FormatASTNodeDiagnosticArgument,
   CI.getDiagnostics().SetArgToStringFn(&FormatASTNodeDiagnosticArgument,
                                        &CI.getASTContext());
                                        &CI.getASTContext());
   IntrusiveRefCntPtr<DiagnosticIDs>
   IntrusiveRefCntPtr<DiagnosticIDs>

+ 5 - 5
lib/Frontend/ASTUnit.cpp

@@ -364,7 +364,7 @@ void ASTUnit::CacheCodeCompletionResults() {
       CachedResult.Completion = Results[I].CreateCodeCompletionString(*TheSema,
       CachedResult.Completion = Results[I].CreateCodeCompletionString(*TheSema,
                                                     *CachedCompletionAllocator);
                                                     *CachedCompletionAllocator);
       CachedResult.ShowInContexts = getDeclShowContexts(Results[I].Declaration,
       CachedResult.ShowInContexts = getDeclShowContexts(Results[I].Declaration,
-                                                        Ctx->getLangOptions(),
+                                                        Ctx->getLangOpts(),
                                                         IsNestedNameSpecifier);
                                                         IsNestedNameSpecifier);
       CachedResult.Priority = Results[I].Priority;
       CachedResult.Priority = Results[I].Priority;
       CachedResult.Kind = Results[I].CursorKind;
       CachedResult.Kind = Results[I].CursorKind;
@@ -397,7 +397,7 @@ void ASTUnit::CacheCodeCompletionResults() {
       CachedCompletionResults.push_back(CachedResult);
       CachedCompletionResults.push_back(CachedResult);
       
       
       /// Handle nested-name-specifiers in C++.
       /// Handle nested-name-specifiers in C++.
-      if (TheSema->Context.getLangOptions().CPlusPlus && 
+      if (TheSema->Context.getLangOpts().CPlusPlus && 
           IsNestedNameSpecifier && !Results[I].StartsNestedNameSpecifier) {
           IsNestedNameSpecifier && !Results[I].StartsNestedNameSpecifier) {
         // The contexts in which a nested-name-specifier can appear in C++.
         // The contexts in which a nested-name-specifier can appear in C++.
         unsigned NNSContexts
         unsigned NNSContexts
@@ -2033,7 +2033,7 @@ namespace {
         | (1LL << (CodeCompletionContext::CCC_ParenthesizedExpression - 1))
         | (1LL << (CodeCompletionContext::CCC_ParenthesizedExpression - 1))
         | (1LL << (CodeCompletionContext::CCC_Recovery - 1));
         | (1LL << (CodeCompletionContext::CCC_Recovery - 1));
 
 
-      if (AST.getASTContext().getLangOptions().CPlusPlus)
+      if (AST.getASTContext().getLangOpts().CPlusPlus)
         NormalContexts |= (1LL << (CodeCompletionContext::CCC_EnumTag - 1))
         NormalContexts |= (1LL << (CodeCompletionContext::CCC_EnumTag - 1))
                    | (1LL << (CodeCompletionContext::CCC_UnionTag - 1))
                    | (1LL << (CodeCompletionContext::CCC_UnionTag - 1))
                    | (1LL << (CodeCompletionContext::CCC_ClassOrStructTag - 1));
                    | (1LL << (CodeCompletionContext::CCC_ClassOrStructTag - 1));
@@ -2124,7 +2124,7 @@ static void CalculateHiddenNames(const CodeCompletionContext &Context,
       unsigned HiddenIDNS = (Decl::IDNS_Type | Decl::IDNS_Member | 
       unsigned HiddenIDNS = (Decl::IDNS_Type | Decl::IDNS_Member | 
                              Decl::IDNS_Namespace | Decl::IDNS_Ordinary |
                              Decl::IDNS_Namespace | Decl::IDNS_Ordinary |
                              Decl::IDNS_NonMemberOperator);
                              Decl::IDNS_NonMemberOperator);
-      if (Ctx.getLangOptions().CPlusPlus)
+      if (Ctx.getLangOpts().CPlusPlus)
         HiddenIDNS |= Decl::IDNS_Tag;
         HiddenIDNS |= Decl::IDNS_Tag;
       Hiding = (IDNS & HiddenIDNS);
       Hiding = (IDNS & HiddenIDNS);
     }
     }
@@ -2184,7 +2184,7 @@ void AugmentedCodeCompleteConsumer::ProcessCodeCompleteResults(Sema &S,
     if (!Context.getPreferredType().isNull()) {
     if (!Context.getPreferredType().isNull()) {
       if (C->Kind == CXCursor_MacroDefinition) {
       if (C->Kind == CXCursor_MacroDefinition) {
         Priority = getMacroUsagePriority(C->Completion->getTypedText(),
         Priority = getMacroUsagePriority(C->Completion->getTypedText(),
-                                         S.getLangOptions(),
+                                         S.getLangOpts(),
                                Context.getPreferredType()->isAnyPointerType());        
                                Context.getPreferredType()->isAnyPointerType());        
       } else if (C->Type) {
       } else if (C->Type) {
         CanQualType Expected
         CanQualType Expected

+ 1 - 1
lib/Frontend/CacheTokens.cpp

@@ -467,7 +467,7 @@ void PTHWriter::GeneratePTH(const std::string &MainFile) {
   // Iterate over all the files in SourceManager.  Create a lexer
   // Iterate over all the files in SourceManager.  Create a lexer
   // for each file and cache the tokens.
   // for each file and cache the tokens.
   SourceManager &SM = PP.getSourceManager();
   SourceManager &SM = PP.getSourceManager();
-  const LangOptions &LOpts = PP.getLangOptions();
+  const LangOptions &LOpts = PP.getLangOpts();
 
 
   for (SourceManager::fileinfo_iterator I = SM.fileinfo_begin(),
   for (SourceManager::fileinfo_iterator I = SM.fileinfo_begin(),
        E = SM.fileinfo_end(); I != E; ++I) {
        E = SM.fileinfo_end(); I != E; ++I) {

+ 1 - 1
lib/Frontend/ChainedIncludesSource.cpp

@@ -116,7 +116,7 @@ ChainedIncludesSource *ChainedIncludesSource::create(CompilerInstance &CI) {
     if (firstInclude) {
     if (firstInclude) {
       Preprocessor &PP = Clang->getPreprocessor();
       Preprocessor &PP = Clang->getPreprocessor();
       PP.getBuiltinInfo().InitializeBuiltins(PP.getIdentifierTable(),
       PP.getBuiltinInfo().InitializeBuiltins(PP.getIdentifierTable(),
-                                             PP.getLangOptions());
+                                             PP.getLangOpts());
     } else {
     } else {
       assert(!serialBufs.empty());
       assert(!serialBufs.empty());
       SmallVector<llvm::MemoryBuffer *, 4> bufs;
       SmallVector<llvm::MemoryBuffer *, 4> bufs;

+ 1 - 1
lib/Frontend/FrontendAction.cpp

@@ -284,7 +284,7 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
   if (!CI.hasASTContext() || !CI.getASTContext().getExternalSource()) {
   if (!CI.hasASTContext() || !CI.getASTContext().getExternalSource()) {
     Preprocessor &PP = CI.getPreprocessor();
     Preprocessor &PP = CI.getPreprocessor();
     PP.getBuiltinInfo().InitializeBuiltins(PP.getIdentifierTable(),
     PP.getBuiltinInfo().InitializeBuiltins(PP.getIdentifierTable(),
-                                           PP.getLangOptions());
+                                           PP.getLangOpts());
   }
   }
 
 
   // If there is a layout overrides file, attach an external AST source that
   // If there is a layout overrides file, attach an external AST source that

+ 1 - 1
lib/Frontend/FrontendActions.cpp

@@ -364,7 +364,7 @@ void DumpRawTokensAction::ExecuteAction() {
 
 
   // Start lexing the specified input file.
   // Start lexing the specified input file.
   const llvm::MemoryBuffer *FromFile = SM.getBuffer(SM.getMainFileID());
   const llvm::MemoryBuffer *FromFile = SM.getBuffer(SM.getMainFileID());
-  Lexer RawLex(SM.getMainFileID(), FromFile, SM, PP.getLangOptions());
+  Lexer RawLex(SM.getMainFileID(), FromFile, SM, PP.getLangOpts());
   RawLex.SetKeepWhitespaceMode(true);
   RawLex.SetKeepWhitespaceMode(true);
 
 
   Token RawTok;
   Token RawTok;

+ 6 - 6
lib/Frontend/InitPreprocessor.cpp

@@ -632,7 +632,7 @@ void clang::InitializePreprocessor(Preprocessor &PP,
                                    const PreprocessorOptions &InitOpts,
                                    const PreprocessorOptions &InitOpts,
                                    const HeaderSearchOptions &HSOpts,
                                    const HeaderSearchOptions &HSOpts,
                                    const FrontendOptions &FEOpts) {
                                    const FrontendOptions &FEOpts) {
-  const LangOptions &LangOpts = PP.getLangOptions();
+  const LangOptions &LangOpts = PP.getLangOpts();
   std::string PredefineBuffer;
   std::string PredefineBuffer;
   PredefineBuffer.reserve(4080);
   PredefineBuffer.reserve(4080);
   llvm::raw_string_ostream Predefines(PredefineBuffer);
   llvm::raw_string_ostream Predefines(PredefineBuffer);
@@ -644,7 +644,7 @@ void clang::InitializePreprocessor(Preprocessor &PP,
   // Emit line markers for various builtin sections of the file.  We don't do
   // Emit line markers for various builtin sections of the file.  We don't do
   // this in asm preprocessor mode, because "# 4" is not a line marker directive
   // this in asm preprocessor mode, because "# 4" is not a line marker directive
   // in this mode.
   // in this mode.
-  if (!PP.getLangOptions().AsmPreprocessor)
+  if (!PP.getLangOpts().AsmPreprocessor)
     Builder.append("# 1 \"<built-in>\" 3");
     Builder.append("# 1 \"<built-in>\" 3");
 
 
   // Install things like __POWERPC__, __GNUC__, etc into the macro table.
   // Install things like __POWERPC__, __GNUC__, etc into the macro table.
@@ -669,12 +669,12 @@ void clang::InitializePreprocessor(Preprocessor &PP,
   // Even with predefines off, some macros are still predefined.
   // Even with predefines off, some macros are still predefined.
   // These should all be defined in the preprocessor according to the
   // These should all be defined in the preprocessor according to the
   // current language configuration.
   // current language configuration.
-  InitializeStandardPredefinedMacros(PP.getTargetInfo(), PP.getLangOptions(),
+  InitializeStandardPredefinedMacros(PP.getTargetInfo(), PP.getLangOpts(),
                                      FEOpts, Builder);
                                      FEOpts, Builder);
 
 
   // Add on the predefines from the driver.  Wrap in a #line directive to report
   // Add on the predefines from the driver.  Wrap in a #line directive to report
   // that they come from the command line.
   // that they come from the command line.
-  if (!PP.getLangOptions().AsmPreprocessor)
+  if (!PP.getLangOpts().AsmPreprocessor)
     Builder.append("# 1 \"<command line>\" 1");
     Builder.append("# 1 \"<command line>\" 1");
 
 
   // Process #define's and #undef's in the order they are given.
   // Process #define's and #undef's in the order they are given.
@@ -702,7 +702,7 @@ void clang::InitializePreprocessor(Preprocessor &PP,
   }
   }
 
 
   // Exit the command line and go back to <built-in> (2 is LC_LEAVE).
   // Exit the command line and go back to <built-in> (2 is LC_LEAVE).
-  if (!PP.getLangOptions().AsmPreprocessor)
+  if (!PP.getLangOpts().AsmPreprocessor)
     Builder.append("# 1 \"<built-in>\" 2");
     Builder.append("# 1 \"<built-in>\" 2");
 
 
   // Instruct the preprocessor to skip the preamble.
   // Instruct the preprocessor to skip the preamble.
@@ -714,6 +714,6 @@ void clang::InitializePreprocessor(Preprocessor &PP,
   
   
   // Initialize the header search object.
   // Initialize the header search object.
   ApplyHeaderSearchOptions(PP.getHeaderSearchInfo(), HSOpts,
   ApplyHeaderSearchOptions(PP.getHeaderSearchInfo(), HSOpts,
-                           PP.getLangOptions(),
+                           PP.getLangOpts(),
                            PP.getTargetInfo().getTriple());
                            PP.getTargetInfo().getTriple());
 }
 }

+ 1 - 1
lib/Frontend/PrintPreprocessedOutput.cpp

@@ -108,7 +108,7 @@ public:
     Initialized = false;
     Initialized = false;
 
 
     // If we're in microsoft mode, use normal #line instead of line markers.
     // If we're in microsoft mode, use normal #line instead of line markers.
-    UseLineDirective = PP.getLangOptions().MicrosoftExt;
+    UseLineDirective = PP.getLangOpts().MicrosoftExt;
   }
   }
 
 
   void SetEmittedTokensOnThisLine() { EmittedTokensOnThisLine = true; }
   void SetEmittedTokensOnThisLine() { EmittedTokensOnThisLine = true; }

+ 1 - 1
lib/Frontend/VerifyDiagnosticConsumer.cpp

@@ -348,7 +348,7 @@ static void FindExpectedDiags(Preprocessor &PP, ExpectedData &ED, FileID FID) {
   SourceManager& SM = PP.getSourceManager();
   SourceManager& SM = PP.getSourceManager();
   // Create a lexer to lex all the tokens of the main file in raw mode.
   // Create a lexer to lex all the tokens of the main file in raw mode.
   const llvm::MemoryBuffer *FromFile = SM.getBuffer(FID);
   const llvm::MemoryBuffer *FromFile = SM.getBuffer(FID);
-  Lexer RawLex(FID, FromFile, SM, PP.getLangOptions());
+  Lexer RawLex(FID, FromFile, SM, PP.getLangOpts());
 
 
   // Return comments as tokens, this is how we find expected diagnostics.
   // Return comments as tokens, this is how we find expected diagnostics.
   RawLex.SetCommentRetentionState(true);
   RawLex.SetCommentRetentionState(true);

+ 1 - 1
lib/Index/ASTLocation.cpp

@@ -89,7 +89,7 @@ void ASTLocation::print(raw_ostream &OS) const {
 
 
   case N_Stmt:
   case N_Stmt:
     OS << "[Stmt: " << AsStmt()->getStmtClassName() << " ";
     OS << "[Stmt: " << AsStmt()->getStmtClassName() << " ";
-    AsStmt()->printPretty(OS, Ctx, 0, PrintingPolicy(Ctx.getLangOptions()));
+    AsStmt()->printPretty(OS, Ctx, 0, PrintingPolicy(Ctx.getLangOpts()));
     break;
     break;
     
     
   case N_NamedRef:
   case N_NamedRef:

+ 60 - 60
lib/Lex/Lexer.cpp

@@ -117,7 +117,7 @@ void Lexer::InitLexer(const char *BufStart, const char *BufPtr,
 Lexer::Lexer(FileID FID, const llvm::MemoryBuffer *InputFile, Preprocessor &PP)
 Lexer::Lexer(FileID FID, const llvm::MemoryBuffer *InputFile, Preprocessor &PP)
   : PreprocessorLexer(&PP, FID),
   : PreprocessorLexer(&PP, FID),
     FileLoc(PP.getSourceManager().getLocForStartOfFile(FID)),
     FileLoc(PP.getSourceManager().getLocForStartOfFile(FID)),
-    Features(PP.getLangOptions()) {
+    LangOpts(PP.getLangOpts()) {
 
 
   InitLexer(InputFile->getBufferStart(), InputFile->getBufferStart(),
   InitLexer(InputFile->getBufferStart(), InputFile->getBufferStart(),
             InputFile->getBufferEnd());
             InputFile->getBufferEnd());
@@ -129,9 +129,9 @@ Lexer::Lexer(FileID FID, const llvm::MemoryBuffer *InputFile, Preprocessor &PP)
 /// Lexer constructor - Create a new raw lexer object.  This object is only
 /// Lexer constructor - Create a new raw lexer object.  This object is only
 /// suitable for calls to 'LexRawToken'.  This lexer assumes that the text
 /// suitable for calls to 'LexRawToken'.  This lexer assumes that the text
 /// range will outlive it, so it doesn't take ownership of it.
 /// range will outlive it, so it doesn't take ownership of it.
-Lexer::Lexer(SourceLocation fileloc, const LangOptions &features,
+Lexer::Lexer(SourceLocation fileloc, const LangOptions &langOpts,
              const char *BufStart, const char *BufPtr, const char *BufEnd)
              const char *BufStart, const char *BufPtr, const char *BufEnd)
-  : FileLoc(fileloc), Features(features) {
+  : FileLoc(fileloc), LangOpts(langOpts) {
 
 
   InitLexer(BufStart, BufPtr, BufEnd);
   InitLexer(BufStart, BufPtr, BufEnd);
 
 
@@ -143,8 +143,8 @@ Lexer::Lexer(SourceLocation fileloc, const LangOptions &features,
 /// suitable for calls to 'LexRawToken'.  This lexer assumes that the text
 /// suitable for calls to 'LexRawToken'.  This lexer assumes that the text
 /// range will outlive it, so it doesn't take ownership of it.
 /// range will outlive it, so it doesn't take ownership of it.
 Lexer::Lexer(FileID FID, const llvm::MemoryBuffer *FromFile,
 Lexer::Lexer(FileID FID, const llvm::MemoryBuffer *FromFile,
-             const SourceManager &SM, const LangOptions &features)
-  : FileLoc(SM.getLocForStartOfFile(FID)), Features(features) {
+             const SourceManager &SM, const LangOptions &langOpts)
+  : FileLoc(SM.getLocForStartOfFile(FID)), LangOpts(langOpts) {
 
 
   InitLexer(FromFile->getBufferStart(), FromFile->getBufferStart(),
   InitLexer(FromFile->getBufferStart(), FromFile->getBufferStart(),
             FromFile->getBufferEnd());
             FromFile->getBufferEnd());
@@ -287,7 +287,7 @@ StringRef Lexer::getSpelling(SourceLocation loc,
 /// wants to get the true, uncanonicalized, spelling of things like digraphs
 /// wants to get the true, uncanonicalized, spelling of things like digraphs
 /// UCNs, etc.
 /// UCNs, etc.
 std::string Lexer::getSpelling(const Token &Tok, const SourceManager &SourceMgr,
 std::string Lexer::getSpelling(const Token &Tok, const SourceManager &SourceMgr,
-                               const LangOptions &Features, bool *Invalid) {
+                               const LangOptions &LangOpts, bool *Invalid) {
   assert((int)Tok.getLength() >= 0 && "Token character range is bogus!");
   assert((int)Tok.getLength() >= 0 && "Token character range is bogus!");
   
   
   // If this token contains nothing interesting, return it directly.
   // If this token contains nothing interesting, return it directly.
@@ -309,7 +309,7 @@ std::string Lexer::getSpelling(const Token &Tok, const SourceManager &SourceMgr,
   for (const char *Ptr = TokStart, *End = TokStart+Tok.getLength();
   for (const char *Ptr = TokStart, *End = TokStart+Tok.getLength();
        Ptr != End; ) {
        Ptr != End; ) {
     unsigned CharSize;
     unsigned CharSize;
-    Result.push_back(Lexer::getCharAndSizeNoWarn(Ptr, CharSize, Features));
+    Result.push_back(Lexer::getCharAndSizeNoWarn(Ptr, CharSize, LangOpts));
     Ptr += CharSize;
     Ptr += CharSize;
   }
   }
   assert(Result.size() != unsigned(Tok.getLength()) &&
   assert(Result.size() != unsigned(Tok.getLength()) &&
@@ -329,7 +329,7 @@ std::string Lexer::getSpelling(const Token &Tok, const SourceManager &SourceMgr,
 /// if an internal buffer is returned.
 /// if an internal buffer is returned.
 unsigned Lexer::getSpelling(const Token &Tok, const char *&Buffer, 
 unsigned Lexer::getSpelling(const Token &Tok, const char *&Buffer, 
                             const SourceManager &SourceMgr,
                             const SourceManager &SourceMgr,
-                            const LangOptions &Features, bool *Invalid) {
+                            const LangOptions &LangOpts, bool *Invalid) {
   assert((int)Tok.getLength() >= 0 && "Token character range is bogus!");
   assert((int)Tok.getLength() >= 0 && "Token character range is bogus!");
 
 
   const char *TokStart = 0;
   const char *TokStart = 0;
@@ -369,7 +369,7 @@ unsigned Lexer::getSpelling(const Token &Tok, const char *&Buffer,
   for (const char *Ptr = TokStart, *End = TokStart+Tok.getLength();
   for (const char *Ptr = TokStart, *End = TokStart+Tok.getLength();
        Ptr != End; ) {
        Ptr != End; ) {
     unsigned CharSize;
     unsigned CharSize;
-    *OutBuf++ = Lexer::getCharAndSizeNoWarn(Ptr, CharSize, Features);
+    *OutBuf++ = Lexer::getCharAndSizeNoWarn(Ptr, CharSize, LangOpts);
     Ptr += CharSize;
     Ptr += CharSize;
   }
   }
   assert(unsigned(OutBuf-Buffer) != Tok.getLength() &&
   assert(unsigned(OutBuf-Buffer) != Tok.getLength() &&
@@ -508,13 +508,13 @@ namespace {
 
 
 std::pair<unsigned, bool>
 std::pair<unsigned, bool>
 Lexer::ComputePreamble(const llvm::MemoryBuffer *Buffer,
 Lexer::ComputePreamble(const llvm::MemoryBuffer *Buffer,
-                       const LangOptions &Features, unsigned MaxLines) {
+                       const LangOptions &LangOpts, unsigned MaxLines) {
   // Create a lexer starting at the beginning of the file. Note that we use a
   // Create a lexer starting at the beginning of the file. Note that we use a
   // "fake" file source location at offset 1 so that the lexer will track our
   // "fake" file source location at offset 1 so that the lexer will track our
   // position within the file.
   // position within the file.
   const unsigned StartOffset = 1;
   const unsigned StartOffset = 1;
   SourceLocation StartLoc = SourceLocation::getFromRawEncoding(StartOffset);
   SourceLocation StartLoc = SourceLocation::getFromRawEncoding(StartOffset);
-  Lexer TheLexer(StartLoc, Features, Buffer->getBufferStart(),
+  Lexer TheLexer(StartLoc, LangOpts, Buffer->getBufferStart(),
                  Buffer->getBufferStart(), Buffer->getBufferEnd());
                  Buffer->getBufferStart(), Buffer->getBufferEnd());
   
   
   bool InPreprocessorDirective = false;
   bool InPreprocessorDirective = false;
@@ -658,7 +658,7 @@ Lexer::ComputePreamble(const llvm::MemoryBuffer *Buffer,
 SourceLocation Lexer::AdvanceToTokenCharacter(SourceLocation TokStart,
 SourceLocation Lexer::AdvanceToTokenCharacter(SourceLocation TokStart,
                                               unsigned CharNo,
                                               unsigned CharNo,
                                               const SourceManager &SM,
                                               const SourceManager &SM,
-                                              const LangOptions &Features) {
+                                              const LangOptions &LangOpts) {
   // Figure out how many physical characters away the specified expansion
   // Figure out how many physical characters away the specified expansion
   // character is.  This needs to take into consideration newlines and
   // character is.  This needs to take into consideration newlines and
   // trigraphs.
   // trigraphs.
@@ -684,7 +684,7 @@ SourceLocation Lexer::AdvanceToTokenCharacter(SourceLocation TokStart,
   // lexer to parse it correctly.
   // lexer to parse it correctly.
   for (; CharNo; --CharNo) {
   for (; CharNo; --CharNo) {
     unsigned Size;
     unsigned Size;
-    Lexer::getCharAndSizeNoWarn(TokPtr, Size, Features);
+    Lexer::getCharAndSizeNoWarn(TokPtr, Size, LangOpts);
     TokPtr += Size;
     TokPtr += Size;
     PhysOffset += Size;
     PhysOffset += Size;
   }
   }
@@ -716,16 +716,16 @@ SourceLocation Lexer::AdvanceToTokenCharacter(SourceLocation TokStart,
 /// a source location pointing to the last character in the token, etc.
 /// a source location pointing to the last character in the token, etc.
 SourceLocation Lexer::getLocForEndOfToken(SourceLocation Loc, unsigned Offset,
 SourceLocation Lexer::getLocForEndOfToken(SourceLocation Loc, unsigned Offset,
                                           const SourceManager &SM,
                                           const SourceManager &SM,
-                                          const LangOptions &Features) {
+                                          const LangOptions &LangOpts) {
   if (Loc.isInvalid())
   if (Loc.isInvalid())
     return SourceLocation();
     return SourceLocation();
 
 
   if (Loc.isMacroID()) {
   if (Loc.isMacroID()) {
-    if (Offset > 0 || !isAtEndOfMacroExpansion(Loc, SM, Features, &Loc))
+    if (Offset > 0 || !isAtEndOfMacroExpansion(Loc, SM, LangOpts, &Loc))
       return SourceLocation(); // Points inside the macro expansion.
       return SourceLocation(); // Points inside the macro expansion.
   }
   }
 
 
-  unsigned Len = Lexer::MeasureTokenLength(Loc, SM, Features);
+  unsigned Len = Lexer::MeasureTokenLength(Loc, SM, LangOpts);
   if (Len > Offset)
   if (Len > Offset)
     Len = Len - Offset;
     Len = Len - Offset;
   else
   else
@@ -1212,7 +1212,7 @@ static char DecodeTrigraphChar(const char *CP, Lexer *L) {
   char Res = GetTrigraphCharForLetter(*CP);
   char Res = GetTrigraphCharForLetter(*CP);
   if (!Res || !L) return Res;
   if (!Res || !L) return Res;
 
 
-  if (!L->getFeatures().Trigraphs) {
+  if (!L->getLangOpts().Trigraphs) {
     if (!L->isLexingRawMode())
     if (!L->isLexingRawMode())
       L->Diag(CP-2, diag::trigraph_ignored);
       L->Diag(CP-2, diag::trigraph_ignored);
     return 0;
     return 0;
@@ -1405,7 +1405,7 @@ Slash:
 /// NOTE: When this method is updated, getCharAndSizeSlow (above) should
 /// NOTE: When this method is updated, getCharAndSizeSlow (above) should
 /// be updated to match.
 /// be updated to match.
 char Lexer::getCharAndSizeSlowNoWarn(const char *Ptr, unsigned &Size,
 char Lexer::getCharAndSizeSlowNoWarn(const char *Ptr, unsigned &Size,
-                                     const LangOptions &Features) {
+                                     const LangOptions &LangOpts) {
   // If we have a slash, look for an escaped newline.
   // If we have a slash, look for an escaped newline.
   if (Ptr[0] == '\\') {
   if (Ptr[0] == '\\') {
     ++Size;
     ++Size;
@@ -1427,7 +1427,7 @@ Slash:
         return ' ';
         return ' ';
 
 
       // Use slow version to accumulate a correct size field.
       // Use slow version to accumulate a correct size field.
-      return getCharAndSizeSlowNoWarn(Ptr, Size, Features);
+      return getCharAndSizeSlowNoWarn(Ptr, Size, LangOpts);
     }
     }
 
 
     // Otherwise, this is not an escaped newline, just return the slash.
     // Otherwise, this is not an escaped newline, just return the slash.
@@ -1435,7 +1435,7 @@ Slash:
   }
   }
 
 
   // If this is a trigraph, process it.
   // If this is a trigraph, process it.
-  if (Features.Trigraphs && Ptr[0] == '?' && Ptr[1] == '?') {
+  if (LangOpts.Trigraphs && Ptr[0] == '?' && Ptr[1] == '?') {
     // If this is actually a legal trigraph (not something like "??x"), return
     // If this is actually a legal trigraph (not something like "??x"), return
     // it.
     // it.
     if (char C = GetTrigraphCharForLetter(Ptr[2])) {
     if (char C = GetTrigraphCharForLetter(Ptr[2])) {
@@ -1478,7 +1478,7 @@ void Lexer::LexIdentifier(Token &Result, const char *CurPtr) {
   //
   //
   // TODO: Could merge these checks into a CharInfo flag to make the comparison
   // TODO: Could merge these checks into a CharInfo flag to make the comparison
   // cheaper
   // cheaper
-  if (C != '\\' && C != '?' && (C != '$' || !Features.DollarIdents)) {
+  if (C != '\\' && C != '?' && (C != '$' || !LangOpts.DollarIdents)) {
 FinishIdentifier:
 FinishIdentifier:
     const char *IdStart = BufferPtr;
     const char *IdStart = BufferPtr;
     FormTokenWithChars(Result, CurPtr, tok::raw_identifier);
     FormTokenWithChars(Result, CurPtr, tok::raw_identifier);
@@ -1507,7 +1507,7 @@ FinishIdentifier:
   while (1) {
   while (1) {
     if (C == '$') {
     if (C == '$') {
       // If we hit a $ and they are not supported in identifiers, we are done.
       // If we hit a $ and they are not supported in identifiers, we are done.
-      if (!Features.DollarIdents) goto FinishIdentifier;
+      if (!LangOpts.DollarIdents) goto FinishIdentifier;
 
 
       // Otherwise, emit a diagnostic and continue.
       // Otherwise, emit a diagnostic and continue.
       if (!isLexingRawMode())
       if (!isLexingRawMode())
@@ -1533,12 +1533,12 @@ FinishIdentifier:
 
 
 /// isHexaLiteral - Return true if Start points to a hex constant.
 /// isHexaLiteral - Return true if Start points to a hex constant.
 /// in microsoft mode (where this is supposed to be several different tokens).
 /// in microsoft mode (where this is supposed to be several different tokens).
-static bool isHexaLiteral(const char *Start, const LangOptions &Features) {
+static bool isHexaLiteral(const char *Start, const LangOptions &LangOpts) {
   unsigned Size;
   unsigned Size;
-  char C1 = Lexer::getCharAndSizeNoWarn(Start, Size, Features);
+  char C1 = Lexer::getCharAndSizeNoWarn(Start, Size, LangOpts);
   if (C1 != '0')
   if (C1 != '0')
     return false;
     return false;
-  char C2 = Lexer::getCharAndSizeNoWarn(Start + Size, Size, Features);
+  char C2 = Lexer::getCharAndSizeNoWarn(Start + Size, Size, LangOpts);
   return (C2 == 'x' || C2 == 'X');
   return (C2 == 'x' || C2 == 'X');
 }
 }
 
 
@@ -1559,7 +1559,7 @@ void Lexer::LexNumericConstant(Token &Result, const char *CurPtr) {
   if ((C == '-' || C == '+') && (PrevCh == 'E' || PrevCh == 'e')) {
   if ((C == '-' || C == '+') && (PrevCh == 'E' || PrevCh == 'e')) {
     // If we are in Microsoft mode, don't continue if the constant is hex.
     // If we are in Microsoft mode, don't continue if the constant is hex.
     // For example, MSVC will accept the following as 3 tokens: 0x1234567e+1
     // For example, MSVC will accept the following as 3 tokens: 0x1234567e+1
-    if (!Features.MicrosoftExt || !isHexaLiteral(BufferPtr, Features))
+    if (!LangOpts.MicrosoftExt || !isHexaLiteral(BufferPtr, LangOpts))
       return LexNumericConstant(Result, ConsumeChar(CurPtr, Size, Result));
       return LexNumericConstant(Result, ConsumeChar(CurPtr, Size, Result));
   }
   }
 
 
@@ -1576,13 +1576,13 @@ void Lexer::LexNumericConstant(Token &Result, const char *CurPtr) {
 /// LexUDSuffix - Lex the ud-suffix production for user-defined literal suffixes
 /// LexUDSuffix - Lex the ud-suffix production for user-defined literal suffixes
 /// in C++11, or warn on a ud-suffix in C++98.
 /// in C++11, or warn on a ud-suffix in C++98.
 const char *Lexer::LexUDSuffix(Token &Result, const char *CurPtr) {
 const char *Lexer::LexUDSuffix(Token &Result, const char *CurPtr) {
-  assert(getFeatures().CPlusPlus);
+  assert(getLangOpts().CPlusPlus);
 
 
   // Maximally munch an identifier. FIXME: UCNs.
   // Maximally munch an identifier. FIXME: UCNs.
   unsigned Size;
   unsigned Size;
   char C = getCharAndSize(CurPtr, Size);
   char C = getCharAndSize(CurPtr, Size);
   if (isIdentifierHead(C)) {
   if (isIdentifierHead(C)) {
-    if (!getFeatures().CPlusPlus0x) {
+    if (!getLangOpts().CPlusPlus0x) {
       if (!isLexingRawMode())
       if (!isLexingRawMode())
         Diag(CurPtr,
         Diag(CurPtr,
              C == '_' ? diag::warn_cxx11_compat_user_defined_literal
              C == '_' ? diag::warn_cxx11_compat_user_defined_literal
@@ -1632,7 +1632,7 @@ void Lexer::LexStringLiteral(Token &Result, const char *CurPtr,
     
     
     if (C == '\n' || C == '\r' ||             // Newline.
     if (C == '\n' || C == '\r' ||             // Newline.
         (C == 0 && CurPtr-1 == BufferEnd)) {  // End of file.
         (C == 0 && CurPtr-1 == BufferEnd)) {  // End of file.
-      if (!isLexingRawMode() && !Features.AsmPreprocessor)
+      if (!isLexingRawMode() && !LangOpts.AsmPreprocessor)
         Diag(BufferPtr, diag::warn_unterminated_string);
         Diag(BufferPtr, diag::warn_unterminated_string);
       FormTokenWithChars(Result, CurPtr-1, tok::unknown);
       FormTokenWithChars(Result, CurPtr-1, tok::unknown);
       return;
       return;
@@ -1651,7 +1651,7 @@ void Lexer::LexStringLiteral(Token &Result, const char *CurPtr,
   }
   }
 
 
   // If we are in C++11, lex the optional ud-suffix.
   // If we are in C++11, lex the optional ud-suffix.
-  if (getFeatures().CPlusPlus)
+  if (getLangOpts().CPlusPlus)
     CurPtr = LexUDSuffix(Result, CurPtr);
     CurPtr = LexUDSuffix(Result, CurPtr);
 
 
   // If a nul character existed in the string, warn about it.
   // If a nul character existed in the string, warn about it.
@@ -1734,7 +1734,7 @@ void Lexer::LexRawStringLiteral(Token &Result, const char *CurPtr,
   }
   }
 
 
   // If we are in C++11, lex the optional ud-suffix.
   // If we are in C++11, lex the optional ud-suffix.
-  if (getFeatures().CPlusPlus)
+  if (getLangOpts().CPlusPlus)
     CurPtr = LexUDSuffix(Result, CurPtr);
     CurPtr = LexUDSuffix(Result, CurPtr);
 
 
   // Update the location of token as well as BufferPtr.
   // Update the location of token as well as BufferPtr.
@@ -1790,7 +1790,7 @@ void Lexer::LexCharConstant(Token &Result, const char *CurPtr,
 
 
   char C = getAndAdvanceChar(CurPtr, Result);
   char C = getAndAdvanceChar(CurPtr, Result);
   if (C == '\'') {
   if (C == '\'') {
-    if (!isLexingRawMode() && !Features.AsmPreprocessor)
+    if (!isLexingRawMode() && !LangOpts.AsmPreprocessor)
       Diag(BufferPtr, diag::err_empty_character);
       Diag(BufferPtr, diag::err_empty_character);
     FormTokenWithChars(Result, CurPtr, tok::unknown);
     FormTokenWithChars(Result, CurPtr, tok::unknown);
     return;
     return;
@@ -1804,7 +1804,7 @@ void Lexer::LexCharConstant(Token &Result, const char *CurPtr,
       C = getAndAdvanceChar(CurPtr, Result);
       C = getAndAdvanceChar(CurPtr, Result);
     } else if (C == '\n' || C == '\r' ||             // Newline.
     } else if (C == '\n' || C == '\r' ||             // Newline.
                (C == 0 && CurPtr-1 == BufferEnd)) {  // End of file.
                (C == 0 && CurPtr-1 == BufferEnd)) {  // End of file.
-      if (!isLexingRawMode() && !Features.AsmPreprocessor)
+      if (!isLexingRawMode() && !LangOpts.AsmPreprocessor)
         Diag(BufferPtr, diag::warn_unterminated_char);
         Diag(BufferPtr, diag::warn_unterminated_char);
       FormTokenWithChars(Result, CurPtr-1, tok::unknown);
       FormTokenWithChars(Result, CurPtr-1, tok::unknown);
       return;
       return;
@@ -1821,7 +1821,7 @@ void Lexer::LexCharConstant(Token &Result, const char *CurPtr,
   }
   }
 
 
   // If we are in C++11, lex the optional ud-suffix.
   // If we are in C++11, lex the optional ud-suffix.
-  if (getFeatures().CPlusPlus)
+  if (getLangOpts().CPlusPlus)
     CurPtr = LexUDSuffix(Result, CurPtr);
     CurPtr = LexUDSuffix(Result, CurPtr);
 
 
   // If a nul character existed in the character, warn about it.
   // If a nul character existed in the character, warn about it.
@@ -1889,12 +1889,12 @@ bool Lexer::SkipWhitespace(Token &Result, const char *CurPtr) {
 bool Lexer::SkipBCPLComment(Token &Result, const char *CurPtr) {
 bool Lexer::SkipBCPLComment(Token &Result, const char *CurPtr) {
   // If BCPL comments aren't explicitly enabled for this language, emit an
   // If BCPL comments aren't explicitly enabled for this language, emit an
   // extension warning.
   // extension warning.
-  if (!Features.BCPLComment && !isLexingRawMode()) {
+  if (!LangOpts.BCPLComment && !isLexingRawMode()) {
     Diag(BufferPtr, diag::ext_bcpl_comment);
     Diag(BufferPtr, diag::ext_bcpl_comment);
 
 
     // Mark them enabled so we only emit one warning for this translation
     // Mark them enabled so we only emit one warning for this translation
     // unit.
     // unit.
-    Features.BCPLComment = true;
+    LangOpts.BCPLComment = true;
   }
   }
 
 
   // Scan over the body of the comment.  The common case, when scanning, is that
   // Scan over the body of the comment.  The common case, when scanning, is that
@@ -2081,7 +2081,7 @@ static bool isEndOfBlockCommentWithEscapedNewLine(const char *CurPtr,
 
 
     // If no trigraphs are enabled, warn that we ignored this trigraph and
     // If no trigraphs are enabled, warn that we ignored this trigraph and
     // ignore this * character.
     // ignore this * character.
-    if (!L->getFeatures().Trigraphs) {
+    if (!L->getLangOpts().Trigraphs) {
       if (!L->isLexingRawMode())
       if (!L->isLexingRawMode())
         L->Diag(CurPtr, diag::trigraph_ignored_block_comment);
         L->Diag(CurPtr, diag::trigraph_ignored_block_comment);
       return false;
       return false;
@@ -2600,7 +2600,7 @@ LexNextToken:
       
       
   case 26:  // DOS & CP/M EOF: "^Z".
   case 26:  // DOS & CP/M EOF: "^Z".
     // If we're in Microsoft extensions mode, treat this as end of file.
     // If we're in Microsoft extensions mode, treat this as end of file.
-    if (Features.MicrosoftExt) {
+    if (LangOpts.MicrosoftExt) {
       // Read the PP instance variable into an automatic variable, because
       // Read the PP instance variable into an automatic variable, because
       // LexEndOfFile will often delete 'this'.
       // LexEndOfFile will often delete 'this'.
       Preprocessor *PPCache = PP;
       Preprocessor *PPCache = PP;
@@ -2653,7 +2653,7 @@ LexNextToken:
     // If the next token is obviously a // or /* */ comment, skip it efficiently
     // If the next token is obviously a // or /* */ comment, skip it efficiently
     // too (without going through the big switch stmt).
     // too (without going through the big switch stmt).
     if (CurPtr[0] == '/' && CurPtr[1] == '/' && !inKeepCommentMode() &&
     if (CurPtr[0] == '/' && CurPtr[1] == '/' && !inKeepCommentMode() &&
-        Features.BCPLComment && !Features.TraditionalCPP) {
+        LangOpts.BCPLComment && !LangOpts.TraditionalCPP) {
       if (SkipBCPLComment(Result, CurPtr+2))
       if (SkipBCPLComment(Result, CurPtr+2))
         return; // There is a token to return.
         return; // There is a token to return.
       goto SkipIgnoredUnits;
       goto SkipIgnoredUnits;
@@ -2678,7 +2678,7 @@ LexNextToken:
     // Notify MIOpt that we read a non-whitespace/non-comment token.
     // Notify MIOpt that we read a non-whitespace/non-comment token.
     MIOpt.ReadToken();
     MIOpt.ReadToken();
 
 
-    if (Features.CPlusPlus0x) {
+    if (LangOpts.CPlusPlus0x) {
       Char = getCharAndSize(CurPtr, SizeTmp);
       Char = getCharAndSize(CurPtr, SizeTmp);
 
 
       // UTF-16 string literal
       // UTF-16 string literal
@@ -2730,7 +2730,7 @@ LexNextToken:
     // Notify MIOpt that we read a non-whitespace/non-comment token.
     // Notify MIOpt that we read a non-whitespace/non-comment token.
     MIOpt.ReadToken();
     MIOpt.ReadToken();
 
 
-    if (Features.CPlusPlus0x) {
+    if (LangOpts.CPlusPlus0x) {
       Char = getCharAndSize(CurPtr, SizeTmp);
       Char = getCharAndSize(CurPtr, SizeTmp);
 
 
       // UTF-32 string literal
       // UTF-32 string literal
@@ -2758,7 +2758,7 @@ LexNextToken:
     // Notify MIOpt that we read a non-whitespace/non-comment token.
     // Notify MIOpt that we read a non-whitespace/non-comment token.
     MIOpt.ReadToken();
     MIOpt.ReadToken();
 
 
-    if (Features.CPlusPlus0x) {
+    if (LangOpts.CPlusPlus0x) {
       Char = getCharAndSize(CurPtr, SizeTmp);
       Char = getCharAndSize(CurPtr, SizeTmp);
 
 
       if (Char == '"')
       if (Char == '"')
@@ -2781,7 +2781,7 @@ LexNextToken:
                               tok::wide_string_literal);
                               tok::wide_string_literal);
 
 
     // Wide raw string literal.
     // Wide raw string literal.
-    if (Features.CPlusPlus0x && Char == 'R' &&
+    if (LangOpts.CPlusPlus0x && Char == 'R' &&
         getCharAndSize(CurPtr + SizeTmp, SizeTmp2) == '"')
         getCharAndSize(CurPtr + SizeTmp, SizeTmp2) == '"')
       return LexRawStringLiteral(Result,
       return LexRawStringLiteral(Result,
                                ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
                                ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
@@ -2809,7 +2809,7 @@ LexNextToken:
     return LexIdentifier(Result, CurPtr);
     return LexIdentifier(Result, CurPtr);
 
 
   case '$':   // $ in identifiers.
   case '$':   // $ in identifiers.
-    if (Features.DollarIdents) {
+    if (LangOpts.DollarIdents) {
       if (!isLexingRawMode())
       if (!isLexingRawMode())
         Diag(CurPtr-1, diag::ext_dollar_in_identifier);
         Diag(CurPtr-1, diag::ext_dollar_in_identifier);
       // Notify MIOpt that we read a non-whitespace/non-comment token.
       // Notify MIOpt that we read a non-whitespace/non-comment token.
@@ -2861,7 +2861,7 @@ LexNextToken:
       MIOpt.ReadToken();
       MIOpt.ReadToken();
 
 
       return LexNumericConstant(Result, ConsumeChar(CurPtr, SizeTmp, Result));
       return LexNumericConstant(Result, ConsumeChar(CurPtr, SizeTmp, Result));
-    } else if (Features.CPlusPlus && Char == '*') {
+    } else if (LangOpts.CPlusPlus && Char == '*') {
       Kind = tok::periodstar;
       Kind = tok::periodstar;
       CurPtr += SizeTmp;
       CurPtr += SizeTmp;
     } else if (Char == '.' &&
     } else if (Char == '.' &&
@@ -2910,7 +2910,7 @@ LexNextToken:
     if (Char == '-') {      // --
     if (Char == '-') {      // --
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
       Kind = tok::minusminus;
       Kind = tok::minusminus;
-    } else if (Char == '>' && Features.CPlusPlus &&
+    } else if (Char == '>' && LangOpts.CPlusPlus &&
                getCharAndSize(CurPtr+SizeTmp, SizeTmp2) == '*') {  // C++ ->*
                getCharAndSize(CurPtr+SizeTmp, SizeTmp2) == '*') {  // C++ ->*
       CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
       CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
                            SizeTmp2, Result);
                            SizeTmp2, Result);
@@ -2948,9 +2948,9 @@ LexNextToken:
       // "foo".  Check to see if the character after the second slash is a '*'.
       // "foo".  Check to see if the character after the second slash is a '*'.
       // If so, we will lex that as a "/" instead of the start of a comment.
       // If so, we will lex that as a "/" instead of the start of a comment.
       // However, we never do this in -traditional-cpp mode.
       // However, we never do this in -traditional-cpp mode.
-      if ((Features.BCPLComment ||
+      if ((LangOpts.BCPLComment ||
            getCharAndSize(CurPtr+SizeTmp, SizeTmp2) != '*') &&
            getCharAndSize(CurPtr+SizeTmp, SizeTmp2) != '*') &&
-          !Features.TraditionalCPP) {
+          !LangOpts.TraditionalCPP) {
         if (SkipBCPLComment(Result, ConsumeChar(CurPtr, SizeTmp, Result)))
         if (SkipBCPLComment(Result, ConsumeChar(CurPtr, SizeTmp, Result)))
           return; // There is a token to return.
           return; // There is a token to return.
 
 
@@ -2979,17 +2979,17 @@ LexNextToken:
     if (Char == '=') {
     if (Char == '=') {
       Kind = tok::percentequal;
       Kind = tok::percentequal;
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
-    } else if (Features.Digraphs && Char == '>') {
+    } else if (LangOpts.Digraphs && Char == '>') {
       Kind = tok::r_brace;                             // '%>' -> '}'
       Kind = tok::r_brace;                             // '%>' -> '}'
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
-    } else if (Features.Digraphs && Char == ':') {
+    } else if (LangOpts.Digraphs && Char == ':') {
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
       Char = getCharAndSize(CurPtr, SizeTmp);
       Char = getCharAndSize(CurPtr, SizeTmp);
       if (Char == '%' && getCharAndSize(CurPtr+SizeTmp, SizeTmp2) == ':') {
       if (Char == '%' && getCharAndSize(CurPtr+SizeTmp, SizeTmp2) == ':') {
         Kind = tok::hashhash;                          // '%:%:' -> '##'
         Kind = tok::hashhash;                          // '%:%:' -> '##'
         CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
         CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
                              SizeTmp2, Result);
                              SizeTmp2, Result);
-      } else if (Char == '@' && Features.MicrosoftExt) {// %:@ -> #@ -> Charize
+      } else if (Char == '@' && LangOpts.MicrosoftExt) {// %:@ -> #@ -> Charize
         CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
         CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
         if (!isLexingRawMode())
         if (!isLexingRawMode())
           Diag(BufferPtr, diag::ext_charize_microsoft);
           Diag(BufferPtr, diag::ext_charize_microsoft);
@@ -3044,7 +3044,7 @@ LexNextToken:
         // If this is '<<<<' and we're in a Perforce-style conflict marker,
         // If this is '<<<<' and we're in a Perforce-style conflict marker,
         // ignore it.
         // ignore it.
         goto LexNextToken;
         goto LexNextToken;
-      } else if (Features.CUDA && After == '<') {
+      } else if (LangOpts.CUDA && After == '<') {
         Kind = tok::lesslessless;
         Kind = tok::lesslessless;
         CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
         CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
                              SizeTmp2, Result);
                              SizeTmp2, Result);
@@ -3055,8 +3055,8 @@ LexNextToken:
     } else if (Char == '=') {
     } else if (Char == '=') {
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
       Kind = tok::lessequal;
       Kind = tok::lessequal;
-    } else if (Features.Digraphs && Char == ':') {     // '<:' -> '['
-      if (Features.CPlusPlus0x &&
+    } else if (LangOpts.Digraphs && Char == ':') {     // '<:' -> '['
+      if (LangOpts.CPlusPlus0x &&
           getCharAndSize(CurPtr + SizeTmp, SizeTmp2) == ':') {
           getCharAndSize(CurPtr + SizeTmp, SizeTmp2) == ':') {
         // C++0x [lex.pptoken]p3:
         // C++0x [lex.pptoken]p3:
         //  Otherwise, if the next three characters are <:: and the subsequent
         //  Otherwise, if the next three characters are <:: and the subsequent
@@ -3075,7 +3075,7 @@ LexNextToken:
 
 
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
       Kind = tok::l_square;
       Kind = tok::l_square;
-    } else if (Features.Digraphs && Char == '%') {     // '<%' -> '{'
+    } else if (LangOpts.Digraphs && Char == '%') {     // '<%' -> '{'
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
       Kind = tok::l_brace;
       Kind = tok::l_brace;
     } else {
     } else {
@@ -3100,7 +3100,7 @@ LexNextToken:
       } else if (After == '>' && HandleEndOfConflictMarker(CurPtr-1)) {
       } else if (After == '>' && HandleEndOfConflictMarker(CurPtr-1)) {
         // If this is '>>>>>>>' and we're in a conflict marker, ignore it.
         // If this is '>>>>>>>' and we're in a conflict marker, ignore it.
         goto LexNextToken;
         goto LexNextToken;
-      } else if (Features.CUDA && After == '>') {
+      } else if (LangOpts.CUDA && After == '>') {
         Kind = tok::greatergreatergreater;
         Kind = tok::greatergreatergreater;
         CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
         CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),
                              SizeTmp2, Result);
                              SizeTmp2, Result);
@@ -3139,10 +3139,10 @@ LexNextToken:
     break;
     break;
   case ':':
   case ':':
     Char = getCharAndSize(CurPtr, SizeTmp);
     Char = getCharAndSize(CurPtr, SizeTmp);
-    if (Features.Digraphs && Char == '>') {
+    if (LangOpts.Digraphs && Char == '>') {
       Kind = tok::r_square; // ':>' -> ']'
       Kind = tok::r_square; // ':>' -> ']'
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
-    } else if (Features.CPlusPlus && Char == ':') {
+    } else if (LangOpts.CPlusPlus && Char == ':') {
       Kind = tok::coloncolon;
       Kind = tok::coloncolon;
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
     } else {
     } else {
@@ -3173,7 +3173,7 @@ LexNextToken:
     if (Char == '#') {
     if (Char == '#') {
       Kind = tok::hashhash;
       Kind = tok::hashhash;
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
       CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);
-    } else if (Char == '@' && Features.MicrosoftExt) {  // #@ -> Charize
+    } else if (Char == '@' && LangOpts.MicrosoftExt) {  // #@ -> Charize
       Kind = tok::hashat;
       Kind = tok::hashat;
       if (!isLexingRawMode())
       if (!isLexingRawMode())
         Diag(BufferPtr, diag::ext_charize_microsoft);
         Diag(BufferPtr, diag::ext_charize_microsoft);
@@ -3209,7 +3209,7 @@ LexNextToken:
 
 
   case '@':
   case '@':
     // Objective C support.
     // Objective C support.
-    if (CurPtr[-1] == '@' && Features.ObjC1)
+    if (CurPtr[-1] == '@' && LangOpts.ObjC1)
       Kind = tok::at;
       Kind = tok::at;
     else
     else
       Kind = tok::unknown;
       Kind = tok::unknown;

+ 6 - 6
lib/Lex/LiteralSupport.cpp

@@ -482,7 +482,7 @@ NumericLiteralParser(const char *begin, const char *end,
       continue;  // Success.
       continue;  // Success.
     case 'i':
     case 'i':
     case 'I':
     case 'I':
-      if (PP.getLangOptions().MicrosoftExt) {
+      if (PP.getLangOpts().MicrosoftExt) {
         if (isFPConstant || isLong || isLongLong) break;
         if (isFPConstant || isLong || isLongLong) break;
 
 
         // Allow i8, i16, i32, i64, and i128.
         // Allow i8, i16, i32, i64, and i128.
@@ -542,7 +542,7 @@ NumericLiteralParser(const char *begin, const char *end,
   }
   }
 
 
   if (s != ThisTokEnd) {
   if (s != ThisTokEnd) {
-    if (PP.getLangOptions().CPlusPlus0x && s == SuffixBegin && *s == '_') {
+    if (PP.getLangOpts().CPlusPlus0x && s == SuffixBegin && *s == '_') {
       // We have a ud-suffix! By C++11 [lex.ext]p10, ud-suffixes not starting
       // We have a ud-suffix! By C++11 [lex.ext]p10, ud-suffixes not starting
       // with an '_' are ill-formed.
       // with an '_' are ill-formed.
       saw_ud_suffix = true;
       saw_ud_suffix = true;
@@ -608,7 +608,7 @@ void NumericLiteralParser::ParseNumberStartingWithZero(SourceLocation TokLoc) {
       }
       }
       s = first_non_digit;
       s = first_non_digit;
 
 
-      if (!PP.getLangOptions().HexFloats)
+      if (!PP.getLangOpts().HexFloats)
         PP.Diag(TokLoc, diag::ext_hexconstant_invalid);
         PP.Diag(TokLoc, diag::ext_hexconstant_invalid);
     } else if (saw_period) {
     } else if (saw_period) {
       PP.Diag(PP.AdvanceToTokenCharacter(TokLoc, s-ThisTokBegin),
       PP.Diag(PP.AdvanceToTokenCharacter(TokLoc, s-ThisTokBegin),
@@ -902,7 +902,7 @@ CharLiteralParser::CharLiteralParser(const char *begin, const char *end,
       unsigned short UcnLen = 0;
       unsigned short UcnLen = 0;
       if (!ProcessUCNEscape(TokBegin, begin, end, *buffer_begin, UcnLen,
       if (!ProcessUCNEscape(TokBegin, begin, end, *buffer_begin, UcnLen,
                             FullSourceLoc(Loc, PP.getSourceManager()),
                             FullSourceLoc(Loc, PP.getSourceManager()),
-                            &PP.getDiagnostics(), PP.getLangOptions(),
+                            &PP.getDiagnostics(), PP.getLangOpts(),
                             true))
                             true))
       {
       {
         HadError = true;
         HadError = true;
@@ -967,7 +967,7 @@ CharLiteralParser::CharLiteralParser(const char *begin, const char *end,
   // character constants are not sign extended in the this implementation:
   // character constants are not sign extended in the this implementation:
   // '\xFF\xFF' = 65536 and '\x0\xFF' = 255, which matches GCC.
   // '\xFF\xFF' = 65536 and '\x0\xFF' = 255, which matches GCC.
   if (isAscii() && NumCharsSoFar == 1 && (Value & 128) &&
   if (isAscii() && NumCharsSoFar == 1 && (Value & 128) &&
-      PP.getLangOptions().CharIsSigned)
+      PP.getLangOpts().CharIsSigned)
     Value = (signed char)Value;
     Value = (signed char)Value;
 }
 }
 
 
@@ -1027,7 +1027,7 @@ CharLiteralParser::CharLiteralParser(const char *begin, const char *end,
 StringLiteralParser::
 StringLiteralParser::
 StringLiteralParser(const Token *StringToks, unsigned NumStringToks,
 StringLiteralParser(const Token *StringToks, unsigned NumStringToks,
                     Preprocessor &PP, bool Complain)
                     Preprocessor &PP, bool Complain)
-  : SM(PP.getSourceManager()), Features(PP.getLangOptions()),
+  : SM(PP.getSourceManager()), Features(PP.getLangOpts()),
     Target(PP.getTargetInfo()), Diags(Complain ? &PP.getDiagnostics() : 0),
     Target(PP.getTargetInfo()), Diags(Complain ? &PP.getDiagnostics() : 0),
     MaxTokenLength(0), SizeBound(0), CharByteWidth(0), Kind(tok::unknown),
     MaxTokenLength(0), SizeBound(0), CharByteWidth(0), Kind(tok::unknown),
     ResultPtr(ResultBuf.data()), hadError(false), Pascal(false) {
     ResultPtr(ResultBuf.data()), hadError(false), Pascal(false) {

+ 17 - 17
lib/Lex/PPDirectives.cpp

@@ -124,7 +124,7 @@ void Preprocessor::ReadMacroName(Token &MacroNameTok, char isDefineUndef) {
     const IdentifierInfo &Info = Identifiers.get(Spelling);
     const IdentifierInfo &Info = Identifiers.get(Spelling);
 
 
     // Allow #defining |and| and friends in microsoft mode.
     // Allow #defining |and| and friends in microsoft mode.
-    if (Info.isCPlusPlusOperatorKeyword() && getLangOptions().MicrosoftMode) {
+    if (Info.isCPlusPlusOperatorKeyword() && getLangOpts().MicrosoftMode) {
       MacroNameTok.setIdentifierInfo(getIdentifierInfo(Spelling));
       MacroNameTok.setIdentifierInfo(getIdentifierInfo(Spelling));
       return;
       return;
     }
     }
@@ -181,7 +181,7 @@ void Preprocessor::CheckEndOfDirective(const char *DirType, bool EnableMacros) {
     // trouble than it is worth to insert /**/ and check that there is no /**/
     // trouble than it is worth to insert /**/ and check that there is no /**/
     // in the range also.
     // in the range also.
     FixItHint Hint;
     FixItHint Hint;
-    if ((Features.GNUMode || Features.C99 || Features.CPlusPlus) &&
+    if ((LangOpts.GNUMode || LangOpts.C99 || LangOpts.CPlusPlus) &&
         !CurTokenLexer)
         !CurTokenLexer)
       Hint = FixItHint::CreateInsertion(Tmp.getLocation(),"//");
       Hint = FixItHint::CreateInsertion(Tmp.getLocation(),"//");
     Diag(Tmp, diag::ext_pp_extra_tokens_at_eol) << DirType << Hint;
     Diag(Tmp, diag::ext_pp_extra_tokens_at_eol) << DirType << Hint;
@@ -619,7 +619,7 @@ TryAgain:
     setCodeCompletionReached();
     setCodeCompletionReached();
     return;
     return;
   case tok::numeric_constant:  // # 7  GNU line marker directive.
   case tok::numeric_constant:  // # 7  GNU line marker directive.
-    if (getLangOptions().AsmPreprocessor)
+    if (getLangOpts().AsmPreprocessor)
       break;  // # 4 is not a preprocessor directive in .S files.
       break;  // # 4 is not a preprocessor directive in .S files.
     return HandleDigitDirective(Result);
     return HandleDigitDirective(Result);
   default:
   default:
@@ -690,12 +690,12 @@ TryAgain:
       break;
       break;
         
         
     case tok::pp___public_macro:
     case tok::pp___public_macro:
-      if (getLangOptions().Modules)
+      if (getLangOpts().Modules)
         return HandleMacroPublicDirective(Result);
         return HandleMacroPublicDirective(Result);
       break;
       break;
         
         
     case tok::pp___private_macro:
     case tok::pp___private_macro:
-      if (getLangOptions().Modules)
+      if (getLangOpts().Modules)
         return HandleMacroPrivateDirective(Result);
         return HandleMacroPrivateDirective(Result);
       break;
       break;
     }
     }
@@ -706,7 +706,7 @@ TryAgain:
   // directives.  This is important because # may be a comment or introduce
   // directives.  This is important because # may be a comment or introduce
   // various pseudo-ops.  Just return the # token and push back the following
   // various pseudo-ops.  Just return the # token and push back the following
   // token to be lexed next time.
   // token to be lexed next time.
-  if (getLangOptions().AsmPreprocessor) {
+  if (getLangOpts().AsmPreprocessor) {
     Token *Toks = new Token[2];
     Token *Toks = new Token[2];
     // Return the # and the token after it.
     // Return the # and the token after it.
     Toks[0] = SavedHash;
     Toks[0] = SavedHash;
@@ -805,11 +805,11 @@ void Preprocessor::HandleLineDirective(Token &Tok) {
   // Enforce C99 6.10.4p3: "The digit sequence shall not specify ... a
   // Enforce C99 6.10.4p3: "The digit sequence shall not specify ... a
   // number greater than 2147483647".  C90 requires that the line # be <= 32767.
   // number greater than 2147483647".  C90 requires that the line # be <= 32767.
   unsigned LineLimit = 32768U;
   unsigned LineLimit = 32768U;
-  if (Features.C99 || Features.CPlusPlus0x)
+  if (LangOpts.C99 || LangOpts.CPlusPlus0x)
     LineLimit = 2147483648U;
     LineLimit = 2147483648U;
   if (LineNo >= LineLimit)
   if (LineNo >= LineLimit)
     Diag(DigitTok, diag::ext_pp_line_too_big) << LineLimit;
     Diag(DigitTok, diag::ext_pp_line_too_big) << LineLimit;
-  else if (Features.CPlusPlus0x && LineNo >= 32768U)
+  else if (LangOpts.CPlusPlus0x && LineNo >= 32768U)
     Diag(DigitTok, diag::warn_cxx98_compat_pp_line_too_big);
     Diag(DigitTok, diag::warn_cxx98_compat_pp_line_too_big);
 
 
   int FilenameID = -1;
   int FilenameID = -1;
@@ -1334,7 +1334,7 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc,
   const FileEntry *File = LookupFile(
   const FileEntry *File = LookupFile(
       Filename, isAngled, LookupFrom, CurDir,
       Filename, isAngled, LookupFrom, CurDir,
       Callbacks ? &SearchPath : NULL, Callbacks ? &RelativePath : NULL,
       Callbacks ? &SearchPath : NULL, Callbacks ? &RelativePath : NULL,
-      getLangOptions().Modules? &SuggestedModule : 0);
+      getLangOpts().Modules? &SuggestedModule : 0);
 
 
   if (Callbacks) {
   if (Callbacks) {
     if (!File) {
     if (!File) {
@@ -1348,7 +1348,7 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc,
           
           
           // Try the lookup again, skipping the cache.
           // Try the lookup again, skipping the cache.
           File = LookupFile(Filename, isAngled, LookupFrom, CurDir, 0, 0,
           File = LookupFile(Filename, isAngled, LookupFrom, CurDir, 0, 0,
-                            getLangOptions().Modules? &SuggestedModule : 0,
+                            getLangOpts().Modules? &SuggestedModule : 0,
                             /*SkipCache*/true);
                             /*SkipCache*/true);
         }
         }
       }
       }
@@ -1410,9 +1410,9 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc,
     // Determine whether we are actually building the module that this
     // Determine whether we are actually building the module that this
     // include directive maps to.
     // include directive maps to.
     bool BuildingImportedModule
     bool BuildingImportedModule
-      = Path[0].first->getName() == getLangOptions().CurrentModule;
+      = Path[0].first->getName() == getLangOpts().CurrentModule;
     
     
-    if (!BuildingImportedModule && getLangOptions().ObjC2) {
+    if (!BuildingImportedModule && getLangOpts().ObjC2) {
       // If we're not building the imported module, warn that we're going
       // If we're not building the imported module, warn that we're going
       // to automatically turn this inclusion directive into a module import.
       // to automatically turn this inclusion directive into a module import.
       // We only do this in Objective-C, where we have a module-import syntax.
       // We only do this in Objective-C, where we have a module-import syntax.
@@ -1488,7 +1488,7 @@ void Preprocessor::HandleIncludeNextDirective(SourceLocation HashLoc,
 ///
 ///
 void Preprocessor::HandleImportDirective(SourceLocation HashLoc,
 void Preprocessor::HandleImportDirective(SourceLocation HashLoc,
                                          Token &ImportTok) {
                                          Token &ImportTok) {
-  if (!Features.ObjC1)  // #import is standard for ObjC.
+  if (!LangOpts.ObjC1)  // #import is standard for ObjC.
     Diag(ImportTok, diag::ext_pp_import_directive);
     Diag(ImportTok, diag::ext_pp_import_directive);
 
 
   return HandleIncludeDirective(HashLoc, ImportTok, 0, true);
   return HandleIncludeDirective(HashLoc, ImportTok, 0, true);
@@ -1544,8 +1544,8 @@ bool Preprocessor::ReadMacroDefinitionArgList(MacroInfo *MI) {
       Diag(Tok, diag::err_pp_expected_ident_in_arg_list);
       Diag(Tok, diag::err_pp_expected_ident_in_arg_list);
       return true;
       return true;
     case tok::ellipsis:  // #define X(... -> C99 varargs
     case tok::ellipsis:  // #define X(... -> C99 varargs
-      if (!Features.C99)
-        Diag(Tok, Features.CPlusPlus0x ? 
+      if (!LangOpts.C99)
+        Diag(Tok, LangOpts.CPlusPlus0x ? 
              diag::warn_cxx98_compat_variadic_macro :
              diag::warn_cxx98_compat_variadic_macro :
              diag::ext_variadic_macro);
              diag::ext_variadic_macro);
 
 
@@ -1671,7 +1671,7 @@ void Preprocessor::HandleDefineDirective(Token &DefineTok) {
 
 
     // Read the first token after the arg list for down below.
     // Read the first token after the arg list for down below.
     LexUnexpandedToken(Tok);
     LexUnexpandedToken(Tok);
-  } else if (Features.C99 || Features.CPlusPlus0x) {
+  } else if (LangOpts.C99 || LangOpts.CPlusPlus0x) {
     // C99 requires whitespace between the macro definition and the body.  Emit
     // C99 requires whitespace between the macro definition and the body.  Emit
     // a diagnostic for something like "#define X+".
     // a diagnostic for something like "#define X+".
     Diag(Tok, diag::ext_c99_whitespace_required_after_macro_name);
     Diag(Tok, diag::ext_c99_whitespace_required_after_macro_name);
@@ -1736,7 +1736,7 @@ void Preprocessor::HandleDefineDirective(Token &DefineTok) {
         // the '#' because '#' is often a comment character.  However, change
         // the '#' because '#' is often a comment character.  However, change
         // the kind of the token to tok::unknown so that the preprocessor isn't
         // the kind of the token to tok::unknown so that the preprocessor isn't
         // confused.
         // confused.
-        if (getLangOptions().AsmPreprocessor && Tok.isNot(tok::eod)) {
+        if (getLangOpts().AsmPreprocessor && Tok.isNot(tok::eod)) {
           LastTok.setKind(tok::unknown);
           LastTok.setKind(tok::unknown);
         } else {
         } else {
           Diag(Tok, diag::err_pp_stringize_not_parameter);
           Diag(Tok, diag::err_pp_stringize_not_parameter);

+ 4 - 4
lib/Lex/PPExpressions.cpp

@@ -220,8 +220,8 @@ static bool EvaluateValue(PPValue &Result, Token &PeekTok, DefinedTracker &DT,
       PP.Diag(PeekTok, diag::err_pp_invalid_udl) << /*integer*/1;
       PP.Diag(PeekTok, diag::err_pp_invalid_udl) << /*integer*/1;
 
 
     // long long is a C99 feature.
     // long long is a C99 feature.
-    if (!PP.getLangOptions().C99 && Literal.isLongLong)
-      PP.Diag(PeekTok, PP.getLangOptions().CPlusPlus0x ?
+    if (!PP.getLangOpts().C99 && Literal.isLongLong)
+      PP.Diag(PeekTok, PP.getLangOpts().CPlusPlus0x ?
               diag::warn_cxx98_compat_longlong : diag::ext_longlong);
               diag::warn_cxx98_compat_longlong : diag::ext_longlong);
 
 
     // Parse the integer literal into Result.
     // Parse the integer literal into Result.
@@ -290,7 +290,7 @@ static bool EvaluateValue(PPValue &Result, Token &PeekTok, DefinedTracker &DT,
     Val = Literal.getValue();
     Val = Literal.getValue();
     // Set the signedness. UTF-16 and UTF-32 are always unsigned
     // Set the signedness. UTF-16 and UTF-32 are always unsigned
     if (!Literal.isUTF16() && !Literal.isUTF32())
     if (!Literal.isUTF16() && !Literal.isUTF32())
-      Val.setIsUnsigned(!PP.getLangOptions().CharIsSigned);
+      Val.setIsUnsigned(!PP.getLangOpts().CharIsSigned);
 
 
     if (Result.Val.getBitWidth() > Val.getBitWidth()) {
     if (Result.Val.getBitWidth() > Val.getBitWidth()) {
       Result.Val = Val.extend(Result.Val.getBitWidth());
       Result.Val = Val.extend(Result.Val.getBitWidth());
@@ -654,7 +654,7 @@ static bool EvaluateDirectiveSubExpr(PPValue &LHS, unsigned MinPrec,
     case tok::comma:
     case tok::comma:
       // Comma is invalid in pp expressions in c89/c++ mode, but is valid in C99
       // Comma is invalid in pp expressions in c89/c++ mode, but is valid in C99
       // if not being evaluated.
       // if not being evaluated.
-      if (!PP.getLangOptions().C99 || ValueLive)
+      if (!PP.getLangOpts().C99 || ValueLive)
         PP.Diag(OpLoc, diag::ext_pp_comma_expr)
         PP.Diag(OpLoc, diag::ext_pp_comma_expr)
           << LHS.getRange() << RHS.getRange();
           << LHS.getRange() << RHS.getRange();
       Res = RHS.Val; // LHS = LHS,RHS -> RHS.
       Res = RHS.Val; // LHS = LHS,RHS -> RHS.

+ 5 - 5
lib/Lex/PPMacroExpansion.cpp

@@ -101,7 +101,7 @@ void Preprocessor::RegisterBuiltinMacros() {
   Ident__has_warning      = RegisterBuiltinMacro(*this, "__has_warning");
   Ident__has_warning      = RegisterBuiltinMacro(*this, "__has_warning");
 
 
   // Microsoft Extensions.
   // Microsoft Extensions.
-  if (Features.MicrosoftExt) 
+  if (LangOpts.MicrosoftExt) 
     Ident__pragma = RegisterBuiltinMacro(*this, "__pragma");
     Ident__pragma = RegisterBuiltinMacro(*this, "__pragma");
   else
   else
     Ident__pragma = 0;
     Ident__pragma = 0;
@@ -433,8 +433,8 @@ MacroArgs *Preprocessor::ReadFunctionLikeMacroArgs(Token &MacroName,
 
 
     // Empty arguments are standard in C99 and C++0x, and are supported as an extension in
     // Empty arguments are standard in C99 and C++0x, and are supported as an extension in
     // other modes.
     // other modes.
-    if (ArgTokens.size() == ArgTokenStart && !Features.C99)
-      Diag(Tok, Features.CPlusPlus0x ?
+    if (ArgTokens.size() == ArgTokenStart && !LangOpts.C99)
+      Diag(Tok, LangOpts.CPlusPlus0x ?
            diag::warn_cxx98_compat_empty_fnmacro_arg :
            diag::warn_cxx98_compat_empty_fnmacro_arg :
            diag::ext_empty_fnmacro_arg);
            diag::ext_empty_fnmacro_arg);
 
 
@@ -588,7 +588,7 @@ static void ComputeDATE_TIME(SourceLocation &DATELoc, SourceLocation &TIMELoc,
 /// HasFeature - Return true if we recognize and implement the feature
 /// HasFeature - Return true if we recognize and implement the feature
 /// specified by the identifier as a standard language feature.
 /// specified by the identifier as a standard language feature.
 static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
 static bool HasFeature(const Preprocessor &PP, const IdentifierInfo *II) {
-  const LangOptions &LangOpts = PP.getLangOptions();
+  const LangOptions &LangOpts = PP.getLangOpts();
   StringRef Feature = II->getName();
   StringRef Feature = II->getName();
 
 
   // Normalize the feature name, __foo__ becomes foo.
   // Normalize the feature name, __foo__ becomes foo.
@@ -732,7 +732,7 @@ static bool HasExtension(const Preprocessor &PP, const IdentifierInfo *II) {
       DiagnosticsEngine::Ext_Error)
       DiagnosticsEngine::Ext_Error)
     return false;
     return false;
 
 
-  const LangOptions &LangOpts = PP.getLangOptions();
+  const LangOptions &LangOpts = PP.getLangOpts();
   StringRef Extension = II->getName();
   StringRef Extension = II->getName();
 
 
   // Normalize the extension name, __foo__ becomes foo.
   // Normalize the extension name, __foo__ becomes foo.

+ 1 - 1
lib/Lex/Pragma.cpp

@@ -1230,7 +1230,7 @@ void Preprocessor::RegisterBuiltinPragmas() {
   AddPragmaHandler("STDC", new PragmaSTDC_UnknownHandler());
   AddPragmaHandler("STDC", new PragmaSTDC_UnknownHandler());
 
 
   // MS extensions.
   // MS extensions.
-  if (Features.MicrosoftExt) {
+  if (LangOpts.MicrosoftExt) {
     AddPragmaHandler(new PragmaCommentHandler());
     AddPragmaHandler(new PragmaCommentHandler());
     AddPragmaHandler(new PragmaIncludeAliasHandler());
     AddPragmaHandler(new PragmaIncludeAliasHandler());
   }
   }

+ 5 - 5
lib/Lex/Preprocessor.cpp

@@ -55,7 +55,7 @@ Preprocessor::Preprocessor(DiagnosticsEngine &diags, LangOptions &opts,
                            IdentifierInfoLookup* IILookup,
                            IdentifierInfoLookup* IILookup,
                            bool OwnsHeaders,
                            bool OwnsHeaders,
                            bool DelayInitialization)
                            bool DelayInitialization)
-  : Diags(&diags), Features(opts), Target(target),FileMgr(Headers.getFileMgr()),
+  : Diags(&diags), LangOpts(opts), Target(target),FileMgr(Headers.getFileMgr()),
     SourceMgr(SM), HeaderInfo(Headers), TheModuleLoader(TheModuleLoader),
     SourceMgr(SM), HeaderInfo(Headers), TheModuleLoader(TheModuleLoader),
     ExternalSource(0), 
     ExternalSource(0), 
     Identifiers(opts, IILookup), CodeComplete(0),
     Identifiers(opts, IILookup), CodeComplete(0),
@@ -153,7 +153,7 @@ void Preprocessor::Initialize(const TargetInfo &Target) {
   // Initialize builtin macros like __LINE__ and friends.
   // Initialize builtin macros like __LINE__ and friends.
   RegisterBuiltinMacros();
   RegisterBuiltinMacros();
   
   
-  if(Features.Borland) {
+  if(LangOpts.Borland) {
     Ident__exception_info        = getIdentifierInfo("_exception_info");
     Ident__exception_info        = getIdentifierInfo("_exception_info");
     Ident___exception_info       = getIdentifierInfo("__exception_info");
     Ident___exception_info       = getIdentifierInfo("__exception_info");
     Ident_GetExceptionInfo       = getIdentifierInfo("GetExceptionInformation");
     Ident_GetExceptionInfo       = getIdentifierInfo("GetExceptionInformation");
@@ -382,10 +382,10 @@ void Preprocessor::CreateString(const char *Buf, unsigned Len, Token &Tok,
 }
 }
 
 
 Module *Preprocessor::getCurrentModule() {
 Module *Preprocessor::getCurrentModule() {
-  if (getLangOptions().CurrentModule.empty())
+  if (getLangOpts().CurrentModule.empty())
     return 0;
     return 0;
   
   
-  return getHeaderSearchInfo().lookupModule(getLangOptions().CurrentModule);
+  return getHeaderSearchInfo().lookupModule(getLangOpts().CurrentModule);
 }
 }
 
 
 //===----------------------------------------------------------------------===//
 //===----------------------------------------------------------------------===//
@@ -572,7 +572,7 @@ void Preprocessor::HandleIdentifier(Token &Identifier) {
   // keyword when we're in a caching lexer, because caching lexers only get
   // keyword when we're in a caching lexer, because caching lexers only get
   // used in contexts where import declarations are disallowed.
   // used in contexts where import declarations are disallowed.
   if (II.isModulesImport() && !InMacroArgs && !DisableMacroExpansion &&
   if (II.isModulesImport() && !InMacroArgs && !DisableMacroExpansion &&
-      getLangOptions().Modules && CurLexerKind != CLK_CachingLexer) {
+      getLangOpts().Modules && CurLexerKind != CLK_CachingLexer) {
     ModuleImportLoc = Identifier.getLocation();
     ModuleImportLoc = Identifier.getLocation();
     ModuleImportPath.clear();
     ModuleImportPath.clear();
     ModuleImportExpectsIdentifier = true;
     ModuleImportExpectsIdentifier = true;

+ 7 - 7
lib/Lex/TokenConcatenation.cpp

@@ -45,7 +45,7 @@ static bool IsStringPrefix(StringRef Str, bool CPlusPlus0x) {
 /// IsIdentifierStringPrefix - Return true if the spelling of the token
 /// IsIdentifierStringPrefix - Return true if the spelling of the token
 /// is literally 'L', 'u', 'U', or 'u8'. Including raw versions.
 /// is literally 'L', 'u', 'U', or 'u8'. Including raw versions.
 bool TokenConcatenation::IsIdentifierStringPrefix(const Token &Tok) const {
 bool TokenConcatenation::IsIdentifierStringPrefix(const Token &Tok) const {
-  const LangOptions &LangOpts = PP.getLangOptions();
+  const LangOptions &LangOpts = PP.getLangOpts();
 
 
   if (!Tok.needsCleaning()) {
   if (!Tok.needsCleaning()) {
     if (Tok.getLength() < 1 || Tok.getLength() > 3)
     if (Tok.getLength() < 1 || Tok.getLength() > 3)
@@ -86,7 +86,7 @@ TokenConcatenation::TokenConcatenation(Preprocessor &pp) : PP(pp) {
   TokenInfo[tok::arrow           ] |= aci_custom_firstchar;
   TokenInfo[tok::arrow           ] |= aci_custom_firstchar;
 
 
   // These tokens have custom code in C++11 mode.
   // These tokens have custom code in C++11 mode.
-  if (PP.getLangOptions().CPlusPlus0x) {
+  if (PP.getLangOpts().CPlusPlus0x) {
     TokenInfo[tok::string_literal      ] |= aci_custom;
     TokenInfo[tok::string_literal      ] |= aci_custom;
     TokenInfo[tok::wide_string_literal ] |= aci_custom;
     TokenInfo[tok::wide_string_literal ] |= aci_custom;
     TokenInfo[tok::utf8_string_literal ] |= aci_custom;
     TokenInfo[tok::utf8_string_literal ] |= aci_custom;
@@ -205,7 +205,7 @@ bool TokenConcatenation::AvoidConcat(const Token &PrevPrevTok,
   case tok::wide_char_constant:
   case tok::wide_char_constant:
   case tok::utf16_char_constant:
   case tok::utf16_char_constant:
   case tok::utf32_char_constant:
   case tok::utf32_char_constant:
-    if (!PP.getLangOptions().CPlusPlus0x)
+    if (!PP.getLangOpts().CPlusPlus0x)
       return false;
       return false;
 
 
     // In C++11, a string or character literal followed by an identifier is a
     // In C++11, a string or character literal followed by an identifier is a
@@ -240,11 +240,11 @@ bool TokenConcatenation::AvoidConcat(const Token &PrevPrevTok,
   case tok::numeric_constant:
   case tok::numeric_constant:
     return isalnum(FirstChar) || Tok.is(tok::numeric_constant) ||
     return isalnum(FirstChar) || Tok.is(tok::numeric_constant) ||
            FirstChar == '+' || FirstChar == '-' || FirstChar == '.' ||
            FirstChar == '+' || FirstChar == '-' || FirstChar == '.' ||
-           (PP.getLangOptions().CPlusPlus0x && FirstChar == '_');
+           (PP.getLangOpts().CPlusPlus0x && FirstChar == '_');
   case tok::period:          // ..., .*, .1234
   case tok::period:          // ..., .*, .1234
     return (FirstChar == '.' && PrevPrevTok.is(tok::period)) ||
     return (FirstChar == '.' && PrevPrevTok.is(tok::period)) ||
     isdigit(FirstChar) ||
     isdigit(FirstChar) ||
-    (PP.getLangOptions().CPlusPlus && FirstChar == '*');
+    (PP.getLangOpts().CPlusPlus && FirstChar == '*');
   case tok::amp:             // &&
   case tok::amp:             // &&
     return FirstChar == '&';
     return FirstChar == '&';
   case tok::plus:            // ++
   case tok::plus:            // ++
@@ -263,10 +263,10 @@ bool TokenConcatenation::AvoidConcat(const Token &PrevPrevTok,
     return FirstChar == '>' || FirstChar == ':';
     return FirstChar == '>' || FirstChar == ':';
   case tok::colon:           // ::, :>
   case tok::colon:           // ::, :>
     return FirstChar == '>' ||
     return FirstChar == '>' ||
-    (PP.getLangOptions().CPlusPlus && FirstChar == ':');
+    (PP.getLangOpts().CPlusPlus && FirstChar == ':');
   case tok::hash:            // ##, #@, %:%:
   case tok::hash:            // ##, #@, %:%:
     return FirstChar == '#' || FirstChar == '@' || FirstChar == '%';
     return FirstChar == '#' || FirstChar == '@' || FirstChar == '%';
   case tok::arrow:           // ->*
   case tok::arrow:           // ->*
-    return PP.getLangOptions().CPlusPlus && FirstChar == '*';
+    return PP.getLangOpts().CPlusPlus && FirstChar == '*';
   }
   }
 }
 }

+ 4 - 4
lib/Lex/TokenLexer.cpp

@@ -527,7 +527,7 @@ bool TokenLexer::PasteTokens(Token &Tok) {
       // Make a lexer to lex this string from.  Lex just this one token.
       // Make a lexer to lex this string from.  Lex just this one token.
       // Make a lexer object so that we lex and expand the paste result.
       // Make a lexer object so that we lex and expand the paste result.
       Lexer TL(SourceMgr.getLocForStartOfFile(LocFileID),
       Lexer TL(SourceMgr.getLocForStartOfFile(LocFileID),
-               PP.getLangOptions(), ScratchBufStart,
+               PP.getLangOpts(), ScratchBufStart,
                ResultTokStrPtr, ResultTokStrPtr+LHSLen+RHSLen);
                ResultTokStrPtr, ResultTokStrPtr+LHSLen+RHSLen);
 
 
       // Lex a token in raw mode.  This way it won't look up identifiers
       // Lex a token in raw mode.  This way it won't look up identifiers
@@ -546,14 +546,14 @@ bool TokenLexer::PasteTokens(Token &Tok) {
       if (isInvalid) {
       if (isInvalid) {
         // Test for the Microsoft extension of /##/ turning into // here on the
         // Test for the Microsoft extension of /##/ turning into // here on the
         // error path.
         // error path.
-        if (PP.getLangOptions().MicrosoftExt && Tok.is(tok::slash) &&
+        if (PP.getLangOpts().MicrosoftExt && Tok.is(tok::slash) &&
             RHS.is(tok::slash)) {
             RHS.is(tok::slash)) {
           HandleMicrosoftCommentPaste(Tok);
           HandleMicrosoftCommentPaste(Tok);
           return true;
           return true;
         }
         }
 
 
         // Do not emit the error when preprocessing assembler code.
         // Do not emit the error when preprocessing assembler code.
-        if (!PP.getLangOptions().AsmPreprocessor) {
+        if (!PP.getLangOpts().AsmPreprocessor) {
           // Explicitly convert the token location to have proper expansion
           // Explicitly convert the token location to have proper expansion
           // information so that the user knows where it came from.
           // information so that the user knows where it came from.
           SourceManager &SM = PP.getSourceManager();
           SourceManager &SM = PP.getSourceManager();
@@ -563,7 +563,7 @@ bool TokenLexer::PasteTokens(Token &Tok) {
           // error to a warning that defaults to an error.  This allows
           // error to a warning that defaults to an error.  This allows
           // disabling it.
           // disabling it.
           PP.Diag(Loc,
           PP.Diag(Loc,
-                  PP.getLangOptions().MicrosoftExt ? diag::err_pp_bad_paste_ms 
+                  PP.getLangOpts().MicrosoftExt ? diag::err_pp_bad_paste_ms 
                                                    : diag::err_pp_bad_paste)
                                                    : diag::err_pp_bad_paste)
             << Buffer.str();
             << Buffer.str();
         }
         }

+ 4 - 4
lib/Parse/ParseCXXInlineMethods.cpp

@@ -74,7 +74,7 @@ Decl *Parser::ParseCXXInlineMethodDef(AccessSpecifier AS,
     bool Delete = false;
     bool Delete = false;
     SourceLocation KWLoc;
     SourceLocation KWLoc;
     if (Tok.is(tok::kw_delete)) {
     if (Tok.is(tok::kw_delete)) {
-      Diag(Tok, getLang().CPlusPlus0x ?
+      Diag(Tok, getLangOpts().CPlusPlus0x ?
            diag::warn_cxx98_compat_deleted_function :
            diag::warn_cxx98_compat_deleted_function :
            diag::ext_deleted_function);
            diag::ext_deleted_function);
 
 
@@ -82,7 +82,7 @@ Decl *Parser::ParseCXXInlineMethodDef(AccessSpecifier AS,
       Actions.SetDeclDeleted(FnD, KWLoc);
       Actions.SetDeclDeleted(FnD, KWLoc);
       Delete = true;
       Delete = true;
     } else if (Tok.is(tok::kw_default)) {
     } else if (Tok.is(tok::kw_default)) {
-      Diag(Tok, getLang().CPlusPlus0x ?
+      Diag(Tok, getLangOpts().CPlusPlus0x ?
            diag::warn_cxx98_compat_defaulted_function :
            diag::warn_cxx98_compat_defaulted_function :
            diag::ext_defaulted_function);
            diag::ext_defaulted_function);
 
 
@@ -107,7 +107,7 @@ Decl *Parser::ParseCXXInlineMethodDef(AccessSpecifier AS,
   // In delayed template parsing mode, if we are within a class template
   // In delayed template parsing mode, if we are within a class template
   // or if we are about to parse function member template then consume
   // or if we are about to parse function member template then consume
   // the tokens and store them for parsing at the end of the translation unit.
   // the tokens and store them for parsing at the end of the translation unit.
-  if (getLang().DelayedTemplateParsing && 
+  if (getLangOpts().DelayedTemplateParsing && 
       ((Actions.CurContext->isDependentContext() ||
       ((Actions.CurContext->isDependentContext() ||
         TemplateInfo.Kind != ParsedTemplateInfo::NonTemplate) && 
         TemplateInfo.Kind != ParsedTemplateInfo::NonTemplate) && 
         !Actions.IsInsideALocalClassWithinATemplateFunction())) {
         !Actions.IsInsideALocalClassWithinATemplateFunction())) {
@@ -632,7 +632,7 @@ bool Parser::ConsumeAndStoreFunctionPrologue(CachedTokens &Toks) {
         ConsumeBrace();
         ConsumeBrace();
         // In C++03, this has to be the start of the function body, which
         // In C++03, this has to be the start of the function body, which
         // means the initializer is malformed; we'll diagnose it later.
         // means the initializer is malformed; we'll diagnose it later.
-        if (!getLang().CPlusPlus0x)
+        if (!getLangOpts().CPlusPlus0x)
           return false;
           return false;
       }
       }
 
 

+ 73 - 73
lib/Parse/ParseDecl.cpp

@@ -934,7 +934,7 @@ Parser::DeclGroupPtrTy Parser::ParseDeclaration(StmtVector &Stmts,
     break;
     break;
   case tok::kw_inline:
   case tok::kw_inline:
     // Could be the start of an inline namespace. Allowed as an ext in C++03.
     // Could be the start of an inline namespace. Allowed as an ext in C++03.
-    if (getLang().CPlusPlus && NextToken().is(tok::kw_namespace)) {
+    if (getLangOpts().CPlusPlus && NextToken().is(tok::kw_namespace)) {
       ProhibitAttributes(attrs);
       ProhibitAttributes(attrs);
       SourceLocation InlineLoc = ConsumeToken();
       SourceLocation InlineLoc = ConsumeToken();
       SingleDecl = ParseNamespace(Context, DeclEnd, InlineLoc);
       SingleDecl = ParseNamespace(Context, DeclEnd, InlineLoc);
@@ -1023,14 +1023,14 @@ bool Parser::MightBeDeclarator(unsigned Context) {
 
 
   case tok::amp:
   case tok::amp:
   case tok::ampamp:
   case tok::ampamp:
-    return getLang().CPlusPlus;
+    return getLangOpts().CPlusPlus;
 
 
   case tok::l_square: // Might be an attribute on an unnamed bit-field.
   case tok::l_square: // Might be an attribute on an unnamed bit-field.
-    return Context == Declarator::MemberContext && getLang().CPlusPlus0x &&
+    return Context == Declarator::MemberContext && getLangOpts().CPlusPlus0x &&
            NextToken().is(tok::l_square);
            NextToken().is(tok::l_square);
 
 
   case tok::colon: // Might be a typo for '::' or an unnamed bit-field.
   case tok::colon: // Might be a typo for '::' or an unnamed bit-field.
-    return Context == Declarator::MemberContext || getLang().CPlusPlus;
+    return Context == Declarator::MemberContext || getLangOpts().CPlusPlus;
 
 
   case tok::identifier:
   case tok::identifier:
     switch (NextToken().getKind()) {
     switch (NextToken().getKind()) {
@@ -1057,10 +1057,10 @@ bool Parser::MightBeDeclarator(unsigned Context) {
       // and in block scope it's probably a label. Inside a class definition,
       // and in block scope it's probably a label. Inside a class definition,
       // this is a bit-field.
       // this is a bit-field.
       return Context == Declarator::MemberContext ||
       return Context == Declarator::MemberContext ||
-             (getLang().CPlusPlus && Context == Declarator::FileContext);
+             (getLangOpts().CPlusPlus && Context == Declarator::FileContext);
 
 
     case tok::identifier: // Possible virt-specifier.
     case tok::identifier: // Possible virt-specifier.
-      return getLang().CPlusPlus0x && isCXX0XVirtSpecifier(NextToken());
+      return getLangOpts().CPlusPlus0x && isCXX0XVirtSpecifier(NextToken());
 
 
     default:
     default:
       return false;
       return false;
@@ -1324,7 +1324,7 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(Declarator &D,
       else
       else
         Diag(ConsumeToken(), diag::err_default_special_members);
         Diag(ConsumeToken(), diag::err_default_special_members);
     } else {
     } else {
-      if (getLang().CPlusPlus && D.getCXXScopeSpec().isSet()) {
+      if (getLangOpts().CPlusPlus && D.getCXXScopeSpec().isSet()) {
         EnterScope(0);
         EnterScope(0);
         Actions.ActOnCXXEnterDeclInitializer(getCurScope(), ThisDecl);
         Actions.ActOnCXXEnterDeclInitializer(getCurScope(), ThisDecl);
       }
       }
@@ -1337,7 +1337,7 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(Declarator &D,
       
       
       ExprResult Init(ParseInitializer());
       ExprResult Init(ParseInitializer());
 
 
-      if (getLang().CPlusPlus && D.getCXXScopeSpec().isSet()) {
+      if (getLangOpts().CPlusPlus && D.getCXXScopeSpec().isSet()) {
         Actions.ActOnCXXExitDeclInitializer(getCurScope(), ThisDecl);
         Actions.ActOnCXXExitDeclInitializer(getCurScope(), ThisDecl);
         ExitScope();
         ExitScope();
       }
       }
@@ -1357,7 +1357,7 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(Declarator &D,
     ExprVector Exprs(Actions);
     ExprVector Exprs(Actions);
     CommaLocsTy CommaLocs;
     CommaLocsTy CommaLocs;
 
 
-    if (getLang().CPlusPlus && D.getCXXScopeSpec().isSet()) {
+    if (getLangOpts().CPlusPlus && D.getCXXScopeSpec().isSet()) {
       EnterScope(0);
       EnterScope(0);
       Actions.ActOnCXXEnterDeclInitializer(getCurScope(), ThisDecl);
       Actions.ActOnCXXEnterDeclInitializer(getCurScope(), ThisDecl);
     }
     }
@@ -1365,7 +1365,7 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(Declarator &D,
     if (ParseExpressionList(Exprs, CommaLocs)) {
     if (ParseExpressionList(Exprs, CommaLocs)) {
       SkipUntil(tok::r_paren);
       SkipUntil(tok::r_paren);
 
 
-      if (getLang().CPlusPlus && D.getCXXScopeSpec().isSet()) {
+      if (getLangOpts().CPlusPlus && D.getCXXScopeSpec().isSet()) {
         Actions.ActOnCXXExitDeclInitializer(getCurScope(), ThisDecl);
         Actions.ActOnCXXExitDeclInitializer(getCurScope(), ThisDecl);
         ExitScope();
         ExitScope();
       }
       }
@@ -1376,7 +1376,7 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(Declarator &D,
       assert(!Exprs.empty() && Exprs.size()-1 == CommaLocs.size() &&
       assert(!Exprs.empty() && Exprs.size()-1 == CommaLocs.size() &&
              "Unexpected number of commas!");
              "Unexpected number of commas!");
 
 
-      if (getLang().CPlusPlus && D.getCXXScopeSpec().isSet()) {
+      if (getLangOpts().CPlusPlus && D.getCXXScopeSpec().isSet()) {
         Actions.ActOnCXXExitDeclInitializer(getCurScope(), ThisDecl);
         Actions.ActOnCXXExitDeclInitializer(getCurScope(), ThisDecl);
         ExitScope();
         ExitScope();
       }
       }
@@ -1387,7 +1387,7 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(Declarator &D,
       Actions.AddInitializerToDecl(ThisDecl, Initializer.take(),
       Actions.AddInitializerToDecl(ThisDecl, Initializer.take(),
                                    /*DirectInit=*/true, TypeContainsAuto);
                                    /*DirectInit=*/true, TypeContainsAuto);
     }
     }
-  } else if (getLang().CPlusPlus0x && Tok.is(tok::l_brace)) {
+  } else if (getLangOpts().CPlusPlus0x && Tok.is(tok::l_brace)) {
     // Parse C++0x braced-init-list.
     // Parse C++0x braced-init-list.
     Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists);
     Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists);
 
 
@@ -1544,7 +1544,7 @@ bool Parser::ParseImplicitInt(DeclSpec &DS, CXXScopeSpec *SS,
 
 
     if (TagName) {
     if (TagName) {
       Diag(Loc, diag::err_use_of_tag_name_without_tag)
       Diag(Loc, diag::err_use_of_tag_name_without_tag)
-        << Tok.getIdentifierInfo() << TagName << getLang().CPlusPlus
+        << Tok.getIdentifierInfo() << TagName << getLangOpts().CPlusPlus
         << FixItHint::CreateInsertion(Tok.getLocation(),FixitTagName);
         << FixItHint::CreateInsertion(Tok.getLocation(),FixitTagName);
 
 
       // Parse this as a tag as if the missing tag were present.
       // Parse this as a tag as if the missing tag were present.
@@ -1632,7 +1632,7 @@ ExprResult Parser::ParseAlignArgument(SourceLocation Start,
   } else
   } else
     ER = ParseConstantExpression();
     ER = ParseConstantExpression();
 
 
-  if (getLang().CPlusPlus0x && Tok.is(tok::ellipsis))
+  if (getLangOpts().CPlusPlus0x && Tok.is(tok::ellipsis))
     EllipsisLoc = ConsumeToken();
     EllipsisLoc = ConsumeToken();
 
 
   return ER;
   return ER;
@@ -1930,7 +1930,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
       // Objective-C supports syntax of the form 'id<proto1,proto2>' where 'id'
       // Objective-C supports syntax of the form 'id<proto1,proto2>' where 'id'
       // is a specific typedef and 'itf<proto1,proto2>' where 'itf' is an
       // is a specific typedef and 'itf<proto1,proto2>' where 'itf' is an
       // Objective-C interface. 
       // Objective-C interface. 
-      if (Tok.is(tok::less) && getLang().ObjC1)
+      if (Tok.is(tok::less) && getLangOpts().ObjC1)
         ParseObjCProtocolQualifiers(DS);
         ParseObjCProtocolQualifiers(DS);
       
       
       continue;
       continue;
@@ -1959,7 +1959,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
     case tok::identifier: {
     case tok::identifier: {
       // In C++, check to see if this is a scope specifier like foo::bar::, if
       // In C++, check to see if this is a scope specifier like foo::bar::, if
       // so handle it as such.  This is important for ctor parsing.
       // so handle it as such.  This is important for ctor parsing.
-      if (getLang().CPlusPlus) {
+      if (getLangOpts().CPlusPlus) {
         if (TryAnnotateCXXScopeToken(true)) {
         if (TryAnnotateCXXScopeToken(true)) {
           if (!DS.hasTypeSpecifier())
           if (!DS.hasTypeSpecifier())
             DS.SetTypeSpecError();
             DS.SetTypeSpecError();
@@ -1993,7 +1993,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
 
 
       // If we're in a context where the identifier could be a class name,
       // If we're in a context where the identifier could be a class name,
       // check whether this is a constructor declaration.
       // check whether this is a constructor declaration.
-      if (getLang().CPlusPlus && DSContext == DSC_class &&
+      if (getLangOpts().CPlusPlus && DSContext == DSC_class &&
           Actions.isCurrentClassName(*Tok.getIdentifierInfo(), getCurScope()) &&
           Actions.isCurrentClassName(*Tok.getIdentifierInfo(), getCurScope()) &&
           isConstructorDeclarator())
           isConstructorDeclarator())
         goto DoneWithDeclSpec;
         goto DoneWithDeclSpec;
@@ -2009,7 +2009,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
       // Objective-C supports syntax of the form 'id<proto1,proto2>' where 'id'
       // Objective-C supports syntax of the form 'id<proto1,proto2>' where 'id'
       // is a specific typedef and 'itf<proto1,proto2>' where 'itf' is an
       // is a specific typedef and 'itf<proto1,proto2>' where 'itf' is an
       // Objective-C interface. 
       // Objective-C interface. 
-      if (Tok.is(tok::less) && getLang().ObjC1)
+      if (Tok.is(tok::less) && getLangOpts().ObjC1)
         ParseObjCProtocolQualifiers(DS);
         ParseObjCProtocolQualifiers(DS);
       
       
       // Need to support trailing type qualifiers (e.g. "id<p> const").
       // Need to support trailing type qualifiers (e.g. "id<p> const").
@@ -2029,7 +2029,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
       // If we're in a context where the template-id could be a
       // If we're in a context where the template-id could be a
       // constructor name or specialization, check whether this is a
       // constructor name or specialization, check whether this is a
       // constructor declaration.
       // constructor declaration.
-      if (getLang().CPlusPlus && DSContext == DSC_class &&
+      if (getLangOpts().CPlusPlus && DSContext == DSC_class &&
           Actions.isCurrentClassName(*TemplateId->Name, getCurScope()) &&
           Actions.isCurrentClassName(*TemplateId->Name, getCurScope()) &&
           isConstructorDeclarator())
           isConstructorDeclarator())
         goto DoneWithDeclSpec;
         goto DoneWithDeclSpec;
@@ -2098,7 +2098,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
                                          PrevSpec, DiagID);
                                          PrevSpec, DiagID);
       break;
       break;
     case tok::kw_auto:
     case tok::kw_auto:
-      if (getLang().CPlusPlus0x) {
+      if (getLangOpts().CPlusPlus0x) {
         if (isKnownToBeTypeSpecifier(GetLookAheadToken(1))) {
         if (isKnownToBeTypeSpecifier(GetLookAheadToken(1))) {
           isInvalid = DS.SetStorageClassSpec(Actions, DeclSpec::SCS_auto, Loc,
           isInvalid = DS.SetStorageClassSpec(Actions, DeclSpec::SCS_auto, Loc,
                                              PrevSpec, DiagID);
                                              PrevSpec, DiagID);
@@ -2137,7 +2137,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
 
 
     // alignment-specifier
     // alignment-specifier
     case tok::kw__Alignas:
     case tok::kw__Alignas:
-      if (!getLang().C11)
+      if (!getLangOpts().C11)
         Diag(Tok, diag::ext_c11_alignas);
         Diag(Tok, diag::ext_c11_alignas);
       ParseAlignmentSpecifier(DS.getAttributes());
       ParseAlignmentSpecifier(DS.getAttributes());
       continue;
       continue;
@@ -2289,15 +2289,15 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
     // cv-qualifier:
     // cv-qualifier:
     case tok::kw_const:
     case tok::kw_const:
       isInvalid = DS.SetTypeQual(DeclSpec::TQ_const, Loc, PrevSpec, DiagID,
       isInvalid = DS.SetTypeQual(DeclSpec::TQ_const, Loc, PrevSpec, DiagID,
-                                 getLang());
+                                 getLangOpts());
       break;
       break;
     case tok::kw_volatile:
     case tok::kw_volatile:
       isInvalid = DS.SetTypeQual(DeclSpec::TQ_volatile, Loc, PrevSpec, DiagID,
       isInvalid = DS.SetTypeQual(DeclSpec::TQ_volatile, Loc, PrevSpec, DiagID,
-                                 getLang());
+                                 getLangOpts());
       break;
       break;
     case tok::kw_restrict:
     case tok::kw_restrict:
       isInvalid = DS.SetTypeQual(DeclSpec::TQ_restrict, Loc, PrevSpec, DiagID,
       isInvalid = DS.SetTypeQual(DeclSpec::TQ_restrict, Loc, PrevSpec, DiagID,
-                                 getLang());
+                                 getLangOpts());
       break;
       break;
 
 
     // C++ typename-specifier:
     // C++ typename-specifier:
@@ -2329,7 +2329,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
 
 
     // OpenCL qualifiers:
     // OpenCL qualifiers:
     case tok::kw_private: 
     case tok::kw_private: 
-      if (!getLang().OpenCL)
+      if (!getLangOpts().OpenCL)
         goto DoneWithDeclSpec;
         goto DoneWithDeclSpec;
     case tok::kw___private:
     case tok::kw___private:
     case tok::kw___global:
     case tok::kw___global:
@@ -2345,7 +2345,7 @@ void Parser::ParseDeclarationSpecifiers(DeclSpec &DS,
       // GCC ObjC supports types like "<SomeProtocol>" as a synonym for
       // GCC ObjC supports types like "<SomeProtocol>" as a synonym for
       // "id<SomeProtocol>".  This is hopelessly old fashioned and dangerous,
       // "id<SomeProtocol>".  This is hopelessly old fashioned and dangerous,
       // but we support it.
       // but we support it.
-      if (DS.hasTypeSpecifier() || !getLang().ObjC1)
+      if (DS.hasTypeSpecifier() || !getLangOpts().ObjC1)
         goto DoneWithDeclSpec;
         goto DoneWithDeclSpec;
 
 
       if (!ParseObjCProtocolQualifiers(DS))
       if (!ParseObjCProtocolQualifiers(DS))
@@ -2476,7 +2476,7 @@ bool Parser::ParseOptionalTypeSpecifier(DeclSpec &DS, bool& isInvalid,
     // is a specific typedef and 'itf<proto1,proto2>' where 'itf' is an
     // is a specific typedef and 'itf<proto1,proto2>' where 'itf' is an
     // Objective-C interface.  If we don't have Objective-C or a '<', this is
     // Objective-C interface.  If we don't have Objective-C or a '<', this is
     // just a normal reference to a typedef name.
     // just a normal reference to a typedef name.
-    if (Tok.is(tok::less) && getLang().ObjC1)
+    if (Tok.is(tok::less) && getLangOpts().ObjC1)
       ParseObjCProtocolQualifiers(DS);
       ParseObjCProtocolQualifiers(DS);
     
     
     return true;
     return true;
@@ -2583,15 +2583,15 @@ bool Parser::ParseOptionalTypeSpecifier(DeclSpec &DS, bool& isInvalid,
   // cv-qualifier:
   // cv-qualifier:
   case tok::kw_const:
   case tok::kw_const:
     isInvalid = DS.SetTypeQual(DeclSpec::TQ_const   , Loc, PrevSpec,
     isInvalid = DS.SetTypeQual(DeclSpec::TQ_const   , Loc, PrevSpec,
-                               DiagID, getLang());
+                               DiagID, getLangOpts());
     break;
     break;
   case tok::kw_volatile:
   case tok::kw_volatile:
     isInvalid = DS.SetTypeQual(DeclSpec::TQ_volatile, Loc, PrevSpec,
     isInvalid = DS.SetTypeQual(DeclSpec::TQ_volatile, Loc, PrevSpec,
-                               DiagID, getLang());
+                               DiagID, getLangOpts());
     break;
     break;
   case tok::kw_restrict:
   case tok::kw_restrict:
     isInvalid = DS.SetTypeQual(DeclSpec::TQ_restrict, Loc, PrevSpec,
     isInvalid = DS.SetTypeQual(DeclSpec::TQ_restrict, Loc, PrevSpec,
-                               DiagID, getLang());
+                               DiagID, getLangOpts());
     break;
     break;
 
 
   // GNU typeof support.
   // GNU typeof support.
@@ -2615,7 +2615,7 @@ bool Parser::ParseOptionalTypeSpecifier(DeclSpec &DS, bool& isInvalid,
 
 
   // OpenCL qualifiers:
   // OpenCL qualifiers:
   case tok::kw_private: 
   case tok::kw_private: 
-    if (!getLang().OpenCL)
+    if (!getLangOpts().OpenCL)
       return false;
       return false;
   case tok::kw___private:
   case tok::kw___private:
   case tok::kw___global:
   case tok::kw___global:
@@ -2633,7 +2633,7 @@ bool Parser::ParseOptionalTypeSpecifier(DeclSpec &DS, bool& isInvalid,
     // illegal, so we can assume an auto type specifier was intended even in
     // illegal, so we can assume an auto type specifier was intended even in
     // C++98. In C++98 mode, DeclSpec::Finish will produce an appropriate
     // C++98. In C++98 mode, DeclSpec::Finish will produce an appropriate
     // extension diagnostic.
     // extension diagnostic.
-    if (!getLang().CPlusPlus)
+    if (!getLangOpts().CPlusPlus)
       return false;
       return false;
 
 
     isInvalid = DS.SetTypeSpecType(DeclSpec::TST_auto, Loc, PrevSpec, DiagID);
     isInvalid = DS.SetTypeSpecType(DeclSpec::TST_auto, Loc, PrevSpec, DiagID);
@@ -2779,7 +2779,7 @@ void Parser::ParseStructUnionBody(SourceLocation RecordLoc,
 
 
   // Empty structs are an extension in C (C99 6.7.2.1p7), but are allowed in
   // Empty structs are an extension in C (C99 6.7.2.1p7), but are allowed in
   // C++.
   // C++.
-  if (Tok.is(tok::r_brace) && !getLang().CPlusPlus) {
+  if (Tok.is(tok::r_brace) && !getLangOpts().CPlusPlus) {
     Diag(Tok, diag::ext_empty_struct_union) << (TagType == TST_union);
     Diag(Tok, diag::ext_empty_struct_union) << (TagType == TST_union);
     Diag(Tok, diag::warn_empty_struct_union_compat) << (TagType == TST_union);
     Diag(Tok, diag::warn_empty_struct_union_compat) << (TagType == TST_union);
   }
   }
@@ -2916,7 +2916,7 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS,
   SourceLocation ScopedEnumKWLoc;
   SourceLocation ScopedEnumKWLoc;
   bool IsScopedUsingClassTag = false;
   bool IsScopedUsingClassTag = false;
 
 
-  if (getLang().CPlusPlus0x &&
+  if (getLangOpts().CPlusPlus0x &&
       (Tok.is(tok::kw_class) || Tok.is(tok::kw_struct))) {
       (Tok.is(tok::kw_class) || Tok.is(tok::kw_struct))) {
     Diag(Tok, diag::warn_cxx98_compat_scoped_enum);
     Diag(Tok, diag::warn_cxx98_compat_scoped_enum);
     IsScopedUsingClassTag = Tok.is(tok::kw_class);
     IsScopedUsingClassTag = Tok.is(tok::kw_class);
@@ -2932,10 +2932,10 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS,
     ParseMicrosoftDeclSpec(attrs);
     ParseMicrosoftDeclSpec(attrs);
 
 
   bool AllowFixedUnderlyingType 
   bool AllowFixedUnderlyingType 
-    = getLang().CPlusPlus0x || getLang().MicrosoftExt || getLang().ObjC2;
+    = getLangOpts().CPlusPlus0x || getLangOpts().MicrosoftExt || getLangOpts().ObjC2;
 
 
   CXXScopeSpec &SS = DS.getTypeSpecScope();
   CXXScopeSpec &SS = DS.getTypeSpecScope();
-  if (getLang().CPlusPlus) {
+  if (getLangOpts().CPlusPlus) {
     // "enum foo : bar;" is not a potential typo for "enum foo::bar;"
     // "enum foo : bar;" is not a potential typo for "enum foo::bar;"
     // if a fixed underlying type is allowed.
     // if a fixed underlying type is allowed.
     ColonProtectionRAIIObject X(*this, AllowFixedUnderlyingType);
     ColonProtectionRAIIObject X(*this, AllowFixedUnderlyingType);
@@ -3022,9 +3022,9 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS,
         // underlying type.
         // underlying type.
         // FIXME: The standard is not entirely clear on how to disambiguate in
         // FIXME: The standard is not entirely clear on how to disambiguate in
         // this case.
         // this case.
-        if ((getLang().CPlusPlus &&
+        if ((getLangOpts().CPlusPlus &&
              isCXXDeclarationSpecifier(TPResult::True()) != TPResult::True()) ||
              isCXXDeclarationSpecifier(TPResult::True()) != TPResult::True()) ||
-            (!getLang().CPlusPlus && !isDeclarationSpecifier(true))) {
+            (!getLangOpts().CPlusPlus && !isDeclarationSpecifier(true))) {
           // We'll parse this as a bitfield later.
           // We'll parse this as a bitfield later.
           PossibleBitfield = true;
           PossibleBitfield = true;
           TPA.Revert();
           TPA.Revert();
@@ -3042,10 +3042,10 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS,
       SourceRange Range;
       SourceRange Range;
       BaseType = ParseTypeName(&Range);
       BaseType = ParseTypeName(&Range);
       
       
-      if (!getLang().CPlusPlus0x && !getLang().ObjC2)
+      if (!getLangOpts().CPlusPlus0x && !getLangOpts().ObjC2)
         Diag(StartLoc, diag::ext_ms_enum_fixed_underlying_type)
         Diag(StartLoc, diag::ext_ms_enum_fixed_underlying_type)
           << Range;
           << Range;
-      if (getLang().CPlusPlus0x)
+      if (getLangOpts().CPlusPlus0x)
         Diag(StartLoc, diag::warn_cxx98_compat_enum_fixed_underlying_type);
         Diag(StartLoc, diag::warn_cxx98_compat_enum_fixed_underlying_type);
     }
     }
   }
   }
@@ -3169,7 +3169,7 @@ void Parser::ParseEnumBody(SourceLocation StartLoc, Decl *EnumDecl) {
   T.consumeOpen();
   T.consumeOpen();
 
 
   // C does not allow an empty enumerator-list, C++ does [dcl.enum].
   // C does not allow an empty enumerator-list, C++ does [dcl.enum].
-  if (Tok.is(tok::r_brace) && !getLang().CPlusPlus)
+  if (Tok.is(tok::r_brace) && !getLangOpts().CPlusPlus)
     Diag(Tok, diag::error_empty_enum);
     Diag(Tok, diag::error_empty_enum);
 
 
   SmallVector<Decl *, 32> EnumConstantDecls;
   SmallVector<Decl *, 32> EnumConstantDecls;
@@ -3220,11 +3220,11 @@ void Parser::ParseEnumBody(SourceLocation StartLoc, Decl *EnumDecl) {
     SourceLocation CommaLoc = ConsumeToken();
     SourceLocation CommaLoc = ConsumeToken();
 
 
     if (Tok.isNot(tok::identifier)) {
     if (Tok.isNot(tok::identifier)) {
-      if (!getLang().C99 && !getLang().CPlusPlus0x)
+      if (!getLangOpts().C99 && !getLangOpts().CPlusPlus0x)
         Diag(CommaLoc, diag::ext_enumerator_list_comma)
         Diag(CommaLoc, diag::ext_enumerator_list_comma)
-          << getLang().CPlusPlus
+          << getLangOpts().CPlusPlus
           << FixItHint::CreateRemoval(CommaLoc);
           << FixItHint::CreateRemoval(CommaLoc);
-      else if (getLang().CPlusPlus0x)
+      else if (getLangOpts().CPlusPlus0x)
         Diag(CommaLoc, diag::warn_cxx98_compat_enumerator_list_comma)
         Diag(CommaLoc, diag::warn_cxx98_compat_enumerator_list_comma)
           << FixItHint::CreateRemoval(CommaLoc);
           << FixItHint::CreateRemoval(CommaLoc);
     }
     }
@@ -3255,7 +3255,7 @@ bool Parser::isTypeQualifier() const {
 
 
     // type-qualifier only in OpenCL
     // type-qualifier only in OpenCL
   case tok::kw_private:
   case tok::kw_private:
-    return getLang().OpenCL;
+    return getLangOpts().OpenCL;
 
 
     // type-qualifier
     // type-qualifier
   case tok::kw_const:
   case tok::kw_const:
@@ -3390,7 +3390,7 @@ bool Parser::isTypeSpecifierQualifier() {
 
 
     // GNU ObjC bizarre protocol extension: <proto1,proto2> with implicit 'id'.
     // GNU ObjC bizarre protocol extension: <proto1,proto2> with implicit 'id'.
   case tok::less:
   case tok::less:
-    return getLang().ObjC1;
+    return getLangOpts().ObjC1;
 
 
   case tok::kw___cdecl:
   case tok::kw___cdecl:
   case tok::kw___stdcall:
   case tok::kw___stdcall:
@@ -3413,7 +3413,7 @@ bool Parser::isTypeSpecifierQualifier() {
     return true;
     return true;
 
 
   case tok::kw_private:
   case tok::kw_private:
-    return getLang().OpenCL;
+    return getLangOpts().OpenCL;
 
 
   // C11 _Atomic()
   // C11 _Atomic()
   case tok::kw__Atomic:
   case tok::kw__Atomic:
@@ -3431,11 +3431,11 @@ bool Parser::isDeclarationSpecifier(bool DisambiguatingWithExpression) {
   default: return false;
   default: return false;
 
 
   case tok::kw_private:
   case tok::kw_private:
-    return getLang().OpenCL;
+    return getLangOpts().OpenCL;
 
 
   case tok::identifier:   // foo::bar
   case tok::identifier:   // foo::bar
     // Unfortunate hack to support "Class.factoryMethod" notation.
     // Unfortunate hack to support "Class.factoryMethod" notation.
-    if (getLang().ObjC1 && NextToken().is(tok::period))
+    if (getLangOpts().ObjC1 && NextToken().is(tok::period))
       return false;
       return false;
     if (TryAltiVecVectorToken())
     if (TryAltiVecVectorToken())
       return true;
       return true;
@@ -3545,7 +3545,7 @@ bool Parser::isDeclarationSpecifier(bool DisambiguatingWithExpression) {
 
 
     // GNU ObjC bizarre protocol extension: <proto1,proto2> with implicit 'id'.
     // GNU ObjC bizarre protocol extension: <proto1,proto2> with implicit 'id'.
   case tok::less:
   case tok::less:
-    return getLang().ObjC1;
+    return getLangOpts().ObjC1;
 
 
     // typedef-name
     // typedef-name
   case tok::annot_typename:
   case tok::annot_typename:
@@ -3642,7 +3642,7 @@ bool Parser::isConstructorDeclarator() {
 void Parser::ParseTypeQualifierListOpt(DeclSpec &DS,
 void Parser::ParseTypeQualifierListOpt(DeclSpec &DS,
                                        bool VendorAttributesAllowed,
                                        bool VendorAttributesAllowed,
                                        bool CXX0XAttributesAllowed) {
                                        bool CXX0XAttributesAllowed) {
-  if (getLang().CPlusPlus0x && isCXX0XAttributeSpecifier()) {
+  if (getLangOpts().CPlusPlus0x && isCXX0XAttributeSpecifier()) {
     SourceLocation Loc = Tok.getLocation();
     SourceLocation Loc = Tok.getLocation();
     ParsedAttributesWithRange attrs(AttrFactory);
     ParsedAttributesWithRange attrs(AttrFactory);
     ParseCXX0XAttributes(attrs);
     ParseCXX0XAttributes(attrs);
@@ -3667,20 +3667,20 @@ void Parser::ParseTypeQualifierListOpt(DeclSpec &DS,
         
         
     case tok::kw_const:
     case tok::kw_const:
       isInvalid = DS.SetTypeQual(DeclSpec::TQ_const   , Loc, PrevSpec, DiagID,
       isInvalid = DS.SetTypeQual(DeclSpec::TQ_const   , Loc, PrevSpec, DiagID,
-                                 getLang());
+                                 getLangOpts());
       break;
       break;
     case tok::kw_volatile:
     case tok::kw_volatile:
       isInvalid = DS.SetTypeQual(DeclSpec::TQ_volatile, Loc, PrevSpec, DiagID,
       isInvalid = DS.SetTypeQual(DeclSpec::TQ_volatile, Loc, PrevSpec, DiagID,
-                                 getLang());
+                                 getLangOpts());
       break;
       break;
     case tok::kw_restrict:
     case tok::kw_restrict:
       isInvalid = DS.SetTypeQual(DeclSpec::TQ_restrict, Loc, PrevSpec, DiagID,
       isInvalid = DS.SetTypeQual(DeclSpec::TQ_restrict, Loc, PrevSpec, DiagID,
-                                 getLang());
+                                 getLangOpts());
       break;
       break;
 
 
     // OpenCL qualifiers:
     // OpenCL qualifiers:
     case tok::kw_private: 
     case tok::kw_private: 
-      if (!getLang().OpenCL)
+      if (!getLangOpts().OpenCL)
         goto DoneWithTypeQuals;
         goto DoneWithTypeQuals;
     case tok::kw___private:
     case tok::kw___private:
     case tok::kw___global:
     case tok::kw___global:
@@ -3777,7 +3777,7 @@ void Parser::ParseDeclaratorInternal(Declarator &D,
   // C++ member pointers start with a '::' or a nested-name.
   // C++ member pointers start with a '::' or a nested-name.
   // Member pointers get special handling, since there's no place for the
   // Member pointers get special handling, since there's no place for the
   // scope spec in the generic path below.
   // scope spec in the generic path below.
-  if (getLang().CPlusPlus &&
+  if (getLangOpts().CPlusPlus &&
       (Tok.is(tok::coloncolon) || Tok.is(tok::identifier) ||
       (Tok.is(tok::coloncolon) || Tok.is(tok::identifier) ||
        Tok.is(tok::annot_cxxscope))) {
        Tok.is(tok::annot_cxxscope))) {
     bool EnteringContext = D.getContext() == Declarator::FileContext ||
     bool EnteringContext = D.getContext() == Declarator::FileContext ||
@@ -3816,9 +3816,9 @@ void Parser::ParseDeclaratorInternal(Declarator &D,
   tok::TokenKind Kind = Tok.getKind();
   tok::TokenKind Kind = Tok.getKind();
   // Not a pointer, C++ reference, or block.
   // Not a pointer, C++ reference, or block.
   if (Kind != tok::star && Kind != tok::caret &&
   if (Kind != tok::star && Kind != tok::caret &&
-      (Kind != tok::amp || !getLang().CPlusPlus) &&
+      (Kind != tok::amp || !getLangOpts().CPlusPlus) &&
       // We parse rvalue refs in C++03, because otherwise the errors are scary.
       // We parse rvalue refs in C++03, because otherwise the errors are scary.
-      (Kind != tok::ampamp || !getLang().CPlusPlus)) {
+      (Kind != tok::ampamp || !getLangOpts().CPlusPlus)) {
     if (DirectDeclParser)
     if (DirectDeclParser)
       (this->*DirectDeclParser)(D);
       (this->*DirectDeclParser)(D);
     return;
     return;
@@ -3859,7 +3859,7 @@ void Parser::ParseDeclaratorInternal(Declarator &D,
     // Complain about rvalue references in C++03, but then go on and build
     // Complain about rvalue references in C++03, but then go on and build
     // the declarator.
     // the declarator.
     if (Kind == tok::ampamp)
     if (Kind == tok::ampamp)
-      Diag(Loc, getLang().CPlusPlus0x ?
+      Diag(Loc, getLangOpts().CPlusPlus0x ?
            diag::warn_cxx98_compat_rvalue_reference :
            diag::warn_cxx98_compat_rvalue_reference :
            diag::ext_rvalue_reference);
            diag::ext_rvalue_reference);
 
 
@@ -3946,7 +3946,7 @@ void Parser::ParseDeclaratorInternal(Declarator &D,
 void Parser::ParseDirectDeclarator(Declarator &D) {
 void Parser::ParseDirectDeclarator(Declarator &D) {
   DeclaratorScopeObj DeclScopeObj(*this, D.getCXXScopeSpec());
   DeclaratorScopeObj DeclScopeObj(*this, D.getCXXScopeSpec());
 
 
-  if (getLang().CPlusPlus && D.mayHaveIdentifier()) {
+  if (getLangOpts().CPlusPlus && D.mayHaveIdentifier()) {
     // ParseDeclaratorInternal might already have parsed the scope.
     // ParseDeclaratorInternal might already have parsed the scope.
     if (D.getCXXScopeSpec().isEmpty()) {
     if (D.getCXXScopeSpec().isEmpty()) {
       bool EnteringContext = D.getContext() == Declarator::FileContext ||
       bool EnteringContext = D.getContext() == Declarator::FileContext ||
@@ -4013,7 +4013,7 @@ void Parser::ParseDirectDeclarator(Declarator &D) {
       goto PastIdentifier;
       goto PastIdentifier;
     }
     }
   } else if (Tok.is(tok::identifier) && D.mayHaveIdentifier()) {
   } else if (Tok.is(tok::identifier) && D.mayHaveIdentifier()) {
-    assert(!getLang().CPlusPlus &&
+    assert(!getLangOpts().CPlusPlus &&
            "There's a C++-specific check for tok::identifier above");
            "There's a C++-specific check for tok::identifier above");
     assert(Tok.getIdentifierInfo() && "Not an identifier?");
     assert(Tok.getIdentifierInfo() && "Not an identifier?");
     D.SetIdentifier(Tok.getIdentifierInfo(), Tok.getLocation());
     D.SetIdentifier(Tok.getIdentifierInfo(), Tok.getLocation());
@@ -4047,8 +4047,8 @@ void Parser::ParseDirectDeclarator(Declarator &D) {
     if (D.getContext() == Declarator::MemberContext)
     if (D.getContext() == Declarator::MemberContext)
       Diag(Tok, diag::err_expected_member_name_or_semi)
       Diag(Tok, diag::err_expected_member_name_or_semi)
         << D.getDeclSpec().getSourceRange();
         << D.getDeclSpec().getSourceRange();
-    else if (getLang().CPlusPlus)
-      Diag(Tok, diag::err_expected_unqualified_id) << getLang().CPlusPlus;
+    else if (getLangOpts().CPlusPlus)
+      Diag(Tok, diag::err_expected_unqualified_id) << getLangOpts().CPlusPlus;
     else
     else
       Diag(Tok, diag::err_expected_ident_lparen);
       Diag(Tok, diag::err_expected_ident_lparen);
     D.SetIdentifier(0, Tok.getLocation());
     D.SetIdentifier(0, Tok.getLocation());
@@ -4072,7 +4072,7 @@ void Parser::ParseDirectDeclarator(Declarator &D) {
       // The paren may be part of a C++ direct initializer, eg. "int x(1);".
       // The paren may be part of a C++ direct initializer, eg. "int x(1);".
       // In such a case, check if we actually have a function declarator; if it
       // In such a case, check if we actually have a function declarator; if it
       // is not, the declarator has been fully parsed.
       // is not, the declarator has been fully parsed.
-      if (getLang().CPlusPlus && D.mayBeFollowedByCXXDirectInit()) {
+      if (getLangOpts().CPlusPlus && D.mayBeFollowedByCXXDirectInit()) {
         // When not in file scope, warn for ambiguous function declarators, just
         // When not in file scope, warn for ambiguous function declarators, just
         // in case the author intended it as a variable definition.
         // in case the author intended it as a variable definition.
         bool warnIfAmbiguous = D.getContext() != Declarator::FileContext;
         bool warnIfAmbiguous = D.getContext() != Declarator::FileContext;
@@ -4152,7 +4152,7 @@ void Parser::ParseParenDeclarator(Declarator &D) {
     // paren, because we haven't seen the identifier yet.
     // paren, because we haven't seen the identifier yet.
     isGrouping = true;
     isGrouping = true;
   } else if (Tok.is(tok::r_paren) ||           // 'int()' is a function.
   } else if (Tok.is(tok::r_paren) ||           // 'int()' is a function.
-             (getLang().CPlusPlus && Tok.is(tok::ellipsis)) || // C++ int(...)
+             (getLangOpts().CPlusPlus && Tok.is(tok::ellipsis)) || // C++ int(...)
              isDeclarationSpecifier()) {       // 'int(int)' is a function.
              isDeclarationSpecifier()) {       // 'int(int)' is a function.
     // This handles C99 6.7.5.3p11: in "typedef int X; void foo(X)", X is
     // This handles C99 6.7.5.3p11: in "typedef int X; void foo(X)", X is
     // considered to be a type, not a K&R identifier-list.
     // considered to be a type, not a K&R identifier-list.
@@ -4258,13 +4258,13 @@ void Parser::ParseFunctionDeclarator(Declarator &D,
     else if (RequiresArg)
     else if (RequiresArg)
       Diag(Tok, diag::err_argument_required_after_attribute);
       Diag(Tok, diag::err_argument_required_after_attribute);
 
 
-    HasProto = ParamInfo.size() || getLang().CPlusPlus;
+    HasProto = ParamInfo.size() || getLangOpts().CPlusPlus;
 
 
     // If we have the closing ')', eat it.
     // If we have the closing ')', eat it.
     Tracker.consumeClose();
     Tracker.consumeClose();
     EndLoc = Tracker.getCloseLocation();
     EndLoc = Tracker.getCloseLocation();
 
 
-    if (getLang().CPlusPlus) {
+    if (getLangOpts().CPlusPlus) {
       MaybeParseCXX0XAttributes(attrs);
       MaybeParseCXX0XAttributes(attrs);
 
 
       // Parse cv-qualifier-seq[opt].
       // Parse cv-qualifier-seq[opt].
@@ -4277,7 +4277,7 @@ void Parser::ParseFunctionDeclarator(Declarator &D,
 
 
       // Parse ref-qualifier[opt].
       // Parse ref-qualifier[opt].
       if (Tok.is(tok::amp) || Tok.is(tok::ampamp)) {
       if (Tok.is(tok::amp) || Tok.is(tok::ampamp)) {
-        Diag(Tok, getLang().CPlusPlus0x ?
+        Diag(Tok, getLangOpts().CPlusPlus0x ?
              diag::warn_cxx98_compat_ref_qualifier :
              diag::warn_cxx98_compat_ref_qualifier :
              diag::ext_ref_qualifier);
              diag::ext_ref_qualifier);
         
         
@@ -4295,7 +4295,7 @@ void Parser::ParseFunctionDeclarator(Declarator &D,
         EndLoc = ESpecRange.getEnd();
         EndLoc = ESpecRange.getEnd();
 
 
       // Parse trailing-return-type[opt].
       // Parse trailing-return-type[opt].
-      if (getLang().CPlusPlus0x && Tok.is(tok::arrow)) {
+      if (getLangOpts().CPlusPlus0x && Tok.is(tok::arrow)) {
         Diag(Tok, diag::warn_cxx98_compat_trailing_return_type);
         Diag(Tok, diag::warn_cxx98_compat_trailing_return_type);
         SourceRange Range;
         SourceRange Range;
         TrailingReturnType = ParseTrailingReturnType(Range).get();
         TrailingReturnType = ParseTrailingReturnType(Range).get();
@@ -4335,7 +4335,7 @@ void Parser::ParseFunctionDeclarator(Declarator &D,
 /// Note that identifier-lists are only allowed for normal declarators, not for
 /// Note that identifier-lists are only allowed for normal declarators, not for
 /// abstract-declarators.
 /// abstract-declarators.
 bool Parser::isFunctionDeclaratorIdentifierList() {
 bool Parser::isFunctionDeclaratorIdentifierList() {
-  return !getLang().CPlusPlus
+  return !getLangOpts().CPlusPlus
          && Tok.is(tok::identifier)
          && Tok.is(tok::identifier)
          && !TryAltiVecVectorToken()
          && !TryAltiVecVectorToken()
          // K&R identifier lists can't have typedefs as identifiers, per C99
          // K&R identifier lists can't have typedefs as identifiers, per C99
@@ -4460,7 +4460,7 @@ void Parser::ParseParameterDeclarationClause(
     DeclSpec DS(AttrFactory);
     DeclSpec DS(AttrFactory);
 
 
     // Skip any Microsoft attributes before a param.
     // Skip any Microsoft attributes before a param.
-    if (getLang().MicrosoftExt && Tok.is(tok::l_square))
+    if (getLangOpts().MicrosoftExt && Tok.is(tok::l_square))
       ParseMicrosoftAttributes(DS.getAttributes());
       ParseMicrosoftAttributes(DS.getAttributes());
 
 
     SourceLocation DSStart = Tok.getLocation();
     SourceLocation DSStart = Tok.getLocation();
@@ -4570,7 +4570,7 @@ void Parser::ParseParameterDeclarationClause(
       if (Tok.is(tok::ellipsis)) {
       if (Tok.is(tok::ellipsis)) {
         EllipsisLoc = ConsumeToken();     // Consume the ellipsis.
         EllipsisLoc = ConsumeToken();     // Consume the ellipsis.
         
         
-        if (!getLang().CPlusPlus) {
+        if (!getLangOpts().CPlusPlus) {
           // We have ellipsis without a preceding ',', which is ill-formed
           // We have ellipsis without a preceding ',', which is ill-formed
           // in C. Complain and provide the fix.
           // in C. Complain and provide the fix.
           Diag(EllipsisLoc, diag::err_missing_comma_before_ellipsis)
           Diag(EllipsisLoc, diag::err_missing_comma_before_ellipsis)
@@ -4668,7 +4668,7 @@ void Parser::ParseBracketDeclarator(Declarator &D) {
 
 
     // Parse the constant-expression or assignment-expression now (depending
     // Parse the constant-expression or assignment-expression now (depending
     // on dialect).
     // on dialect).
-    if (getLang().CPlusPlus) {
+    if (getLangOpts().CPlusPlus) {
       NumElements = ParseConstantExpression();
       NumElements = ParseConstantExpression();
     } else {
     } else {
       EnterExpressionEvaluationContext Unevaluated(Actions,
       EnterExpressionEvaluationContext Unevaluated(Actions,

+ 22 - 22
lib/Parse/ParseDeclCXX.cpp

@@ -150,7 +150,7 @@ Decl *Parser::ParseNamespace(unsigned Context,
 
 
   // If we're still good, complain about inline namespaces in non-C++0x now.
   // If we're still good, complain about inline namespaces in non-C++0x now.
   if (InlineLoc.isValid())
   if (InlineLoc.isValid())
-    Diag(InlineLoc, getLang().CPlusPlus0x ?
+    Diag(InlineLoc, getLangOpts().CPlusPlus0x ?
          diag::warn_cxx98_compat_inline_namespace : diag::ext_inline_namespace);
          diag::warn_cxx98_compat_inline_namespace : diag::ext_inline_namespace);
 
 
   // Enter a scope for the namespace.
   // Enter a scope for the namespace.
@@ -490,7 +490,7 @@ Decl *Parser::ParseUsingDeclaration(unsigned Context,
     // Where can GNU attributes appear?
     // Where can GNU attributes appear?
     ConsumeToken();
     ConsumeToken();
 
 
-    Diag(Tok.getLocation(), getLang().CPlusPlus0x ?
+    Diag(Tok.getLocation(), getLangOpts().CPlusPlus0x ?
          diag::warn_cxx98_compat_alias_declaration :
          diag::warn_cxx98_compat_alias_declaration :
          diag::ext_alias_declaration);
          diag::ext_alias_declaration);
 
 
@@ -593,7 +593,7 @@ Decl *Parser::ParseStaticAssertDeclaration(SourceLocation &DeclEnd){
   assert((Tok.is(tok::kw_static_assert) || Tok.is(tok::kw__Static_assert)) &&
   assert((Tok.is(tok::kw_static_assert) || Tok.is(tok::kw__Static_assert)) &&
          "Not a static_assert declaration");
          "Not a static_assert declaration");
 
 
-  if (Tok.is(tok::kw__Static_assert) && !getLang().C11)
+  if (Tok.is(tok::kw__Static_assert) && !getLangOpts().C11)
     Diag(Tok, diag::ext_c11_static_assert);
     Diag(Tok, diag::ext_c11_static_assert);
   if (Tok.is(tok::kw_static_assert))
   if (Tok.is(tok::kw_static_assert))
     Diag(Tok, diag::warn_cxx98_compat_static_assert);
     Diag(Tok, diag::warn_cxx98_compat_static_assert);
@@ -1020,7 +1020,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
 
 
   // Parse the (optional) nested-name-specifier.
   // Parse the (optional) nested-name-specifier.
   CXXScopeSpec &SS = DS.getTypeSpecScope();
   CXXScopeSpec &SS = DS.getTypeSpecScope();
-  if (getLang().CPlusPlus) {
+  if (getLangOpts().CPlusPlus) {
     // "FOO : BAR" is not a potential typo for "FOO::BAR".
     // "FOO : BAR" is not a potential typo for "FOO::BAR".
     ColonProtectionRAIIObject X(*this);
     ColonProtectionRAIIObject X(*this);
 
 
@@ -1041,7 +1041,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
     Name = Tok.getIdentifierInfo();
     Name = Tok.getIdentifierInfo();
     NameLoc = ConsumeToken();
     NameLoc = ConsumeToken();
 
 
-    if (Tok.is(tok::less) && getLang().CPlusPlus) {
+    if (Tok.is(tok::less) && getLangOpts().CPlusPlus) {
       // The name was supposed to refer to a template, but didn't.
       // The name was supposed to refer to a template, but didn't.
       // Eat the template argument list and try to continue parsing this as
       // Eat the template argument list and try to continue parsing this as
       // a class (or template thereof).
       // a class (or template thereof).
@@ -1130,7 +1130,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
   if (SuppressDeclarations)
   if (SuppressDeclarations)
     TUK = Sema::TUK_Reference;
     TUK = Sema::TUK_Reference;
   else if (Tok.is(tok::l_brace) || 
   else if (Tok.is(tok::l_brace) || 
-           (getLang().CPlusPlus && Tok.is(tok::colon)) ||
+           (getLangOpts().CPlusPlus && Tok.is(tok::colon)) ||
            isCXX0XFinalKeyword()) {
            isCXX0XFinalKeyword()) {
     if (DS.isFriendSpecified()) {
     if (DS.isFriendSpecified()) {
       // C++ [class.friend]p2:
       // C++ [class.friend]p2:
@@ -1313,9 +1313,9 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
   // If there is a body, parse it and inform the actions module.
   // If there is a body, parse it and inform the actions module.
   if (TUK == Sema::TUK_Definition) {
   if (TUK == Sema::TUK_Definition) {
     assert(Tok.is(tok::l_brace) ||
     assert(Tok.is(tok::l_brace) ||
-           (getLang().CPlusPlus && Tok.is(tok::colon)) ||
+           (getLangOpts().CPlusPlus && Tok.is(tok::colon)) ||
            isCXX0XFinalKeyword());
            isCXX0XFinalKeyword());
-    if (getLang().CPlusPlus)
+    if (getLangOpts().CPlusPlus)
       ParseCXXMemberSpecification(StartLoc, TagType, TagOrTempResult.get());
       ParseCXXMemberSpecification(StartLoc, TagType, TagOrTempResult.get());
     else
     else
       ParseStructUnionBody(StartLoc, TagType, TagOrTempResult.get());
       ParseStructUnionBody(StartLoc, TagType, TagOrTempResult.get());
@@ -1397,7 +1397,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind,
 
 
     case tok::r_brace:  // struct bar { struct foo {...} }
     case tok::r_brace:  // struct bar { struct foo {...} }
       // Missing ';' at end of struct is accepted as an extension in C mode.
       // Missing ';' at end of struct is accepted as an extension in C mode.
-      if (!getLang().CPlusPlus)
+      if (!getLangOpts().CPlusPlus)
         ExpectedSemi = false;
         ExpectedSemi = false;
       break;
       break;
     }
     }
@@ -1576,7 +1576,7 @@ void Parser::HandleMemberFunctionDefaultArgs(Declarator& DeclaratorInfo,
 ///         override
 ///         override
 ///         final
 ///         final
 VirtSpecifiers::Specifier Parser::isCXX0XVirtSpecifier(const Token &Tok) const {
 VirtSpecifiers::Specifier Parser::isCXX0XVirtSpecifier(const Token &Tok) const {
-  if (!getLang().CPlusPlus)
+  if (!getLangOpts().CPlusPlus)
     return VirtSpecifiers::VS_None;
     return VirtSpecifiers::VS_None;
 
 
   if (Tok.is(tok::identifier)) {
   if (Tok.is(tok::identifier)) {
@@ -1617,7 +1617,7 @@ void Parser::ParseOptionalCXX0XVirtSpecifierSeq(VirtSpecifiers &VS) {
         << PrevSpec
         << PrevSpec
         << FixItHint::CreateRemoval(Tok.getLocation());
         << FixItHint::CreateRemoval(Tok.getLocation());
 
 
-    Diag(Tok.getLocation(), getLang().CPlusPlus0x ?
+    Diag(Tok.getLocation(), getLangOpts().CPlusPlus0x ?
          diag::warn_cxx98_compat_override_control_keyword :
          diag::warn_cxx98_compat_override_control_keyword :
          diag::ext_override_control_keyword)
          diag::ext_override_control_keyword)
       << VirtSpecifiers::getSpecifierName(Specifier);
       << VirtSpecifiers::getSpecifierName(Specifier);
@@ -1628,7 +1628,7 @@ void Parser::ParseOptionalCXX0XVirtSpecifierSeq(VirtSpecifiers &VS) {
 /// isCXX0XFinalKeyword - Determine whether the next token is a C++0x
 /// isCXX0XFinalKeyword - Determine whether the next token is a C++0x
 /// contextual 'final' keyword.
 /// contextual 'final' keyword.
 bool Parser::isCXX0XFinalKeyword() const {
 bool Parser::isCXX0XFinalKeyword() const {
-  if (!getLang().CPlusPlus)
+  if (!getLangOpts().CPlusPlus)
     return false;
     return false;
 
 
   if (!Tok.is(tok::identifier))
   if (!Tok.is(tok::identifier))
@@ -1683,7 +1683,7 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
                                        const ParsedTemplateInfo &TemplateInfo,
                                        const ParsedTemplateInfo &TemplateInfo,
                                        ParsingDeclRAIIObject *TemplateDiags) {
                                        ParsingDeclRAIIObject *TemplateDiags) {
   if (Tok.is(tok::at)) {
   if (Tok.is(tok::at)) {
-    if (getLang().ObjC1 && NextToken().isObjCAtKeyword(tok::objc_defs))
+    if (getLangOpts().ObjC1 && NextToken().isObjCAtKeyword(tok::objc_defs))
       Diag(Tok, diag::err_at_defs_cxx);
       Diag(Tok, diag::err_at_defs_cxx);
     else
     else
       Diag(Tok, diag::err_at_in_class);
       Diag(Tok, diag::err_at_in_class);
@@ -1842,7 +1842,7 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
 
 
     // MSVC permits pure specifier on inline functions declared at class scope.
     // MSVC permits pure specifier on inline functions declared at class scope.
     // Hence check for =0 before checking for function definition.
     // Hence check for =0 before checking for function definition.
-    if (getLang().MicrosoftExt && Tok.is(tok::equal) &&
+    if (getLangOpts().MicrosoftExt && Tok.is(tok::equal) &&
         DeclaratorInfo.isFunctionDeclarator() && 
         DeclaratorInfo.isFunctionDeclarator() && 
         NextToken().is(tok::numeric_constant)) {
         NextToken().is(tok::numeric_constant)) {
       EqualLoc = ConsumeToken();
       EqualLoc = ConsumeToken();
@@ -1859,7 +1859,7 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
     // In C++11, a non-function declarator followed by an open brace is a
     // In C++11, a non-function declarator followed by an open brace is a
     // braced-init-list for an in-class member initialization, not an
     // braced-init-list for an in-class member initialization, not an
     // erroneous function definition.
     // erroneous function definition.
-    if (Tok.is(tok::l_brace) && !getLang().CPlusPlus0x) {
+    if (Tok.is(tok::l_brace) && !getLangOpts().CPlusPlus0x) {
       DefinitionKind = FDK_Definition;
       DefinitionKind = FDK_Definition;
     } else if (DeclaratorInfo.isFunctionDeclarator()) {
     } else if (DeclaratorInfo.isFunctionDeclarator()) {
       if (Tok.is(tok::l_brace) || Tok.is(tok::colon) || Tok.is(tok::kw_try)) {
       if (Tok.is(tok::l_brace) || Tok.is(tok::colon) || Tok.is(tok::kw_try)) {
@@ -2006,7 +2006,7 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
     // Handle the initializer.
     // Handle the initializer.
     if (HasDeferredInitializer) {
     if (HasDeferredInitializer) {
       // The initializer was deferred; parse it and cache the tokens.
       // The initializer was deferred; parse it and cache the tokens.
-      Diag(Tok, getLang().CPlusPlus0x ?
+      Diag(Tok, getLangOpts().CPlusPlus0x ?
            diag::warn_cxx98_compat_nonstatic_member_init :
            diag::warn_cxx98_compat_nonstatic_member_init :
            diag::ext_nonstatic_member_init);
            diag::ext_nonstatic_member_init);
 
 
@@ -2212,11 +2212,11 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
   SourceLocation FinalLoc;
   SourceLocation FinalLoc;
 
 
   // Parse the optional 'final' keyword.
   // Parse the optional 'final' keyword.
-  if (getLang().CPlusPlus && Tok.is(tok::identifier)) {
+  if (getLangOpts().CPlusPlus && Tok.is(tok::identifier)) {
     assert(isCXX0XFinalKeyword() && "not a class definition");
     assert(isCXX0XFinalKeyword() && "not a class definition");
     FinalLoc = ConsumeToken();
     FinalLoc = ConsumeToken();
 
 
-    Diag(FinalLoc, getLang().CPlusPlus0x ?
+    Diag(FinalLoc, getLangOpts().CPlusPlus0x ?
          diag::warn_cxx98_compat_override_control_keyword :
          diag::warn_cxx98_compat_override_control_keyword :
          diag::ext_override_control_keyword) << "final";
          diag::ext_override_control_keyword) << "final";
   }
   }
@@ -2256,7 +2256,7 @@ void Parser::ParseCXXMemberSpecification(SourceLocation RecordLoc,
     while (Tok.isNot(tok::r_brace) && Tok.isNot(tok::eof)) {
     while (Tok.isNot(tok::r_brace) && Tok.isNot(tok::eof)) {
       // Each iteration of this loop reads one member-declaration.
       // Each iteration of this loop reads one member-declaration.
 
 
-      if (getLang().MicrosoftExt && (Tok.is(tok::kw___if_exists) ||
+      if (getLangOpts().MicrosoftExt && (Tok.is(tok::kw___if_exists) ||
           Tok.is(tok::kw___if_not_exists))) {
           Tok.is(tok::kw___if_not_exists))) {
         ParseMicrosoftIfExistsClassDeclaration((DeclSpec::TST)TagType, CurAS);
         ParseMicrosoftIfExistsClassDeclaration((DeclSpec::TST)TagType, CurAS);
         continue;
         continue;
@@ -2483,7 +2483,7 @@ Parser::MemInitResult Parser::ParseMemInitializer(Decl *ConstructorDecl) {
 
 
 
 
   // Parse the '('.
   // Parse the '('.
-  if (getLang().CPlusPlus0x && Tok.is(tok::l_brace)) {
+  if (getLangOpts().CPlusPlus0x && Tok.is(tok::l_brace)) {
     Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists);
     Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists);
 
 
     ExprResult InitList = ParseBraceInitializer();
     ExprResult InitList = ParseBraceInitializer();
@@ -2522,7 +2522,7 @@ Parser::MemInitResult Parser::ParseMemInitializer(Decl *ConstructorDecl) {
                                        EllipsisLoc);
                                        EllipsisLoc);
   }
   }
 
 
-  Diag(Tok, getLang().CPlusPlus0x ? diag::err_expected_lparen_or_lbrace
+  Diag(Tok, getLangOpts().CPlusPlus0x ? diag::err_expected_lparen_or_lbrace
                                   : diag::err_expected_lparen);
                                   : diag::err_expected_lparen);
   return true;
   return true;
 }
 }
@@ -2630,7 +2630,7 @@ ExceptionSpecificationType Parser::ParseDynamicExceptionSpecification(
   // can throw anything".
   // can throw anything".
   if (Tok.is(tok::ellipsis)) {
   if (Tok.is(tok::ellipsis)) {
     SourceLocation EllipsisLoc = ConsumeToken();
     SourceLocation EllipsisLoc = ConsumeToken();
-    if (!getLang().MicrosoftExt)
+    if (!getLangOpts().MicrosoftExt)
       Diag(EllipsisLoc, diag::ext_ellipsis_exception_spec);
       Diag(EllipsisLoc, diag::ext_ellipsis_exception_spec);
     T.consumeClose();
     T.consumeClose();
     SpecificationRange.setEnd(T.getCloseLocation());
     SpecificationRange.setEnd(T.getCloseLocation());

+ 32 - 32
lib/Parse/ParseExpr.cpp

@@ -268,7 +268,7 @@ ExprResult
 Parser::ParseRHSOfBinaryExpression(ExprResult LHS, prec::Level MinPrec) {
 Parser::ParseRHSOfBinaryExpression(ExprResult LHS, prec::Level MinPrec) {
   prec::Level NextTokPrec = getBinOpPrecedence(Tok.getKind(),
   prec::Level NextTokPrec = getBinOpPrecedence(Tok.getKind(),
                                                GreaterThanIsOperator,
                                                GreaterThanIsOperator,
-                                               getLang().CPlusPlus0x);
+                                               getLangOpts().CPlusPlus0x);
   SourceLocation ColonLoc;
   SourceLocation ColonLoc;
 
 
   while (1) {
   while (1) {
@@ -358,10 +358,10 @@ Parser::ParseRHSOfBinaryExpression(ExprResult LHS, prec::Level MinPrec) {
     // they only appear on the RHS of assignments later.
     // they only appear on the RHS of assignments later.
     ExprResult RHS;
     ExprResult RHS;
     bool RHSIsInitList = false;
     bool RHSIsInitList = false;
-    if (getLang().CPlusPlus0x && Tok.is(tok::l_brace)) {
+    if (getLangOpts().CPlusPlus0x && Tok.is(tok::l_brace)) {
       RHS = ParseBraceInitializer();
       RHS = ParseBraceInitializer();
       RHSIsInitList = true;
       RHSIsInitList = true;
-    } else if (getLang().CPlusPlus && NextTokPrec <= prec::Conditional)
+    } else if (getLangOpts().CPlusPlus && NextTokPrec <= prec::Conditional)
       RHS = ParseAssignmentExpression();
       RHS = ParseAssignmentExpression();
     else
     else
       RHS = ParseCastExpression(false);
       RHS = ParseCastExpression(false);
@@ -373,7 +373,7 @@ Parser::ParseRHSOfBinaryExpression(ExprResult LHS, prec::Level MinPrec) {
     // operator immediately to the right of the RHS.
     // operator immediately to the right of the RHS.
     prec::Level ThisPrec = NextTokPrec;
     prec::Level ThisPrec = NextTokPrec;
     NextTokPrec = getBinOpPrecedence(Tok.getKind(), GreaterThanIsOperator,
     NextTokPrec = getBinOpPrecedence(Tok.getKind(), GreaterThanIsOperator,
-                                     getLang().CPlusPlus0x);
+                                     getLangOpts().CPlusPlus0x);
 
 
     // Assignment and conditional expressions are right-associative.
     // Assignment and conditional expressions are right-associative.
     bool isRightAssoc = ThisPrec == prec::Conditional ||
     bool isRightAssoc = ThisPrec == prec::Conditional ||
@@ -401,7 +401,7 @@ Parser::ParseRHSOfBinaryExpression(ExprResult LHS, prec::Level MinPrec) {
         LHS = ExprError();
         LHS = ExprError();
 
 
       NextTokPrec = getBinOpPrecedence(Tok.getKind(), GreaterThanIsOperator,
       NextTokPrec = getBinOpPrecedence(Tok.getKind(), GreaterThanIsOperator,
-                                       getLang().CPlusPlus0x);
+                                       getLangOpts().CPlusPlus0x);
     }
     }
     assert(NextTokPrec <= ThisPrec && "Recursion didn't work!");
     assert(NextTokPrec <= ThisPrec && "Recursion didn't work!");
 
 
@@ -666,7 +666,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
     // If this expression is limited to being a unary-expression, the parent can
     // If this expression is limited to being a unary-expression, the parent can
     // not start a cast expression.
     // not start a cast expression.
     ParenParseOption ParenExprType =
     ParenParseOption ParenExprType =
-      (isUnaryExpression && !getLang().CPlusPlus)? CompoundLiteral : CastExpr;
+      (isUnaryExpression && !getLangOpts().CPlusPlus)? CompoundLiteral : CastExpr;
     ParsedType CastTy;
     ParsedType CastTy;
     SourceLocation RParenLoc;
     SourceLocation RParenLoc;
     
     
@@ -728,7 +728,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
                                // constant: enumeration-constant
                                // constant: enumeration-constant
     // Turn a potentially qualified name into a annot_typename or
     // Turn a potentially qualified name into a annot_typename or
     // annot_cxxscope if it would be valid.  This handles things like x::y, etc.
     // annot_cxxscope if it would be valid.  This handles things like x::y, etc.
-    if (getLang().CPlusPlus) {
+    if (getLangOpts().CPlusPlus) {
       // Avoid the unnecessary parse-time lookup in the common case
       // Avoid the unnecessary parse-time lookup in the common case
       // where the syntax forbids a type.
       // where the syntax forbids a type.
       const Token &Next = NextToken();
       const Token &Next = NextToken();
@@ -751,7 +751,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
     SourceLocation ILoc = ConsumeToken();
     SourceLocation ILoc = ConsumeToken();
     
     
     // Support 'Class.property' and 'super.property' notation.
     // Support 'Class.property' and 'super.property' notation.
-    if (getLang().ObjC1 && Tok.is(tok::period) &&
+    if (getLangOpts().ObjC1 && Tok.is(tok::period) &&
         (Actions.getTypeName(II, ILoc, getCurScope()) ||
         (Actions.getTypeName(II, ILoc, getCurScope()) ||
          // Allow the base to be 'super' if in an objc-method.
          // Allow the base to be 'super' if in an objc-method.
          (&II == Ident_super && getCurScope()->isInObjcMethodScope()))) {
          (&II == Ident_super && getCurScope()->isInObjcMethodScope()))) {
@@ -759,7 +759,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
       
       
       // Allow either an identifier or the keyword 'class' (in C++).
       // Allow either an identifier or the keyword 'class' (in C++).
       if (Tok.isNot(tok::identifier) && 
       if (Tok.isNot(tok::identifier) && 
-          !(getLang().CPlusPlus && Tok.is(tok::kw_class))) {
+          !(getLangOpts().CPlusPlus && Tok.is(tok::kw_class))) {
         Diag(Tok, diag::err_expected_property_name);
         Diag(Tok, diag::err_expected_property_name);
         return ExprError();
         return ExprError();
       }
       }
@@ -775,7 +775,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
     // the token sequence is ill-formed. However, if there's a ':' or ']' after
     // the token sequence is ill-formed. However, if there's a ':' or ']' after
     // that identifier, this is probably a message send with a missing open
     // that identifier, this is probably a message send with a missing open
     // bracket. Treat it as such. 
     // bracket. Treat it as such. 
-    if (getLang().ObjC1 && &II == Ident_super && !InMessageExpression &&
+    if (getLangOpts().ObjC1 && &II == Ident_super && !InMessageExpression &&
         getCurScope()->isInObjcMethodScope() &&
         getCurScope()->isInObjcMethodScope() &&
         ((Tok.is(tok::identifier) &&
         ((Tok.is(tok::identifier) &&
          (NextToken().is(tok::colon) || NextToken().is(tok::r_square))) ||
          (NextToken().is(tok::colon) || NextToken().is(tok::r_square))) ||
@@ -790,7 +790,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
     // send that's missing the opening '['. Recovery
     // send that's missing the opening '['. Recovery
     // appropriately. Also take this path if we're performing code
     // appropriately. Also take this path if we're performing code
     // completion after an Objective-C class name.
     // completion after an Objective-C class name.
-    if (getLang().ObjC1 && 
+    if (getLangOpts().ObjC1 && 
         ((Tok.is(tok::identifier) && !InMessageExpression) || 
         ((Tok.is(tok::identifier) && !InMessageExpression) || 
          Tok.is(tok::code_completion))) {
          Tok.is(tok::code_completion))) {
       const Token& Next = NextToken();
       const Token& Next = NextToken();
@@ -875,7 +875,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
     //     ++ cast-expression
     //     ++ cast-expression
     //     -- cast-expression
     //     -- cast-expression
     SourceLocation SavedLoc = ConsumeToken();
     SourceLocation SavedLoc = ConsumeToken();
-    Res = ParseCastExpression(!getLang().CPlusPlus);
+    Res = ParseCastExpression(!getLangOpts().CPlusPlus);
     if (!Res.isInvalid())
     if (!Res.isInvalid())
       Res = Actions.ActOnUnaryOp(getCurScope(), SavedLoc, SavedKind, Res.get());
       Res = Actions.ActOnUnaryOp(getCurScope(), SavedLoc, SavedKind, Res.get());
     return move(Res);
     return move(Res);
@@ -996,7 +996,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
   case tok::kw_typename:
   case tok::kw_typename:
   case tok::kw_typeof:
   case tok::kw_typeof:
   case tok::kw___vector: {
   case tok::kw___vector: {
-    if (!getLang().CPlusPlus) {
+    if (!getLangOpts().CPlusPlus) {
       Diag(Tok, diag::err_expected_expression);
       Diag(Tok, diag::err_expected_expression);
       return ExprError();
       return ExprError();
     }
     }
@@ -1014,7 +1014,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
     DeclSpec DS(AttrFactory);
     DeclSpec DS(AttrFactory);
     ParseCXXSimpleTypeSpecifier(DS);
     ParseCXXSimpleTypeSpecifier(DS);
     if (Tok.isNot(tok::l_paren) &&
     if (Tok.isNot(tok::l_paren) &&
-        (!getLang().CPlusPlus0x || Tok.isNot(tok::l_brace)))
+        (!getLangOpts().CPlusPlus0x || Tok.isNot(tok::l_brace)))
       return ExprError(Diag(Tok, diag::err_expected_lparen_after_type)
       return ExprError(Diag(Tok, diag::err_expected_lparen_after_type)
                          << DS.getSourceRange());
                          << DS.getSourceRange());
 
 
@@ -1198,8 +1198,8 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
     return ExprError();
     return ExprError();
   }
   }
   case tok::l_square:
   case tok::l_square:
-    if (getLang().CPlusPlus0x) {
-      if (getLang().ObjC1) {
+    if (getLangOpts().CPlusPlus0x) {
+      if (getLangOpts().ObjC1) {
         // C++11 lambda expressions and Objective-C message sends both start with a
         // C++11 lambda expressions and Objective-C message sends both start with a
         // square bracket.  There are three possibilities here:
         // square bracket.  There are three possibilities here:
         // we have a valid lambda expression, we have an invalid lambda
         // we have a valid lambda expression, we have an invalid lambda
@@ -1213,7 +1213,7 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
       Res = ParseLambdaExpression();
       Res = ParseLambdaExpression();
       break;
       break;
     }
     }
-    if (getLang().ObjC1) {
+    if (getLangOpts().ObjC1) {
       Res = ParseObjCMessageExpression();
       Res = ParseObjCMessageExpression();
       break;
       break;
     }
     }
@@ -1265,7 +1265,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
       // If we see identifier: after an expression, and we're not already in a
       // If we see identifier: after an expression, and we're not already in a
       // message send, then this is probably a message send with a missing
       // message send, then this is probably a message send with a missing
       // opening bracket '['.
       // opening bracket '['.
-      if (getLang().ObjC1 && !InMessageExpression && 
+      if (getLangOpts().ObjC1 && !InMessageExpression && 
           (NextToken().is(tok::colon) || NextToken().is(tok::r_square))) {
           (NextToken().is(tok::colon) || NextToken().is(tok::r_square))) {
         LHS = ParseObjCMessageExpressionBody(SourceLocation(), SourceLocation(),
         LHS = ParseObjCMessageExpressionBody(SourceLocation(), SourceLocation(),
                                              ParsedType(), LHS.get());
                                              ParsedType(), LHS.get());
@@ -1283,7 +1283,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
       // actually another message send.  In this case, do some look-ahead to see
       // actually another message send.  In this case, do some look-ahead to see
       // if the contents of the square brackets are obviously not a valid
       // if the contents of the square brackets are obviously not a valid
       // expression and recover by pretending there is no suffix.
       // expression and recover by pretending there is no suffix.
-      if (getLang().ObjC1 && Tok.isAtStartOfLine() &&
+      if (getLangOpts().ObjC1 && Tok.isAtStartOfLine() &&
           isSimpleObjCMessageExpression())
           isSimpleObjCMessageExpression())
         return move(LHS);
         return move(LHS);
        
        
@@ -1291,7 +1291,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
       T.consumeOpen();
       T.consumeOpen();
       Loc = T.getOpenLocation();
       Loc = T.getOpenLocation();
       ExprResult Idx;
       ExprResult Idx;
-      if (getLang().CPlusPlus0x && Tok.is(tok::l_brace)) {
+      if (getLangOpts().CPlusPlus0x && Tok.is(tok::l_brace)) {
         Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists);
         Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists);
         Idx = ParseBraceInitializer();
         Idx = ParseBraceInitializer();
       } else
       } else
@@ -1411,7 +1411,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
       CXXScopeSpec SS;
       CXXScopeSpec SS;
       ParsedType ObjectType;
       ParsedType ObjectType;
       bool MayBePseudoDestructor = false;
       bool MayBePseudoDestructor = false;
-      if (getLang().CPlusPlus && !LHS.isInvalid()) {
+      if (getLangOpts().CPlusPlus && !LHS.isInvalid()) {
         LHS = Actions.ActOnStartCXXMemberReference(getCurScope(), LHS.take(),
         LHS = Actions.ActOnStartCXXMemberReference(getCurScope(), LHS.take(),
                                                    OpLoc, OpKind, ObjectType,
                                                    OpLoc, OpKind, ObjectType,
                                                    MayBePseudoDestructor);
                                                    MayBePseudoDestructor);
@@ -1449,7 +1449,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
       // FIXME: Add support for explicit call of template constructor.
       // FIXME: Add support for explicit call of template constructor.
       SourceLocation TemplateKWLoc;
       SourceLocation TemplateKWLoc;
       UnqualifiedId Name;
       UnqualifiedId Name;
-      if (getLang().ObjC2 && OpKind == tok::period && Tok.is(tok::kw_class)) {
+      if (getLangOpts().ObjC2 && OpKind == tok::period && Tok.is(tok::kw_class)) {
         // Objective-C++:
         // Objective-C++:
         //   After a '.' in a member access expression, treat the keyword
         //   After a '.' in a member access expression, treat the keyword
         //   'class' as if it were an identifier.
         //   'class' as if it were an identifier.
@@ -1464,7 +1464,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
                                     /*EnteringContext=*/false, 
                                     /*EnteringContext=*/false, 
                                     /*AllowDestructorName=*/true,
                                     /*AllowDestructorName=*/true,
                                     /*AllowConstructorName=*/
                                     /*AllowConstructorName=*/
-                                      getLang().MicrosoftExt, 
+                                      getLangOpts().MicrosoftExt, 
                                     ObjectType, TemplateKWLoc, Name))
                                     ObjectType, TemplateKWLoc, Name))
         LHS = ExprError();
         LHS = ExprError();
       
       
@@ -1524,7 +1524,7 @@ Parser::ParseExprAfterUnaryExprOrTypeTrait(const Token &OpTok,
   // If the operand doesn't start with an '(', it must be an expression.
   // If the operand doesn't start with an '(', it must be an expression.
   if (Tok.isNot(tok::l_paren)) {
   if (Tok.isNot(tok::l_paren)) {
     isCastExpr = false;
     isCastExpr = false;
-    if (OpTok.is(tok::kw_typeof) && !getLang().CPlusPlus) {
+    if (OpTok.is(tok::kw_typeof) && !getLangOpts().CPlusPlus) {
       Diag(Tok,diag::err_expected_lparen_after_id) << OpTok.getIdentifierInfo();
       Diag(Tok,diag::err_expected_lparen_after_id) << OpTok.getIdentifierInfo();
       return ExprError();
       return ExprError();
     }
     }
@@ -1549,7 +1549,7 @@ Parser::ParseExprAfterUnaryExprOrTypeTrait(const Token &OpTok,
       return ExprEmpty();
       return ExprEmpty();
     }
     }
 
 
-    if (getLang().CPlusPlus || OpTok.isNot(tok::kw_typeof)) {
+    if (getLangOpts().CPlusPlus || OpTok.isNot(tok::kw_typeof)) {
       // GNU typeof in C requires the expression to be parenthesized. Not so for
       // GNU typeof in C requires the expression to be parenthesized. Not so for
       // sizeof/alignof or in C++. Therefore, the parenthesized expression is
       // sizeof/alignof or in C++. Therefore, the parenthesized expression is
       // the start of a unary-expression, but doesn't include any postfix 
       // the start of a unary-expression, but doesn't include any postfix 
@@ -1898,12 +1898,12 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, bool stopIfCastExpr,
   }
   }
 
 
   // Diagnose use of bridge casts in non-arc mode.
   // Diagnose use of bridge casts in non-arc mode.
-  bool BridgeCast = (getLang().ObjC2 &&
+  bool BridgeCast = (getLangOpts().ObjC2 &&
                      (Tok.is(tok::kw___bridge) || 
                      (Tok.is(tok::kw___bridge) || 
                       Tok.is(tok::kw___bridge_transfer) ||
                       Tok.is(tok::kw___bridge_transfer) ||
                       Tok.is(tok::kw___bridge_retained) ||
                       Tok.is(tok::kw___bridge_retained) ||
                       Tok.is(tok::kw___bridge_retain)));
                       Tok.is(tok::kw___bridge_retain)));
-  if (BridgeCast && !getLang().ObjCAutoRefCount) {
+  if (BridgeCast && !getLangOpts().ObjCAutoRefCount) {
     StringRef BridgeCastName = Tok.getName();
     StringRef BridgeCastName = Tok.getName();
     SourceLocation BridgeKeywordLoc = ConsumeToken();
     SourceLocation BridgeKeywordLoc = ConsumeToken();
     if (!PP.getSourceManager().isInSystemHeader(BridgeKeywordLoc))
     if (!PP.getSourceManager().isInSystemHeader(BridgeKeywordLoc))
@@ -1984,7 +1984,7 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, bool stopIfCastExpr,
     // this is probably an Objective-C message send where the leading '[' is
     // this is probably an Objective-C message send where the leading '[' is
     // missing. Recover as if that were the case.
     // missing. Recover as if that were the case.
     if (!DeclaratorInfo.isInvalidType() && Tok.is(tok::identifier) &&
     if (!DeclaratorInfo.isInvalidType() && Tok.is(tok::identifier) &&
-        !InMessageExpression && getLang().ObjC1 &&
+        !InMessageExpression && getLangOpts().ObjC1 &&
         (NextToken().is(tok::colon) || NextToken().is(tok::r_square))) {
         (NextToken().is(tok::colon) || NextToken().is(tok::r_square))) {
       TypeResult Ty;
       TypeResult Ty;
       {
       {
@@ -2027,7 +2027,7 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, bool stopIfCastExpr,
         }
         }
         
         
         // Reject the cast of super idiom in ObjC.
         // Reject the cast of super idiom in ObjC.
-        if (Tok.is(tok::identifier) && getLang().ObjC1 &&
+        if (Tok.is(tok::identifier) && getLangOpts().ObjC1 &&
             Tok.getIdentifierInfo() == Ident_super && 
             Tok.getIdentifierInfo() == Ident_super && 
             getCurScope()->isInObjcMethodScope() &&
             getCurScope()->isInObjcMethodScope() &&
             GetLookAheadToken(1).isNot(tok::period)) {
             GetLookAheadToken(1).isNot(tok::period)) {
@@ -2098,7 +2098,7 @@ Parser::ParseCompoundLiteralExpression(ParsedType Ty,
                                        SourceLocation LParenLoc,
                                        SourceLocation LParenLoc,
                                        SourceLocation RParenLoc) {
                                        SourceLocation RParenLoc) {
   assert(Tok.is(tok::l_brace) && "Not a compound literal!");
   assert(Tok.is(tok::l_brace) && "Not a compound literal!");
-  if (!getLang().C99)   // Compound literals don't exist in C90.
+  if (!getLangOpts().C99)   // Compound literals don't exist in C90.
     Diag(LParenLoc, diag::ext_c99_compound_literal);
     Diag(LParenLoc, diag::ext_c99_compound_literal);
   ExprResult Result = ParseInitializer();
   ExprResult Result = ParseInitializer();
   if (!Result.isInvalid() && Ty)
   if (!Result.isInvalid() && Ty)
@@ -2144,7 +2144,7 @@ ExprResult Parser::ParseGenericSelectionExpression() {
   assert(Tok.is(tok::kw__Generic) && "_Generic keyword expected");
   assert(Tok.is(tok::kw__Generic) && "_Generic keyword expected");
   SourceLocation KeyLoc = ConsumeToken();
   SourceLocation KeyLoc = ConsumeToken();
 
 
-  if (!getLang().C11)
+  if (!getLangOpts().C11)
     Diag(KeyLoc, diag::ext_c11_generic_selection);
     Diag(KeyLoc, diag::ext_c11_generic_selection);
 
 
   BalancedDelimiterTracker T(*this, tok::l_paren);
   BalancedDelimiterTracker T(*this, tok::l_paren);
@@ -2262,7 +2262,7 @@ bool Parser::ParseExpressionList(SmallVectorImpl<Expr*> &Exprs,
     }
     }
 
 
     ExprResult Expr;
     ExprResult Expr;
-    if (getLang().CPlusPlus0x && Tok.is(tok::l_brace)) {
+    if (getLangOpts().CPlusPlus0x && Tok.is(tok::l_brace)) {
       Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists);
       Diag(Tok, diag::warn_cxx98_compat_generalized_initializer_lists);
       Expr = ParseBraceInitializer();
       Expr = ParseBraceInitializer();
     } else
     } else

+ 15 - 15
lib/Parse/ParseExprCXX.cpp

@@ -138,7 +138,7 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS,
                                             bool EnteringContext,
                                             bool EnteringContext,
                                             bool *MayBePseudoDestructor,
                                             bool *MayBePseudoDestructor,
                                             bool IsTypename) {
                                             bool IsTypename) {
-  assert(getLang().CPlusPlus &&
+  assert(getLangOpts().CPlusPlus &&
          "Call sites of this function should be guarded by checking for C++");
          "Call sites of this function should be guarded by checking for C++");
 
 
   if (Tok.is(tok::annot_cxxscope)) {
   if (Tok.is(tok::annot_cxxscope)) {
@@ -416,7 +416,7 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS,
         // parse correctly as a template, so suggest the keyword 'template'
         // parse correctly as a template, so suggest the keyword 'template'
         // before 'getAs' and treat this as a dependent template name.
         // before 'getAs' and treat this as a dependent template name.
         unsigned DiagID = diag::err_missing_dependent_template_keyword;
         unsigned DiagID = diag::err_missing_dependent_template_keyword;
-        if (getLang().MicrosoftExt)
+        if (getLangOpts().MicrosoftExt)
           DiagID = diag::warn_missing_dependent_template_keyword;
           DiagID = diag::warn_missing_dependent_template_keyword;
         
         
         Diag(Tok.getLocation(), DiagID)
         Diag(Tok.getLocation(), DiagID)
@@ -578,7 +578,7 @@ ExprResult Parser::ParseLambdaExpression() {
 ///
 ///
 /// If we are not looking at a lambda expression, returns ExprError().
 /// If we are not looking at a lambda expression, returns ExprError().
 ExprResult Parser::TryParseLambdaExpression() {
 ExprResult Parser::TryParseLambdaExpression() {
-  assert(getLang().CPlusPlus0x
+  assert(getLangOpts().CPlusPlus0x
          && Tok.is(tok::l_square)
          && Tok.is(tok::l_square)
          && "Not at the start of a possible lambda expression.");
          && "Not at the start of a possible lambda expression.");
 
 
@@ -657,7 +657,7 @@ llvm::Optional<unsigned> Parser::ParseLambdaIntroducer(LambdaIntroducer &Intro){
     if (Tok.is(tok::code_completion)) {
     if (Tok.is(tok::code_completion)) {
       // If we're in Objective-C++ and we have a bare '[', then this is more
       // If we're in Objective-C++ and we have a bare '[', then this is more
       // likely to be a message receiver.
       // likely to be a message receiver.
-      if (getLang().ObjC1 && first)
+      if (getLangOpts().ObjC1 && first)
         Actions.CodeCompleteObjCMessageReceiver(getCurScope());
         Actions.CodeCompleteObjCMessageReceiver(getCurScope());
       else
       else
         Actions.CodeCompleteLambdaIntroducer(getCurScope(), Intro, 
         Actions.CodeCompleteLambdaIntroducer(getCurScope(), Intro, 
@@ -1225,7 +1225,7 @@ Parser::ParseCXXTypeConstructExpression(const DeclSpec &DS) {
   ParsedType TypeRep = Actions.ActOnTypeName(getCurScope(), DeclaratorInfo).get();
   ParsedType TypeRep = Actions.ActOnTypeName(getCurScope(), DeclaratorInfo).get();
 
 
   assert((Tok.is(tok::l_paren) ||
   assert((Tok.is(tok::l_paren) ||
-          (getLang().CPlusPlus0x && Tok.is(tok::l_brace)))
+          (getLangOpts().CPlusPlus0x && Tok.is(tok::l_brace)))
          && "Expected '(' or '{'!");
          && "Expected '(' or '{'!");
 
 
   if (Tok.is(tok::l_brace)) {
   if (Tok.is(tok::l_brace)) {
@@ -1350,7 +1350,7 @@ bool Parser::ParseCXXCondition(ExprResult &ExprOut,
     ConsumeToken();
     ConsumeToken();
 
 
   ExprResult InitExpr = ExprError();
   ExprResult InitExpr = ExprError();
-  if (getLang().CPlusPlus0x && Tok.is(tok::l_brace)) {
+  if (getLangOpts().CPlusPlus0x && Tok.is(tok::l_brace)) {
     Diag(Tok.getLocation(),
     Diag(Tok.getLocation(),
          diag::warn_cxx98_compat_generalized_initializer_lists);
          diag::warn_cxx98_compat_generalized_initializer_lists);
     InitExpr = ParseBraceInitializer();
     InitExpr = ParseBraceInitializer();
@@ -1467,7 +1467,7 @@ void Parser::ParseCXXSimpleTypeSpecifier(DeclSpec &DS) {
     // is a specific typedef and 'itf<proto1,proto2>' where 'itf' is an
     // is a specific typedef and 'itf<proto1,proto2>' where 'itf' is an
     // Objective-C interface.  If we don't have Objective-C or a '<', this is
     // Objective-C interface.  If we don't have Objective-C or a '<', this is
     // just a normal reference to a typedef name.
     // just a normal reference to a typedef name.
-    if (Tok.is(tok::less) && getLang().ObjC1)
+    if (Tok.is(tok::less) && getLangOpts().ObjC1)
       ParseObjCProtocolQualifiers(DS);
       ParseObjCProtocolQualifiers(DS);
     
     
     DS.Finish(Diags, PP);
     DS.Finish(Diags, PP);
@@ -1904,7 +1904,7 @@ bool Parser::ParseUnqualifiedIdOperator(CXXScopeSpec &SS, bool EnteringContext,
   //   literal-operator-id: [C++0x 13.5.8]
   //   literal-operator-id: [C++0x 13.5.8]
   //     operator "" identifier
   //     operator "" identifier
 
 
-  if (getLang().CPlusPlus0x && isTokenStringLiteral()) {
+  if (getLangOpts().CPlusPlus0x && isTokenStringLiteral()) {
     Diag(Tok.getLocation(), diag::warn_cxx98_compat_literal_operator);
     Diag(Tok.getLocation(), diag::warn_cxx98_compat_literal_operator);
 
 
     SourceLocation DiagLoc;
     SourceLocation DiagLoc;
@@ -1936,7 +1936,7 @@ bool Parser::ParseUnqualifiedIdOperator(CXXScopeSpec &SS, bool EnteringContext,
       SuffixLoc =
       SuffixLoc =
         Lexer::AdvanceToTokenCharacter(TokLocs[Literal.getUDSuffixToken()],
         Lexer::AdvanceToTokenCharacter(TokLocs[Literal.getUDSuffixToken()],
                                        Literal.getUDSuffixOffset(),
                                        Literal.getUDSuffixOffset(),
-                                       PP.getSourceManager(), getLang());
+                                       PP.getSourceManager(), getLangOpts());
       // This form is not permitted by the standard (yet).
       // This form is not permitted by the standard (yet).
       DiagLoc = SuffixLoc;
       DiagLoc = SuffixLoc;
       DiagId = diag::err_literal_operator_missing_space;
       DiagId = diag::err_literal_operator_missing_space;
@@ -2041,7 +2041,7 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec &SS, bool EnteringContext,
   // Handle 'A::template B'. This is for template-ids which have not
   // Handle 'A::template B'. This is for template-ids which have not
   // already been annotated by ParseOptionalCXXScopeSpecifier().
   // already been annotated by ParseOptionalCXXScopeSpecifier().
   bool TemplateSpecified = false;
   bool TemplateSpecified = false;
-  if (getLang().CPlusPlus && Tok.is(tok::kw_template) &&
+  if (getLangOpts().CPlusPlus && Tok.is(tok::kw_template) &&
       (ObjectType || SS.isSet())) {
       (ObjectType || SS.isSet())) {
     TemplateSpecified = true;
     TemplateSpecified = true;
     TemplateKWLoc = ConsumeToken();
     TemplateKWLoc = ConsumeToken();
@@ -2055,7 +2055,7 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec &SS, bool EnteringContext,
     IdentifierInfo *Id = Tok.getIdentifierInfo();
     IdentifierInfo *Id = Tok.getIdentifierInfo();
     SourceLocation IdLoc = ConsumeToken();
     SourceLocation IdLoc = ConsumeToken();
 
 
-    if (!getLang().CPlusPlus) {
+    if (!getLangOpts().CPlusPlus) {
       // If we're not in C++, only identifiers matter. Record the
       // If we're not in C++, only identifiers matter. Record the
       // identifier and return.
       // identifier and return.
       Result.setIdentifier(Id, IdLoc);
       Result.setIdentifier(Id, IdLoc);
@@ -2152,7 +2152,7 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec &SS, bool EnteringContext,
     return false;
     return false;
   }
   }
   
   
-  if (getLang().CPlusPlus && 
+  if (getLangOpts().CPlusPlus && 
       (AllowDestructorName || SS.isSet()) && Tok.is(tok::tilde)) {
       (AllowDestructorName || SS.isSet()) && Tok.is(tok::tilde)) {
     // C++ [expr.unary.op]p10:
     // C++ [expr.unary.op]p10:
     //   There is an ambiguity in the unary-expression ~X(), where X is a 
     //   There is an ambiguity in the unary-expression ~X(), where X is a 
@@ -2203,7 +2203,7 @@ bool Parser::ParseUnqualifiedId(CXXScopeSpec &SS, bool EnteringContext,
   }
   }
   
   
   Diag(Tok, diag::err_expected_unqualified_id)
   Diag(Tok, diag::err_expected_unqualified_id)
-    << getLang().CPlusPlus;
+    << getLangOpts().CPlusPlus;
   return true;
   return true;
 }
 }
 
 
@@ -2333,7 +2333,7 @@ Parser::ParseCXXNewExpression(bool UseGlobal, SourceLocation Start) {
     Initializer = Actions.ActOnParenListExpr(ConstructorLParen,
     Initializer = Actions.ActOnParenListExpr(ConstructorLParen,
                                              ConstructorRParen,
                                              ConstructorRParen,
                                              move_arg(ConstructorArgs));
                                              move_arg(ConstructorArgs));
-  } else if (Tok.is(tok::l_brace) && getLang().CPlusPlus0x) {
+  } else if (Tok.is(tok::l_brace) && getLangOpts().CPlusPlus0x) {
     Diag(Tok.getLocation(),
     Diag(Tok.getLocation(),
          diag::warn_cxx98_compat_generalized_initializer_lists);
          diag::warn_cxx98_compat_generalized_initializer_lists);
     Initializer = ParseBraceInitializer();
     Initializer = ParseBraceInitializer();
@@ -2724,7 +2724,7 @@ ExprResult
 Parser::ParseCXXAmbiguousParenExpression(ParenParseOption &ExprType,
 Parser::ParseCXXAmbiguousParenExpression(ParenParseOption &ExprType,
                                          ParsedType &CastTy,
                                          ParsedType &CastTy,
                                          BalancedDelimiterTracker &Tracker) {
                                          BalancedDelimiterTracker &Tracker) {
-  assert(getLang().CPlusPlus && "Should only be called for C++!");
+  assert(getLangOpts().CPlusPlus && "Should only be called for C++!");
   assert(ExprType == CastExpr && "Compound literals are not ambiguous!");
   assert(ExprType == CastExpr && "Compound literals are not ambiguous!");
   assert(isTypeIdInParens() && "Not a type-id!");
   assert(isTypeIdInParens() && "Not a type-id!");
 
 

+ 6 - 6
lib/Parse/ParseInit.cpp

@@ -33,7 +33,7 @@ bool Parser::MayBeDesignationStart() {
     return true;
     return true;
       
       
   case tok::l_square: {  // designator: array-designator
   case tok::l_square: {  // designator: array-designator
-    if (!PP.getLangOptions().CPlusPlus0x)
+    if (!PP.getLangOpts().CPlusPlus0x)
       return true;
       return true;
     
     
     // C++11 lambda expressions and C99 designators can be ambiguous all the
     // C++11 lambda expressions and C99 designators can be ambiguous all the
@@ -223,7 +223,7 @@ ExprResult Parser::ParseInitializerWithPotentialDesignator() {
     // send) or send to 'super', parse this as a message send
     // send) or send to 'super', parse this as a message send
     // expression.  We handle C++ and C separately, since C++ requires
     // expression.  We handle C++ and C separately, since C++ requires
     // much more complicated parsing.
     // much more complicated parsing.
-    if  (getLang().ObjC1 && getLang().CPlusPlus) {
+    if  (getLangOpts().ObjC1 && getLangOpts().CPlusPlus) {
       // Send to 'super'.
       // Send to 'super'.
       if (Tok.is(tok::identifier) && Tok.getIdentifierInfo() == Ident_super &&
       if (Tok.is(tok::identifier) && Tok.getIdentifierInfo() == Ident_super &&
           NextToken().isNot(tok::period) && 
           NextToken().isNot(tok::period) && 
@@ -258,7 +258,7 @@ ExprResult Parser::ParseInitializerWithPotentialDesignator() {
       // adopt the expression for further analysis below.
       // adopt the expression for further analysis below.
       // FIXME: potentially-potentially evaluated expression above?
       // FIXME: potentially-potentially evaluated expression above?
       Idx = ExprResult(static_cast<Expr*>(TypeOrExpr));
       Idx = ExprResult(static_cast<Expr*>(TypeOrExpr));
-    } else if (getLang().ObjC1 && Tok.is(tok::identifier)) {
+    } else if (getLangOpts().ObjC1 && Tok.is(tok::identifier)) {
       IdentifierInfo *II = Tok.getIdentifierInfo();
       IdentifierInfo *II = Tok.getIdentifierInfo();
       SourceLocation IILoc = Tok.getLocation();
       SourceLocation IILoc = Tok.getLocation();
       ParsedType ReceiverType;
       ParsedType ReceiverType;
@@ -316,7 +316,7 @@ ExprResult Parser::ParseInitializerWithPotentialDesignator() {
     // tokens are '...' or ']' or an objc message send.  If this is an objc
     // tokens are '...' or ']' or an objc message send.  If this is an objc
     // message send, handle it now.  An objc-message send is the start of
     // message send, handle it now.  An objc-message send is the start of
     // an assignment-expression production.
     // an assignment-expression production.
-    if (getLang().ObjC1 && Tok.isNot(tok::ellipsis) &&
+    if (getLangOpts().ObjC1 && Tok.isNot(tok::ellipsis) &&
         Tok.isNot(tok::r_square)) {
         Tok.isNot(tok::r_square)) {
       CheckArrayDesignatorSyntax(*this, Tok.getLocation(), Desig);
       CheckArrayDesignatorSyntax(*this, Tok.getLocation(), Desig);
       return ParseAssignmentExprWithObjCMessageExprStart(StartLoc,
       return ParseAssignmentExprWithObjCMessageExprStart(StartLoc,
@@ -404,7 +404,7 @@ ExprResult Parser::ParseBraceInitializer() {
 
 
   if (Tok.is(tok::r_brace)) {
   if (Tok.is(tok::r_brace)) {
     // Empty initializers are a C++ feature and a GNU extension to C.
     // Empty initializers are a C++ feature and a GNU extension to C.
-    if (!getLang().CPlusPlus)
+    if (!getLangOpts().CPlusPlus)
       Diag(LBraceLoc, diag::ext_gnu_empty_initializer);
       Diag(LBraceLoc, diag::ext_gnu_empty_initializer);
     // Match the '}'.
     // Match the '}'.
     return Actions.ActOnInitList(LBraceLoc, MultiExprArg(Actions),
     return Actions.ActOnInitList(LBraceLoc, MultiExprArg(Actions),
@@ -415,7 +415,7 @@ ExprResult Parser::ParseBraceInitializer() {
 
 
   while (1) {
   while (1) {
     // Handle Microsoft __if_exists/if_not_exists if necessary.
     // Handle Microsoft __if_exists/if_not_exists if necessary.
-    if (getLang().MicrosoftExt && (Tok.is(tok::kw___if_exists) ||
+    if (getLangOpts().MicrosoftExt && (Tok.is(tok::kw___if_exists) ||
         Tok.is(tok::kw___if_not_exists))) {
         Tok.is(tok::kw___if_not_exists))) {
       if (ParseMicrosoftIfExistsBraceInitializer(InitExprs, InitExprsOk)) {
       if (ParseMicrosoftIfExistsBraceInitializer(InitExprs, InitExprsOk)) {
         if (Tok.isNot(tok::comma)) break;
         if (Tok.isNot(tok::comma)) break;

+ 13 - 13
lib/Parse/ParseObjc.cpp

@@ -65,7 +65,7 @@ Parser::DeclGroupPtrTy Parser::ParseObjCAtDirectives() {
     SingleDecl = ParseObjCPropertyDynamic(AtLoc);
     SingleDecl = ParseObjCPropertyDynamic(AtLoc);
     break;
     break;
   case tok::objc___experimental_modules_import:
   case tok::objc___experimental_modules_import:
-    if (getLang().Modules)
+    if (getLangOpts().Modules)
       return ParseModuleImport(AtLoc);
       return ParseModuleImport(AtLoc);
       
       
     // Fall through
     // Fall through
@@ -203,7 +203,7 @@ Decl *Parser::ParseObjCAtInterfaceDeclaration(SourceLocation AtLoc,
       categoryId = Tok.getIdentifierInfo();
       categoryId = Tok.getIdentifierInfo();
       categoryLoc = ConsumeToken();
       categoryLoc = ConsumeToken();
     }
     }
-    else if (!getLang().ObjC2) {
+    else if (!getLangOpts().ObjC2) {
       Diag(Tok, diag::err_expected_ident); // missing category name.
       Diag(Tok, diag::err_expected_ident); // missing category name.
       return 0;
       return 0;
     }
     }
@@ -477,7 +477,7 @@ void Parser::ParseObjCInterfaceDeclList(tok::ObjCKeywordKind contextKey,
       break;
       break;
 
 
     case tok::objc_property:
     case tok::objc_property:
-      if (!getLang().ObjC2)
+      if (!getLangOpts().ObjC2)
         Diag(AtLoc, diag::err_objc_properties_require_objc2);
         Diag(AtLoc, diag::err_objc_properties_require_objc2);
 
 
       ObjCDeclSpec OCDS;
       ObjCDeclSpec OCDS;
@@ -778,7 +778,7 @@ bool Parser::isTokIdentifier_in() const {
   // FIXME: May have to do additional look-ahead to only allow for
   // FIXME: May have to do additional look-ahead to only allow for
   // valid tokens following an 'in'; such as an identifier, unary operators,
   // valid tokens following an 'in'; such as an identifier, unary operators,
   // '[' etc.
   // '[' etc.
-  return (getLang().ObjC2 && Tok.is(tok::identifier) &&
+  return (getLangOpts().ObjC2 && Tok.is(tok::identifier) &&
           Tok.getIdentifierInfo() == ObjCTypeQuals[objc_in]);
           Tok.getIdentifierInfo() == ObjCTypeQuals[objc_in]);
 }
 }
 
 
@@ -981,7 +981,7 @@ Decl *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
 
 
   // If attributes exist before the method, parse them.
   // If attributes exist before the method, parse them.
   ParsedAttributes methodAttrs(AttrFactory);
   ParsedAttributes methodAttrs(AttrFactory);
-  if (getLang().ObjC2)
+  if (getLangOpts().ObjC2)
     MaybeParseGNUAttributes(methodAttrs);
     MaybeParseGNUAttributes(methodAttrs);
 
 
   if (Tok.is(tok::code_completion)) {
   if (Tok.is(tok::code_completion)) {
@@ -1007,7 +1007,7 @@ Decl *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
   SmallVector<DeclaratorChunk::ParamInfo, 8> CParamInfo;
   SmallVector<DeclaratorChunk::ParamInfo, 8> CParamInfo;
   if (Tok.isNot(tok::colon)) {
   if (Tok.isNot(tok::colon)) {
     // If attributes exist after the method, parse them.
     // If attributes exist after the method, parse them.
-    if (getLang().ObjC2)
+    if (getLangOpts().ObjC2)
       MaybeParseGNUAttributes(methodAttrs);
       MaybeParseGNUAttributes(methodAttrs);
 
 
     Selector Sel = PP.getSelectorTable().getNullarySelector(SelIdent);
     Selector Sel = PP.getSelectorTable().getNullarySelector(SelIdent);
@@ -1050,7 +1050,7 @@ Decl *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
     // If attributes exist before the argument name, parse them.
     // If attributes exist before the argument name, parse them.
     // Regardless, collect all the attributes we've parsed so far.
     // Regardless, collect all the attributes we've parsed so far.
     ArgInfo.ArgAttrs = 0;
     ArgInfo.ArgAttrs = 0;
-    if (getLang().ObjC2) {
+    if (getLangOpts().ObjC2) {
       MaybeParseGNUAttributes(paramAttrs);
       MaybeParseGNUAttributes(paramAttrs);
       ArgInfo.ArgAttrs = paramAttrs.getList();
       ArgInfo.ArgAttrs = paramAttrs.getList();
     }
     }
@@ -1129,7 +1129,7 @@ Decl *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
 
 
   // FIXME: Add support for optional parameter list...
   // FIXME: Add support for optional parameter list...
   // If attributes exist after the method, parse them.
   // If attributes exist after the method, parse them.
-  if (getLang().ObjC2)
+  if (getLangOpts().ObjC2)
     MaybeParseGNUAttributes(methodAttrs);
     MaybeParseGNUAttributes(methodAttrs);
   
   
   if (KeyIdents.size() == 0)
   if (KeyIdents.size() == 0)
@@ -1205,7 +1205,7 @@ ParseObjCProtocolReferences(SmallVectorImpl<Decl *> &Protocols,
 /// in a decl-specifier-seq, starting at the '<'.
 /// in a decl-specifier-seq, starting at the '<'.
 bool Parser::ParseObjCProtocolQualifiers(DeclSpec &DS) {
 bool Parser::ParseObjCProtocolQualifiers(DeclSpec &DS) {
   assert(Tok.is(tok::less) && "Protocol qualifiers start with '<'");
   assert(Tok.is(tok::less) && "Protocol qualifiers start with '<'");
-  assert(getLang().ObjC1 && "Protocol qualifiers only exist in Objective-C");
+  assert(getLangOpts().ObjC1 && "Protocol qualifiers only exist in Objective-C");
   SourceLocation LAngleLoc, EndProtoLoc;
   SourceLocation LAngleLoc, EndProtoLoc;
   SmallVector<Decl *, 8> ProtocolDecl;
   SmallVector<Decl *, 8> ProtocolDecl;
   SmallVector<SourceLocation, 8> ProtocolLocs;
   SmallVector<SourceLocation, 8> ProtocolLocs;
@@ -2175,14 +2175,14 @@ bool Parser::ParseObjCXXMessageReceiver(bool &IsExpr, void *&TypeOrExpr) {
 /// This routine will only return true for a subset of valid message-send
 /// This routine will only return true for a subset of valid message-send
 /// expressions.
 /// expressions.
 bool Parser::isSimpleObjCMessageExpression() {
 bool Parser::isSimpleObjCMessageExpression() {
-  assert(Tok.is(tok::l_square) && getLang().ObjC1 &&
+  assert(Tok.is(tok::l_square) && getLangOpts().ObjC1 &&
          "Incorrect start for isSimpleObjCMessageExpression");
          "Incorrect start for isSimpleObjCMessageExpression");
   return GetLookAheadToken(1).is(tok::identifier) &&
   return GetLookAheadToken(1).is(tok::identifier) &&
          GetLookAheadToken(2).is(tok::identifier);
          GetLookAheadToken(2).is(tok::identifier);
 }
 }
 
 
 bool Parser::isStartOfObjCClassMessageMissingOpenBracket() {
 bool Parser::isStartOfObjCClassMessageMissingOpenBracket() {
-  if (!getLang().ObjC1 || !NextToken().is(tok::identifier) || 
+  if (!getLangOpts().ObjC1 || !NextToken().is(tok::identifier) || 
       InMessageExpression)
       InMessageExpression)
     return false;
     return false;
   
   
@@ -2231,7 +2231,7 @@ ExprResult Parser::ParseObjCMessageExpression() {
   
   
   InMessageExpressionRAIIObject InMessage(*this, true);
   InMessageExpressionRAIIObject InMessage(*this, true);
   
   
-  if (getLang().CPlusPlus) {
+  if (getLangOpts().CPlusPlus) {
     // We completely separate the C and C++ cases because C++ requires
     // We completely separate the C and C++ cases because C++ requires
     // more complicated (read: slower) parsing. 
     // more complicated (read: slower) parsing. 
     
     
@@ -2647,7 +2647,7 @@ ExprResult Parser::ParseObjCDictionaryLiteral(SourceLocation AtLoc) {
     
     
     // Parse the ellipsis that designates this as a pack expansion.
     // Parse the ellipsis that designates this as a pack expansion.
     SourceLocation EllipsisLoc;
     SourceLocation EllipsisLoc;
-    if (Tok.is(tok::ellipsis) && getLang().CPlusPlus)
+    if (Tok.is(tok::ellipsis) && getLangOpts().CPlusPlus)
       EllipsisLoc = ConsumeToken();
       EllipsisLoc = ConsumeToken();
     
     
     // We have a valid expression. Collect it in a vector so we can
     // We have a valid expression. Collect it in a vector so we can

+ 2 - 2
lib/Parse/ParsePragma.cpp

@@ -143,7 +143,7 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP,
     // In MSVC/gcc, #pragma pack(4) sets the alignment without affecting
     // In MSVC/gcc, #pragma pack(4) sets the alignment without affecting
     // the push/pop stack.
     // the push/pop stack.
     // In Apple gcc, #pragma pack(4) is equivalent to #pragma pack(push, 4)
     // In Apple gcc, #pragma pack(4) is equivalent to #pragma pack(push, 4)
-    if (PP.getLangOptions().ApplePragmaPack)
+    if (PP.getLangOpts().ApplePragmaPack)
       Kind = Sema::PPK_Push;
       Kind = Sema::PPK_Push;
   } else if (Tok.is(tok::identifier)) {
   } else if (Tok.is(tok::identifier)) {
     const IdentifierInfo *II = Tok.getIdentifierInfo();
     const IdentifierInfo *II = Tok.getIdentifierInfo();
@@ -194,7 +194,7 @@ void PragmaPackHandler::HandlePragma(Preprocessor &PP,
         }
         }
       }
       }
     }
     }
-  } else if (PP.getLangOptions().ApplePragmaPack) {
+  } else if (PP.getLangOpts().ApplePragmaPack) {
     // In MSVC/gcc, #pragma pack() resets the alignment without affecting
     // In MSVC/gcc, #pragma pack() resets the alignment without affecting
     // the push/pop stack.
     // the push/pop stack.
     // In Apple gcc #pragma pack() is equivalent to #pragma pack(pop).
     // In Apple gcc #pragma pack() is equivalent to #pragma pack(pop).

+ 19 - 19
lib/Parse/ParseStmt.cpp

@@ -116,7 +116,7 @@ Retry:
       IdentifierInfo *Name = Tok.getIdentifierInfo();
       IdentifierInfo *Name = Tok.getIdentifierInfo();
       SourceLocation NameLoc = Tok.getLocation();
       SourceLocation NameLoc = Tok.getLocation();
 
 
-      if (getLang().CPlusPlus)
+      if (getLangOpts().CPlusPlus)
         CheckForTemplateAndDigraph(Next, ParsedType(),
         CheckForTemplateAndDigraph(Next, ParsedType(),
                                    /*EnteringContext=*/false, *Name, SS);
                                    /*EnteringContext=*/false, *Name, SS);
 
 
@@ -207,7 +207,7 @@ Retry:
   }
   }
 
 
   default: {
   default: {
-    if ((getLang().CPlusPlus || !OnlyStatement) && isDeclarationStatement()) {
+    if ((getLangOpts().CPlusPlus || !OnlyStatement) && isDeclarationStatement()) {
       SourceLocation DeclStart = Tok.getLocation(), DeclEnd;
       SourceLocation DeclStart = Tok.getLocation(), DeclEnd;
       DeclGroupPtrTy Decl = ParseDeclaration(Stmts, Declarator::BlockContext,
       DeclGroupPtrTy Decl = ParseDeclaration(Stmts, Declarator::BlockContext,
                                              DeclEnd, attrs);
                                              DeclEnd, attrs);
@@ -399,14 +399,14 @@ StmtResult Parser::ParseSEHExceptBlock(SourceLocation ExceptLoc) {
 
 
   ParseScope ExpectScope(this, Scope::DeclScope | Scope::ControlScope);
   ParseScope ExpectScope(this, Scope::DeclScope | Scope::ControlScope);
 
 
-  if (getLang().Borland) {
+  if (getLangOpts().Borland) {
     Ident__exception_info->setIsPoisoned(false);
     Ident__exception_info->setIsPoisoned(false);
     Ident___exception_info->setIsPoisoned(false);
     Ident___exception_info->setIsPoisoned(false);
     Ident_GetExceptionInfo->setIsPoisoned(false);
     Ident_GetExceptionInfo->setIsPoisoned(false);
   }
   }
   ExprResult FilterExpr(ParseExpression());
   ExprResult FilterExpr(ParseExpression());
 
 
-  if (getLang().Borland) {
+  if (getLangOpts().Borland) {
     Ident__exception_info->setIsPoisoned(true);
     Ident__exception_info->setIsPoisoned(true);
     Ident___exception_info->setIsPoisoned(true);
     Ident___exception_info->setIsPoisoned(true);
     Ident_GetExceptionInfo->setIsPoisoned(true);
     Ident_GetExceptionInfo->setIsPoisoned(true);
@@ -770,7 +770,7 @@ StmtResult Parser::ParseCompoundStatementBody(bool isStmtExpr) {
       continue;
       continue;
     }
     }
 
 
-    if (getLang().MicrosoftExt && (Tok.is(tok::kw___if_exists) ||
+    if (getLangOpts().MicrosoftExt && (Tok.is(tok::kw___if_exists) ||
         Tok.is(tok::kw___if_not_exists))) {
         Tok.is(tok::kw___if_not_exists))) {
       ParseMicrosoftIfExistsStatement(Stmts);
       ParseMicrosoftIfExistsStatement(Stmts);
       continue;
       continue;
@@ -855,7 +855,7 @@ bool Parser::ParseParenExprOrCondition(ExprResult &ExprResult,
   BalancedDelimiterTracker T(*this, tok::l_paren);
   BalancedDelimiterTracker T(*this, tok::l_paren);
   T.consumeOpen();
   T.consumeOpen();
 
 
-  if (getLang().CPlusPlus)
+  if (getLangOpts().CPlusPlus)
     ParseCXXCondition(ExprResult, DeclResult, Loc, ConvertToBoolean);
     ParseCXXCondition(ExprResult, DeclResult, Loc, ConvertToBoolean);
   else {
   else {
     ExprResult = ParseExpression();
     ExprResult = ParseExpression();
@@ -904,7 +904,7 @@ StmtResult Parser::ParseIfStatement(ParsedAttributes &attrs,
     return StmtError();
     return StmtError();
   }
   }
 
 
-  bool C99orCXX = getLang().C99 || getLang().CPlusPlus;
+  bool C99orCXX = getLangOpts().C99 || getLangOpts().CPlusPlus;
 
 
   // C99 6.8.4p3 - In C99, the if statement is a block.  This is not
   // C99 6.8.4p3 - In C99, the if statement is a block.  This is not
   // the case for C90.
   // the case for C90.
@@ -1038,7 +1038,7 @@ StmtResult Parser::ParseSwitchStatement(ParsedAttributes &attrs,
     return StmtError();
     return StmtError();
   }
   }
 
 
-  bool C99orCXX = getLang().C99 || getLang().CPlusPlus;
+  bool C99orCXX = getLangOpts().C99 || getLangOpts().CPlusPlus;
 
 
   // C99 6.8.4p3 - In C99, the switch statement is a block.  This is
   // C99 6.8.4p3 - In C99, the switch statement is a block.  This is
   // not the case for C90.  Start the switch scope.
   // not the case for C90.  Start the switch scope.
@@ -1130,7 +1130,7 @@ StmtResult Parser::ParseWhileStatement(ParsedAttributes &attrs,
     return StmtError();
     return StmtError();
   }
   }
 
 
-  bool C99orCXX = getLang().C99 || getLang().CPlusPlus;
+  bool C99orCXX = getLangOpts().C99 || getLangOpts().CPlusPlus;
 
 
   // C99 6.8.5p5 - In C99, the while statement is a block.  This is not
   // C99 6.8.5p5 - In C99, the while statement is a block.  This is not
   // the case for C90.  Start the loop scope.
   // the case for C90.  Start the loop scope.
@@ -1200,7 +1200,7 @@ StmtResult Parser::ParseDoStatement(ParsedAttributes &attrs) {
   // C99 6.8.5p5 - In C99, the do statement is a block.  This is not
   // C99 6.8.5p5 - In C99, the do statement is a block.  This is not
   // the case for C90.  Start the loop scope.
   // the case for C90.  Start the loop scope.
   unsigned ScopeFlags;
   unsigned ScopeFlags;
-  if (getLang().C99)
+  if (getLangOpts().C99)
     ScopeFlags = Scope::BreakScope | Scope::ContinueScope | Scope::DeclScope;
     ScopeFlags = Scope::BreakScope | Scope::ContinueScope | Scope::DeclScope;
   else
   else
     ScopeFlags = Scope::BreakScope | Scope::ContinueScope;
     ScopeFlags = Scope::BreakScope | Scope::ContinueScope;
@@ -1216,7 +1216,7 @@ StmtResult Parser::ParseDoStatement(ParsedAttributes &attrs) {
   // which is entered and exited each time through the loop.
   // which is entered and exited each time through the loop.
   //
   //
   ParseScope InnerScope(this, Scope::DeclScope,
   ParseScope InnerScope(this, Scope::DeclScope,
-                        (getLang().C99 || getLang().CPlusPlus) &&
+                        (getLangOpts().C99 || getLangOpts().CPlusPlus) &&
                         Tok.isNot(tok::l_brace));
                         Tok.isNot(tok::l_brace));
 
 
   // Read the body statement.
   // Read the body statement.
@@ -1287,7 +1287,7 @@ StmtResult Parser::ParseForStatement(ParsedAttributes &attrs,
     return StmtError();
     return StmtError();
   }
   }
 
 
-  bool C99orCXXorObjC = getLang().C99 || getLang().CPlusPlus || getLang().ObjC1;
+  bool C99orCXXorObjC = getLangOpts().C99 || getLangOpts().CPlusPlus || getLangOpts().ObjC1;
 
 
   // C99 6.8.5p5 - In C99, the for statement is a block.  This is not
   // C99 6.8.5p5 - In C99, the for statement is a block.  This is not
   // the case for C90.  Start the loop scope.
   // the case for C90.  Start the loop scope.
@@ -1348,7 +1348,7 @@ StmtResult Parser::ParseForStatement(ParsedAttributes &attrs,
     MaybeParseCXX0XAttributes(attrs);
     MaybeParseCXX0XAttributes(attrs);
 
 
     // In C++0x, "for (T NS:a" might not be a typo for ::
     // In C++0x, "for (T NS:a" might not be a typo for ::
-    bool MightBeForRangeStmt = getLang().CPlusPlus;
+    bool MightBeForRangeStmt = getLangOpts().CPlusPlus;
     ColonProtectionRAIIObject ColonProtection(*this, MightBeForRangeStmt);
     ColonProtectionRAIIObject ColonProtection(*this, MightBeForRangeStmt);
 
 
     SourceLocation DeclStart = Tok.getLocation(), DeclEnd;
     SourceLocation DeclStart = Tok.getLocation(), DeclEnd;
@@ -1360,7 +1360,7 @@ StmtResult Parser::ParseForStatement(ParsedAttributes &attrs,
     FirstPart = Actions.ActOnDeclStmt(DG, DeclStart, Tok.getLocation());
     FirstPart = Actions.ActOnDeclStmt(DG, DeclStart, Tok.getLocation());
 
 
     if (ForRangeInit.ParsedForRangeDecl()) {
     if (ForRangeInit.ParsedForRangeDecl()) {
-      Diag(ForRangeInit.ColonLoc, getLang().CPlusPlus0x ?
+      Diag(ForRangeInit.ColonLoc, getLangOpts().CPlusPlus0x ?
            diag::warn_cxx98_compat_for_range : diag::ext_for_range);
            diag::warn_cxx98_compat_for_range : diag::ext_for_range);
 
 
       ForRange = true;
       ForRange = true;
@@ -1404,7 +1404,7 @@ StmtResult Parser::ParseForStatement(ParsedAttributes &attrs,
         return StmtError();
         return StmtError();
       }
       }
       Collection = ParseExpression();
       Collection = ParseExpression();
-    } else if (getLang().CPlusPlus0x && Tok.is(tok::colon) && FirstPart.get()) {
+    } else if (getLangOpts().CPlusPlus0x && Tok.is(tok::colon) && FirstPart.get()) {
       // User tried to write the reasonable, but ill-formed, for-range-statement
       // User tried to write the reasonable, but ill-formed, for-range-statement
       //   for (expr : expr) { ... }
       //   for (expr : expr) { ... }
       Diag(Tok, diag::err_for_range_expected_decl)
       Diag(Tok, diag::err_for_range_expected_decl)
@@ -1431,7 +1431,7 @@ StmtResult Parser::ParseForStatement(ParsedAttributes &attrs,
       // missing both semicolons.
       // missing both semicolons.
     } else {
     } else {
       ExprResult Second;
       ExprResult Second;
-      if (getLang().CPlusPlus)
+      if (getLangOpts().CPlusPlus)
         ParseCXXCondition(Second, SecondVar, ForLoc, true);
         ParseCXXCondition(Second, SecondVar, ForLoc, true);
       else {
       else {
         Second = ParseExpression();
         Second = ParseExpression();
@@ -1605,10 +1605,10 @@ StmtResult Parser::ParseReturnStatement(ParsedAttributes &attrs) {
       return StmtError();
       return StmtError();
     }
     }
 
 
-    if (Tok.is(tok::l_brace) && getLang().CPlusPlus) {
+    if (Tok.is(tok::l_brace) && getLangOpts().CPlusPlus) {
       R = ParseInitializer();
       R = ParseInitializer();
       if (R.isUsable())
       if (R.isUsable())
-        Diag(R.get()->getLocStart(), getLang().CPlusPlus0x ?
+        Diag(R.get()->getLocStart(), getLangOpts().CPlusPlus0x ?
              diag::warn_cxx98_compat_generalized_initializer_lists :
              diag::warn_cxx98_compat_generalized_initializer_lists :
              diag::ext_generalized_initializer_lists)
              diag::ext_generalized_initializer_lists)
           << R.get()->getSourceRange();
           << R.get()->getSourceRange();
@@ -1771,7 +1771,7 @@ StmtResult Parser::ParseAsmStatement(bool &msAsm) {
   assert(Tok.is(tok::kw_asm) && "Not an asm stmt");
   assert(Tok.is(tok::kw_asm) && "Not an asm stmt");
   SourceLocation AsmLoc = ConsumeToken();
   SourceLocation AsmLoc = ConsumeToken();
 
 
-  if (getLang().MicrosoftExt && Tok.isNot(tok::l_paren) && !isTypeQualifier()) {
+  if (getLangOpts().MicrosoftExt && Tok.isNot(tok::l_paren) && !isTypeQualifier()) {
     msAsm = true;
     msAsm = true;
     return ParseMicrosoftAsmStatement(AsmLoc);
     return ParseMicrosoftAsmStatement(AsmLoc);
   }
   }

+ 4 - 4
lib/Parse/ParseTemplate.cpp

@@ -478,7 +478,7 @@ Decl *Parser::ParseTypeParameter(unsigned Depth, unsigned Position) {
     EllipsisLoc = ConsumeToken();
     EllipsisLoc = ConsumeToken();
 
 
     Diag(EllipsisLoc,
     Diag(EllipsisLoc,
-         getLang().CPlusPlus0x
+         getLangOpts().CPlusPlus0x
            ? diag::warn_cxx98_compat_variadic_templates
            ? diag::warn_cxx98_compat_variadic_templates
            : diag::ext_variadic_templates);
            : diag::ext_variadic_templates);
   }
   }
@@ -553,7 +553,7 @@ Parser::ParseTemplateTemplateParameter(unsigned Depth, unsigned Position) {
     EllipsisLoc = ConsumeToken();
     EllipsisLoc = ConsumeToken();
     
     
     Diag(EllipsisLoc,
     Diag(EllipsisLoc,
-         getLang().CPlusPlus0x
+         getLangOpts().CPlusPlus0x
            ? diag::warn_cxx98_compat_variadic_templates
            ? diag::warn_cxx98_compat_variadic_templates
            : diag::ext_variadic_templates);
            : diag::ext_variadic_templates);
   }
   }
@@ -716,7 +716,7 @@ Parser::ParseTemplateIdAfterTemplateName(TemplateTy Template,
     if (NextToken().is(tok::greater) || NextToken().is(tok::greatergreater))
     if (NextToken().is(tok::greater) || NextToken().is(tok::greatergreater))
       ReplaceStr = "> > ";
       ReplaceStr = "> > ";
 
 
-    Diag(Tok.getLocation(), getLang().CPlusPlus0x ?
+    Diag(Tok.getLocation(), getLangOpts().CPlusPlus0x ?
          diag::warn_cxx98_compat_two_right_angle_brackets :
          diag::warn_cxx98_compat_two_right_angle_brackets :
          diag::err_two_right_angle_brackets_need_space)
          diag::err_two_right_angle_brackets_need_space)
       << FixItHint::CreateReplacement(SourceRange(Tok.getLocation()),
       << FixItHint::CreateReplacement(SourceRange(Tok.getLocation()),
@@ -776,7 +776,7 @@ bool Parser::AnnotateTemplateIdToken(TemplateTy Template, TemplateNameKind TNK,
                                      SourceLocation TemplateKWLoc,
                                      SourceLocation TemplateKWLoc,
                                      UnqualifiedId &TemplateName,
                                      UnqualifiedId &TemplateName,
                                      bool AllowTypeAnnotation) {
                                      bool AllowTypeAnnotation) {
-  assert(getLang().CPlusPlus && "Can only annotate template-ids in C++");
+  assert(getLangOpts().CPlusPlus && "Can only annotate template-ids in C++");
   assert(Template && Tok.is(tok::less) &&
   assert(Template && Tok.is(tok::less) &&
          "Parser isn't at the beginning of a template-id");
          "Parser isn't at the beginning of a template-id");
 
 

+ 11 - 11
lib/Parse/ParseTentative.cpp

@@ -149,7 +149,7 @@ Parser::TPResult Parser::TryParseSimpleDeclaration(bool AllowForRangeDecl) {
   else {
   else {
     ConsumeToken();
     ConsumeToken();
     
     
-    if (getLang().ObjC1 && Tok.is(tok::less))
+    if (getLangOpts().ObjC1 && Tok.is(tok::less))
       TryParseProtocolQualifiers();
       TryParseProtocolQualifiers();
   }
   }
   
   
@@ -258,7 +258,7 @@ bool Parser::isCXXConditionDeclaration() {
   else {
   else {
     ConsumeToken();
     ConsumeToken();
     
     
-    if (getLang().ObjC1 && Tok.is(tok::less))
+    if (getLangOpts().ObjC1 && Tok.is(tok::less))
       TryParseProtocolQualifiers();
       TryParseProtocolQualifiers();
   }
   }
   assert(Tok.is(tok::l_paren) && "Expected '('");
   assert(Tok.is(tok::l_paren) && "Expected '('");
@@ -276,7 +276,7 @@ bool Parser::isCXXConditionDeclaration() {
     if (Tok.is(tok::equal)  ||
     if (Tok.is(tok::equal)  ||
         Tok.is(tok::kw_asm) || Tok.is(tok::kw___attribute))
         Tok.is(tok::kw_asm) || Tok.is(tok::kw___attribute))
       TPR = TPResult::True();
       TPR = TPResult::True();
-    else if (getLang().CPlusPlus0x && Tok.is(tok::l_brace))
+    else if (getLangOpts().CPlusPlus0x && Tok.is(tok::l_brace))
       TPR = TPResult::True();
       TPR = TPResult::True();
     else
     else
       TPR = TPResult::False();
       TPR = TPResult::False();
@@ -335,7 +335,7 @@ bool Parser::isCXXTypeId(TentativeCXXTypeIdContext Context, bool &isAmbiguous) {
   else {
   else {
     ConsumeToken();
     ConsumeToken();
     
     
-    if (getLang().ObjC1 && Tok.is(tok::less))
+    if (getLangOpts().ObjC1 && Tok.is(tok::less))
       TryParseProtocolQualifiers();
       TryParseProtocolQualifiers();
   }
   }
   
   
@@ -360,7 +360,7 @@ bool Parser::isCXXTypeId(TentativeCXXTypeIdContext Context, bool &isAmbiguous) {
     // ',', this is a type-id. Otherwise, it's an expression.
     // ',', this is a type-id. Otherwise, it's an expression.
     } else if (Context == TypeIdAsTemplateArgument &&
     } else if (Context == TypeIdAsTemplateArgument &&
                (Tok.is(tok::greater) || Tok.is(tok::comma) ||
                (Tok.is(tok::greater) || Tok.is(tok::comma) ||
-                (getLang().CPlusPlus0x && Tok.is(tok::greatergreater)))) {
+                (getLangOpts().CPlusPlus0x && Tok.is(tok::greatergreater)))) {
       TPR = TPResult::True();
       TPR = TPResult::True();
       isAmbiguous = true;
       isAmbiguous = true;
 
 
@@ -430,7 +430,7 @@ bool Parser::isCXX0XAttributeSpecifier (bool CheckClosing,
     return false;
     return false;
   
   
   // No tentative parsing if we don't need to look for ]]
   // No tentative parsing if we don't need to look for ]]
-  if (!CheckClosing && !getLang().ObjC1)
+  if (!CheckClosing && !getLangOpts().ObjC1)
     return true;
     return true;
   
   
   struct TentativeReverter {
   struct TentativeReverter {
@@ -1005,7 +1005,7 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult) {
   case tok::annot_typename:
   case tok::annot_typename:
   case_typename:
   case_typename:
     // In Objective-C, we might have a protocol-qualified type.
     // In Objective-C, we might have a protocol-qualified type.
-    if (getLang().ObjC1 && NextToken().is(tok::less)) {
+    if (getLangOpts().ObjC1 && NextToken().is(tok::less)) {
       // Tentatively parse the 
       // Tentatively parse the 
       TentativeParsingAction PA(*this);
       TentativeParsingAction PA(*this);
       ConsumeToken(); // The type token
       ConsumeToken(); // The type token
@@ -1022,7 +1022,7 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult) {
       if (isFollowedByParen)
       if (isFollowedByParen)
         return TPResult::Ambiguous();
         return TPResult::Ambiguous();
 
 
-      if (getLang().CPlusPlus0x && isFollowedByBrace)
+      if (getLangOpts().CPlusPlus0x && isFollowedByBrace)
         return BracedCastResult;
         return BracedCastResult;
       
       
       return TPResult::True();
       return TPResult::True();
@@ -1053,7 +1053,7 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult) {
     //     enum E : int { a = 4 }; // enum
     //     enum E : int { a = 4 }; // enum
     //     enum E : int { 4 };     // bit-field
     //     enum E : int { 4 };     // bit-field
     //   };
     //   };
-    if (getLang().CPlusPlus0x && NextToken().is(tok::l_brace))
+    if (getLangOpts().CPlusPlus0x && NextToken().is(tok::l_brace))
       return BracedCastResult;
       return BracedCastResult;
 
 
     if (isStartOfObjCClassMessageMissingOpenBracket())
     if (isStartOfObjCClassMessageMissingOpenBracket())
@@ -1080,7 +1080,7 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult) {
     if (isFollowedByParen)
     if (isFollowedByParen)
       return TPResult::Ambiguous();
       return TPResult::Ambiguous();
 
 
-    if (getLang().CPlusPlus0x && isFollowedByBrace)
+    if (getLangOpts().CPlusPlus0x && isFollowedByBrace)
       return BracedCastResult;
       return BracedCastResult;
 
 
     return TPResult::True();
     return TPResult::True();
@@ -1150,7 +1150,7 @@ Parser::TPResult Parser::TryParseDeclarationSpecifier() {
   else {
   else {
     ConsumeToken();
     ConsumeToken();
     
     
-    if (getLang().ObjC1 && Tok.is(tok::less))
+    if (getLangOpts().ObjC1 && Tok.is(tok::less))
       TryParseProtocolQualifiers();
       TryParseProtocolQualifiers();
   }
   }
 
 

+ 30 - 30
lib/Parse/Parser.cpp

@@ -25,7 +25,7 @@ using namespace clang;
 
 
 IdentifierInfo *Parser::getSEHExceptKeyword() {
 IdentifierInfo *Parser::getSEHExceptKeyword() {
   // __except is accepted as a (contextual) keyword 
   // __except is accepted as a (contextual) keyword 
-  if (!Ident__except && (getLang().MicrosoftExt || getLang().Borland))
+  if (!Ident__except && (getLangOpts().MicrosoftExt || getLangOpts().Borland))
     Ident__except = PP.getIdentifierInfo("__except");
     Ident__except = PP.getIdentifierInfo("__except");
 
 
   return Ident__except;
   return Ident__except;
@@ -70,7 +70,7 @@ Parser::Parser(Preprocessor &pp, Sema &actions)
   FPContractHandler.reset(new PragmaFPContractHandler(actions, *this));
   FPContractHandler.reset(new PragmaFPContractHandler(actions, *this));
   PP.AddPragmaHandler("STDC", FPContractHandler.get());
   PP.AddPragmaHandler("STDC", FPContractHandler.get());
 
 
-  if (getLang().OpenCL) {
+  if (getLangOpts().OpenCL) {
     OpenCLExtensionHandler.reset(
     OpenCLExtensionHandler.reset(
                   new PragmaOpenCLExtensionHandler(actions, *this));
                   new PragmaOpenCLExtensionHandler(actions, *this));
     PP.AddPragmaHandler("OPENCL", OpenCLExtensionHandler.get());
     PP.AddPragmaHandler("OPENCL", OpenCLExtensionHandler.get());
@@ -388,7 +388,7 @@ Parser::~Parser() {
   PP.RemovePragmaHandler(RedefineExtnameHandler.get());
   PP.RemovePragmaHandler(RedefineExtnameHandler.get());
   RedefineExtnameHandler.reset();
   RedefineExtnameHandler.reset();
 
 
-  if (getLang().OpenCL) {
+  if (getLangOpts().OpenCL) {
     PP.RemovePragmaHandler("OPENCL", OpenCLExtensionHandler.get());
     PP.RemovePragmaHandler("OPENCL", OpenCLExtensionHandler.get());
     OpenCLExtensionHandler.reset();
     OpenCLExtensionHandler.reset();
     PP.RemovePragmaHandler("OPENCL", FPContractHandler.get());
     PP.RemovePragmaHandler("OPENCL", FPContractHandler.get());
@@ -411,12 +411,12 @@ void Parser::Initialize() {
   ConsumeToken();
   ConsumeToken();
 
 
   if (Tok.is(tok::eof) &&
   if (Tok.is(tok::eof) &&
-      !getLang().CPlusPlus)  // Empty source file is an extension in C
+      !getLangOpts().CPlusPlus)  // Empty source file is an extension in C
     Diag(Tok, diag::ext_empty_source_file);
     Diag(Tok, diag::ext_empty_source_file);
 
 
   // Initialization for Objective-C context sensitive keywords recognition.
   // Initialization for Objective-C context sensitive keywords recognition.
   // Referenced in Parser::ParseObjCTypeQualifierList.
   // Referenced in Parser::ParseObjCTypeQualifierList.
-  if (getLang().ObjC1) {
+  if (getLangOpts().ObjC1) {
     ObjCTypeQuals[objc_in] = &PP.getIdentifierTable().get("in");
     ObjCTypeQuals[objc_in] = &PP.getIdentifierTable().get("in");
     ObjCTypeQuals[objc_out] = &PP.getIdentifierTable().get("out");
     ObjCTypeQuals[objc_out] = &PP.getIdentifierTable().get("out");
     ObjCTypeQuals[objc_inout] = &PP.getIdentifierTable().get("inout");
     ObjCTypeQuals[objc_inout] = &PP.getIdentifierTable().get("inout");
@@ -431,7 +431,7 @@ void Parser::Initialize() {
 
 
   Ident_super = &PP.getIdentifierTable().get("super");
   Ident_super = &PP.getIdentifierTable().get("super");
 
 
-  if (getLang().AltiVec) {
+  if (getLangOpts().AltiVec) {
     Ident_vector = &PP.getIdentifierTable().get("vector");
     Ident_vector = &PP.getIdentifierTable().get("vector");
     Ident_pixel = &PP.getIdentifierTable().get("pixel");
     Ident_pixel = &PP.getIdentifierTable().get("pixel");
   }
   }
@@ -447,7 +447,7 @@ void Parser::Initialize() {
   Ident___exception_code = Ident___exception_info = Ident___abnormal_termination = 0;
   Ident___exception_code = Ident___exception_info = Ident___abnormal_termination = 0;
   Ident_GetExceptionCode = Ident_GetExceptionInfo = Ident_AbnormalTermination = 0;
   Ident_GetExceptionCode = Ident_GetExceptionInfo = Ident_AbnormalTermination = 0;
 
 
-  if(getLang().Borland) {
+  if(getLangOpts().Borland) {
     Ident__exception_info        = PP.getIdentifierInfo("_exception_info");
     Ident__exception_info        = PP.getIdentifierInfo("_exception_info");
     Ident___exception_info       = PP.getIdentifierInfo("__exception_info");
     Ident___exception_info       = PP.getIdentifierInfo("__exception_info");
     Ident_GetExceptionInfo       = PP.getIdentifierInfo("GetExceptionInformation");
     Ident_GetExceptionInfo       = PP.getIdentifierInfo("GetExceptionInformation");
@@ -481,7 +481,7 @@ bool Parser::ParseTopLevelDecl(DeclGroupPtrTy &Result) {
   Result = DeclGroupPtrTy();
   Result = DeclGroupPtrTy();
   if (Tok.is(tok::eof)) {
   if (Tok.is(tok::eof)) {
     // Late template parsing can begin.
     // Late template parsing can begin.
-    if (getLang().DelayedTemplateParsing)
+    if (getLangOpts().DelayedTemplateParsing)
       Actions.SetLateTemplateParser(LateTemplateParserCallback, this);
       Actions.SetLateTemplateParser(LateTemplateParserCallback, this);
 
 
     Actions.ActOnEndOfTranslationUnit();
     Actions.ActOnEndOfTranslationUnit();
@@ -553,7 +553,7 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs,
     HandlePragmaPack();
     HandlePragmaPack();
     return DeclGroupPtrTy();
     return DeclGroupPtrTy();
   case tok::semi:
   case tok::semi:
-    Diag(Tok, getLang().CPlusPlus0x ?
+    Diag(Tok, getLangOpts().CPlusPlus0x ?
          diag::warn_cxx98_compat_top_level_semi : diag::ext_top_level_semi)
          diag::warn_cxx98_compat_top_level_semi : diag::ext_top_level_semi)
       << FixItHint::CreateRemoval(Tok.getLocation());
       << FixItHint::CreateRemoval(Tok.getLocation());
 
 
@@ -592,7 +592,7 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs,
     return ParseObjCAtDirectives();
     return ParseObjCAtDirectives();
   case tok::minus:
   case tok::minus:
   case tok::plus:
   case tok::plus:
-    if (!getLang().ObjC1) {
+    if (!getLangOpts().ObjC1) {
       Diag(Tok, diag::err_expected_external_declaration);
       Diag(Tok, diag::err_expected_external_declaration);
       ConsumeToken();
       ConsumeToken();
       return DeclGroupPtrTy();
       return DeclGroupPtrTy();
@@ -622,7 +622,7 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs,
   case tok::kw_static:
   case tok::kw_static:
     // Parse (then ignore) 'static' prior to a template instantiation. This is
     // Parse (then ignore) 'static' prior to a template instantiation. This is
     // a GCC extension that we intentionally do not support.
     // a GCC extension that we intentionally do not support.
-    if (getLang().CPlusPlus && NextToken().is(tok::kw_template)) {
+    if (getLangOpts().CPlusPlus && NextToken().is(tok::kw_template)) {
       Diag(ConsumeToken(), diag::warn_static_inline_explicit_inst_ignored)
       Diag(ConsumeToken(), diag::warn_static_inline_explicit_inst_ignored)
         << 0;
         << 0;
       SourceLocation DeclEnd;
       SourceLocation DeclEnd;
@@ -632,7 +632,7 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs,
     goto dont_know;
     goto dont_know;
       
       
   case tok::kw_inline:
   case tok::kw_inline:
-    if (getLang().CPlusPlus) {
+    if (getLangOpts().CPlusPlus) {
       tok::TokenKind NextKind = NextToken().getKind();
       tok::TokenKind NextKind = NextToken().getKind();
       
       
       // Inline namespaces. Allowed as an extension even in C++03.
       // Inline namespaces. Allowed as an extension even in C++03.
@@ -655,11 +655,11 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs,
     goto dont_know;
     goto dont_know;
 
 
   case tok::kw_extern:
   case tok::kw_extern:
-    if (getLang().CPlusPlus && NextToken().is(tok::kw_template)) {
+    if (getLangOpts().CPlusPlus && NextToken().is(tok::kw_template)) {
       // Extern templates
       // Extern templates
       SourceLocation ExternLoc = ConsumeToken();
       SourceLocation ExternLoc = ConsumeToken();
       SourceLocation TemplateLoc = ConsumeToken();
       SourceLocation TemplateLoc = ConsumeToken();
-      Diag(ExternLoc, getLang().CPlusPlus0x ?
+      Diag(ExternLoc, getLangOpts().CPlusPlus0x ?
              diag::warn_cxx98_compat_extern_template :
              diag::warn_cxx98_compat_extern_template :
              diag::ext_extern_template) << SourceRange(ExternLoc, TemplateLoc);
              diag::ext_extern_template) << SourceRange(ExternLoc, TemplateLoc);
       SourceLocation DeclEnd;
       SourceLocation DeclEnd;
@@ -695,7 +695,7 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs,
 /// declarator, continues a declaration or declaration list.
 /// declarator, continues a declaration or declaration list.
 bool Parser::isDeclarationAfterDeclarator() {
 bool Parser::isDeclarationAfterDeclarator() {
   // Check for '= delete' or '= default'
   // Check for '= delete' or '= default'
-  if (getLang().CPlusPlus && Tok.is(tok::equal)) {
+  if (getLangOpts().CPlusPlus && Tok.is(tok::equal)) {
     const Token &KW = NextToken();
     const Token &KW = NextToken();
     if (KW.is(tok::kw_default) || KW.is(tok::kw_delete))
     if (KW.is(tok::kw_default) || KW.is(tok::kw_delete))
       return false;
       return false;
@@ -706,7 +706,7 @@ bool Parser::isDeclarationAfterDeclarator() {
     Tok.is(tok::semi)  ||           // int X();  -> not a function def
     Tok.is(tok::semi)  ||           // int X();  -> not a function def
     Tok.is(tok::kw_asm) ||          // int X() __asm__ -> not a function def
     Tok.is(tok::kw_asm) ||          // int X() __asm__ -> not a function def
     Tok.is(tok::kw___attribute) ||  // int X() __attr__ -> not a function def
     Tok.is(tok::kw___attribute) ||  // int X() __attr__ -> not a function def
-    (getLang().CPlusPlus &&
+    (getLangOpts().CPlusPlus &&
      Tok.is(tok::l_paren));         // int X(0) -> not a function def [C++]
      Tok.is(tok::l_paren));         // int X(0) -> not a function def [C++]
 }
 }
 
 
@@ -718,11 +718,11 @@ bool Parser::isStartOfFunctionDefinition(const ParsingDeclarator &Declarator) {
     return true;
     return true;
   
   
   // Handle K&R C argument lists: int X(f) int f; {}
   // Handle K&R C argument lists: int X(f) int f; {}
-  if (!getLang().CPlusPlus &&
+  if (!getLangOpts().CPlusPlus &&
       Declarator.getFunctionTypeInfo().isKNRPrototype()) 
       Declarator.getFunctionTypeInfo().isKNRPrototype()) 
     return isDeclarationSpecifier();
     return isDeclarationSpecifier();
 
 
-  if (getLang().CPlusPlus && Tok.is(tok::equal)) {
+  if (getLangOpts().CPlusPlus && Tok.is(tok::equal)) {
     const Token &KW = NextToken();
     const Token &KW = NextToken();
     return KW.is(tok::kw_default) || KW.is(tok::kw_delete);
     return KW.is(tok::kw_default) || KW.is(tok::kw_delete);
   }
   }
@@ -765,7 +765,7 @@ Parser::ParseDeclarationOrFunctionDefinition(ParsingDeclSpec &DS,
   // ObjC2 allows prefix attributes on class interfaces and protocols.
   // ObjC2 allows prefix attributes on class interfaces and protocols.
   // FIXME: This still needs better diagnostics. We should only accept
   // FIXME: This still needs better diagnostics. We should only accept
   // attributes here, no types, etc.
   // attributes here, no types, etc.
-  if (getLang().ObjC2 && Tok.is(tok::at)) {
+  if (getLangOpts().ObjC2 && Tok.is(tok::at)) {
     SourceLocation AtLoc = ConsumeToken(); // the "@"
     SourceLocation AtLoc = ConsumeToken(); // the "@"
     if (!Tok.isObjCAtKeyword(tok::objc_interface) &&
     if (!Tok.isObjCAtKeyword(tok::objc_interface) &&
         !Tok.isObjCAtKeyword(tok::objc_protocol)) {
         !Tok.isObjCAtKeyword(tok::objc_protocol)) {
@@ -791,7 +791,7 @@ Parser::ParseDeclarationOrFunctionDefinition(ParsingDeclSpec &DS,
   // If the declspec consisted only of 'extern' and we have a string
   // If the declspec consisted only of 'extern' and we have a string
   // literal following it, this must be a C++ linkage specifier like
   // literal following it, this must be a C++ linkage specifier like
   // 'extern "C"'.
   // 'extern "C"'.
-  if (Tok.is(tok::string_literal) && getLang().CPlusPlus &&
+  if (Tok.is(tok::string_literal) && getLangOpts().CPlusPlus &&
       DS.getStorageClassSpec() == DeclSpec::SCS_extern &&
       DS.getStorageClassSpec() == DeclSpec::SCS_extern &&
       DS.getParsedSpecifiers() == DeclSpec::PQ_StorageClassSpecifier) {
       DS.getParsedSpecifiers() == DeclSpec::PQ_StorageClassSpecifier) {
     Decl *TheDecl = ParseLinkage(DS, Declarator::FileContext);
     Decl *TheDecl = ParseLinkage(DS, Declarator::FileContext);
@@ -838,7 +838,7 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D,
   // If this is C90 and the declspecs were completely missing, fudge in an
   // If this is C90 and the declspecs were completely missing, fudge in an
   // implicit int.  We do this here because this is the only place where
   // implicit int.  We do this here because this is the only place where
   // declaration-specifiers are completely optional in the grammar.
   // declaration-specifiers are completely optional in the grammar.
-  if (getLang().ImplicitInt && D.getDeclSpec().isEmpty()) {
+  if (getLangOpts().ImplicitInt && D.getDeclSpec().isEmpty()) {
     const char *PrevSpec;
     const char *PrevSpec;
     unsigned DiagID;
     unsigned DiagID;
     D.getMutableDeclSpec().SetTypeSpecType(DeclSpec::TST_int,
     D.getMutableDeclSpec().SetTypeSpecType(DeclSpec::TST_int,
@@ -856,7 +856,7 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D,
   // We should have either an opening brace or, in a C++ constructor,
   // We should have either an opening brace or, in a C++ constructor,
   // we may have a colon.
   // we may have a colon.
   if (Tok.isNot(tok::l_brace) && 
   if (Tok.isNot(tok::l_brace) && 
-      (!getLang().CPlusPlus ||
+      (!getLangOpts().CPlusPlus ||
        (Tok.isNot(tok::colon) && Tok.isNot(tok::kw_try) &&
        (Tok.isNot(tok::colon) && Tok.isNot(tok::kw_try) &&
         Tok.isNot(tok::equal)))) {
         Tok.isNot(tok::equal)))) {
     Diag(Tok, diag::err_expected_fn_body);
     Diag(Tok, diag::err_expected_fn_body);
@@ -884,7 +884,7 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D,
 
 
   // In delayed template parsing mode, for function template we consume the
   // In delayed template parsing mode, for function template we consume the
   // tokens and store them for late parsing at the end of the translation unit.
   // tokens and store them for late parsing at the end of the translation unit.
-  if (getLang().DelayedTemplateParsing &&
+  if (getLangOpts().DelayedTemplateParsing &&
       TemplateInfo.Kind == ParsedTemplateInfo::Template) {
       TemplateInfo.Kind == ParsedTemplateInfo::Template) {
     MultiTemplateParamsArg TemplateParameterLists(Actions,
     MultiTemplateParamsArg TemplateParameterLists(Actions,
                                          TemplateInfo.TemplateParams->data(),
                                          TemplateInfo.TemplateParams->data(),
@@ -940,7 +940,7 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D,
   D.getMutableDeclSpec().abort();
   D.getMutableDeclSpec().abort();
 
 
   if (Tok.is(tok::equal)) {
   if (Tok.is(tok::equal)) {
-    assert(getLang().CPlusPlus && "Only C++ function definitions have '='");
+    assert(getLangOpts().CPlusPlus && "Only C++ function definitions have '='");
     ConsumeToken();
     ConsumeToken();
 
 
     Actions.ActOnFinishFunctionBody(Res, 0, false);
     Actions.ActOnFinishFunctionBody(Res, 0, false);
@@ -948,7 +948,7 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D,
     bool Delete = false;
     bool Delete = false;
     SourceLocation KWLoc;
     SourceLocation KWLoc;
     if (Tok.is(tok::kw_delete)) {
     if (Tok.is(tok::kw_delete)) {
-      Diag(Tok, getLang().CPlusPlus0x ?
+      Diag(Tok, getLangOpts().CPlusPlus0x ?
            diag::warn_cxx98_compat_deleted_function :
            diag::warn_cxx98_compat_deleted_function :
            diag::ext_deleted_function);
            diag::ext_deleted_function);
 
 
@@ -956,7 +956,7 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D,
       Actions.SetDeclDeleted(Res, KWLoc);
       Actions.SetDeclDeleted(Res, KWLoc);
       Delete = true;
       Delete = true;
     } else if (Tok.is(tok::kw_default)) {
     } else if (Tok.is(tok::kw_default)) {
-      Diag(Tok, getLang().CPlusPlus0x ?
+      Diag(Tok, getLangOpts().CPlusPlus0x ?
            diag::warn_cxx98_compat_defaulted_function :
            diag::warn_cxx98_compat_defaulted_function :
            diag::ext_defaulted_function);
            diag::ext_defaulted_function);
 
 
@@ -1240,7 +1240,7 @@ bool Parser::TryAnnotateTypeOrScopeToken(bool EnteringContext, bool NeedType) {
                                        0, /*IsTypename*/true))
                                        0, /*IsTypename*/true))
       return true;
       return true;
     if (!SS.isSet()) {
     if (!SS.isSet()) {
-      if (getLang().MicrosoftExt)
+      if (getLangOpts().MicrosoftExt)
         Diag(Tok.getLocation(), diag::warn_expected_qualified_after_typename);
         Diag(Tok.getLocation(), diag::warn_expected_qualified_after_typename);
       else
       else
         Diag(Tok.getLocation(), diag::err_expected_qualified_after_typename);
         Diag(Tok.getLocation(), diag::err_expected_qualified_after_typename);
@@ -1291,7 +1291,7 @@ bool Parser::TryAnnotateTypeOrScopeToken(bool EnteringContext, bool NeedType) {
   bool wasScopeAnnotation = Tok.is(tok::annot_cxxscope);
   bool wasScopeAnnotation = Tok.is(tok::annot_cxxscope);
 
 
   CXXScopeSpec SS;
   CXXScopeSpec SS;
-  if (getLang().CPlusPlus)
+  if (getLangOpts().CPlusPlus)
     if (ParseOptionalCXXScopeSpecifier(SS, ParsedType(), EnteringContext))
     if (ParseOptionalCXXScopeSpecifier(SS, ParsedType(), EnteringContext))
       return true;
       return true;
 
 
@@ -1323,7 +1323,7 @@ bool Parser::TryAnnotateTypeOrScopeToken(bool EnteringContext, bool NeedType) {
       return false;
       return false;
     }
     }
 
 
-    if (!getLang().CPlusPlus) {
+    if (!getLangOpts().CPlusPlus) {
       // If we're in C, we can't have :: tokens at all (the lexer won't return
       // If we're in C, we can't have :: tokens at all (the lexer won't return
       // them).  If the identifier is not a type, then it can't be scope either,
       // them).  If the identifier is not a type, then it can't be scope either,
       // just early exit.
       // just early exit.
@@ -1402,7 +1402,7 @@ bool Parser::TryAnnotateTypeOrScopeToken(bool EnteringContext, bool NeedType) {
 /// Note that this routine emits an error if you call it with ::new or ::delete
 /// Note that this routine emits an error if you call it with ::new or ::delete
 /// as the current tokens, so only call it in contexts where these are invalid.
 /// as the current tokens, so only call it in contexts where these are invalid.
 bool Parser::TryAnnotateCXXScopeToken(bool EnteringContext) {
 bool Parser::TryAnnotateCXXScopeToken(bool EnteringContext) {
-  assert(getLang().CPlusPlus &&
+  assert(getLangOpts().CPlusPlus &&
          "Call sites of this function should be guarded by checking for C++");
          "Call sites of this function should be guarded by checking for C++");
   assert((Tok.is(tok::identifier) || Tok.is(tok::coloncolon) ||
   assert((Tok.is(tok::identifier) || Tok.is(tok::coloncolon) ||
           (Tok.is(tok::annot_template_id) && NextToken().is(tok::coloncolon)) ||
           (Tok.is(tok::annot_template_id) && NextToken().is(tok::coloncolon)) ||

+ 1 - 1
lib/Rewrite/HTMLPrint.cpp

@@ -55,7 +55,7 @@ ASTConsumer* clang::CreateHTMLPrinter(raw_ostream *OS,
 }
 }
 
 
 void HTMLPrinter::Initialize(ASTContext &context) {
 void HTMLPrinter::Initialize(ASTContext &context) {
-  R.setSourceMgr(context.getSourceManager(), context.getLangOptions());
+  R.setSourceMgr(context.getSourceManager(), context.getLangOpts());
 }
 }
 
 
 void HTMLPrinter::HandleTranslationUnit(ASTContext &Ctx) {
 void HTMLPrinter::HandleTranslationUnit(ASTContext &Ctx) {

+ 2 - 2
lib/Rewrite/HTMLRewrite.cpp

@@ -360,7 +360,7 @@ void html::SyntaxHighlight(Rewriter &R, FileID FID, const Preprocessor &PP) {
 
 
   const SourceManager &SM = PP.getSourceManager();
   const SourceManager &SM = PP.getSourceManager();
   const llvm::MemoryBuffer *FromFile = SM.getBuffer(FID);
   const llvm::MemoryBuffer *FromFile = SM.getBuffer(FID);
-  Lexer L(FID, FromFile, SM, PP.getLangOptions());
+  Lexer L(FID, FromFile, SM, PP.getLangOpts());
   const char *BufferStart = L.getBufferStart();
   const char *BufferStart = L.getBufferStart();
 
 
   // Inform the preprocessor that we want to retain comments as tokens, so we
   // Inform the preprocessor that we want to retain comments as tokens, so we
@@ -450,7 +450,7 @@ void html::HighlightMacros(Rewriter &R, FileID FID, const Preprocessor& PP) {
   std::vector<Token> TokenStream;
   std::vector<Token> TokenStream;
 
 
   const llvm::MemoryBuffer *FromFile = SM.getBuffer(FID);
   const llvm::MemoryBuffer *FromFile = SM.getBuffer(FID);
-  Lexer L(FID, FromFile, SM, PP.getLangOptions());
+  Lexer L(FID, FromFile, SM, PP.getLangOpts());
 
 
   // Lex all the tokens in raw mode, to avoid entering #includes or expanding
   // Lex all the tokens in raw mode, to avoid entering #includes or expanding
   // macros.
   // macros.

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff