diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-03-11 07:00:24 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-03-11 07:00:24 +0000 |
commit | 4e4d08403ca5cfd4d558fa2936215d3a4e5a528d (patch) | |
tree | bc9bf6ce1639dc8a7ba02d0e3046ab14b5329d8c /lib/ARCMigrate | |
parent | 7c02cfeb0861278c09ba05d1b92bd2a996bbe2e0 (diff) |
Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).
The member variable is always "LangOpts" and the member function is always "getLangOpts".
Reviewed by Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152536 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ARCMigrate')
-rw-r--r-- | lib/ARCMigrate/ARCMT.cpp | 14 | ||||
-rw-r--r-- | lib/ARCMigrate/ObjCMT.cpp | 4 | ||||
-rw-r--r-- | lib/ARCMigrate/TransBlockObjCVariable.cpp | 2 | ||||
-rw-r--r-- | lib/ARCMigrate/TransGCAttrs.cpp | 2 | ||||
-rw-r--r-- | lib/ARCMigrate/TransRetainReleaseDealloc.cpp | 2 | ||||
-rw-r--r-- | lib/ARCMigrate/Transforms.cpp | 14 |
6 files changed, 19 insertions, 19 deletions
diff --git a/lib/ARCMigrate/ARCMT.cpp b/lib/ARCMigrate/ARCMT.cpp index 07f22c4f36..9354dc38b8 100644 --- a/lib/ARCMigrate/ARCMT.cpp +++ b/lib/ARCMigrate/ARCMT.cpp @@ -211,7 +211,7 @@ static void emitPremigrationErrors(const CapturedDiagList &arcDiags, new DiagnosticsEngine(DiagID, &printer, /*ShouldOwnClient=*/false)); Diags->setSourceManager(&PP.getSourceManager()); - printer.BeginSourceFile(PP.getLangOptions(), &PP); + printer.BeginSourceFile(PP.getLangOpts(), &PP); arcDiags.reportDiagnostics(*Diags); printer.EndSourceFile(); } @@ -264,7 +264,7 @@ bool arcmt::checkForManualIssues(CompilerInvocation &origCI, if (Diags->hasFatalErrorOccurred()) { Diags->Reset(); - DiagClient->BeginSourceFile(Ctx.getLangOptions(), &Unit->getPreprocessor()); + DiagClient->BeginSourceFile(Ctx.getLangOpts(), &Unit->getPreprocessor()); capturedDiags.reportDiagnostics(*Diags); DiagClient->EndSourceFile(); return true; @@ -279,7 +279,7 @@ bool arcmt::checkForManualIssues(CompilerInvocation &origCI, I = capturedDiags.begin(), E = capturedDiags.end(); I != E; ++I) arcDiags.push_back(*I); writeARCDiagsToPlist(plistOut, arcDiags, - Ctx.getSourceManager(), Ctx.getLangOptions()); + Ctx.getSourceManager(), Ctx.getLangOpts()); } // 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 // diagnostics with source range information are emitted only in between // 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 // source code. @@ -573,7 +573,7 @@ bool MigrationProcess::applyTransform(TransformFn trans, if (Diags->hasFatalErrorOccurred()) { Diags->Reset(); - DiagClient->BeginSourceFile(Ctx.getLangOptions(), &Unit->getPreprocessor()); + DiagClient->BeginSourceFile(Ctx.getLangOpts(), &Unit->getPreprocessor()); capturedDiags.reportDiagnostics(*Diags); DiagClient->EndSourceFile(); return true; @@ -584,9 +584,9 @@ bool MigrationProcess::applyTransform(TransformFn trans, // We call BeginSourceFile because DiagnosticConsumer requires that // diagnostics with source range information are emitted only in between // 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()); MigrationPass pass(Ctx, OrigCI.getLangOpts()->getGC(), Unit->getSema(), TA, ARCMTMacroLocs); diff --git a/lib/ARCMigrate/ObjCMT.cpp b/lib/ARCMigrate/ObjCMT.cpp index 497377a394..e635274476 100644 --- a/lib/ARCMigrate/ObjCMT.cpp +++ b/lib/ARCMigrate/ObjCMT.cpp @@ -58,7 +58,7 @@ protected: virtual void Initialize(ASTContext &Context) { NSAPIObj.reset(new NSAPI(Context)); Editor.reset(new edit::EditedSource(Context.getSourceManager(), - Context.getLangOptions(), + Context.getLangOpts(), PPRec)); } @@ -180,7 +180,7 @@ public: } void ObjCMigrateASTConsumer::HandleTranslationUnit(ASTContext &Ctx) { - Rewriter rewriter(Ctx.getSourceManager(), Ctx.getLangOptions()); + Rewriter rewriter(Ctx.getSourceManager(), Ctx.getLangOpts()); RewritesReceiver Rec(rewriter); Editor->applyRewrites(Rec); diff --git a/lib/ARCMigrate/TransBlockObjCVariable.cpp b/lib/ARCMigrate/TransBlockObjCVariable.cpp index 845da159a1..3be8132e3b 100644 --- a/lib/ARCMigrate/TransBlockObjCVariable.cpp +++ b/lib/ARCMigrate/TransBlockObjCVariable.cpp @@ -54,7 +54,7 @@ class RootBlockObjCVarRewriter : if (castE->getCastKind() == CK_LValueToRValue) return true; // Using the value of the variable. if (castE->getCastKind() == CK_NoOp && castE->isLValue() && - Var->getASTContext().getLangOptions().CPlusPlus) + Var->getASTContext().getLangOpts().CPlusPlus) return true; // Binding to const C++ reference. } } diff --git a/lib/ARCMigrate/TransGCAttrs.cpp b/lib/ARCMigrate/TransGCAttrs.cpp index b0dadc2e2e..9f6066ef77 100644 --- a/lib/ARCMigrate/TransGCAttrs.cpp +++ b/lib/ARCMigrate/TransGCAttrs.cpp @@ -97,7 +97,7 @@ public: bool Invalid = false; StringRef Spell = Lexer::getSpelling( SM.getSpellingLoc(TL.getAttrEnumOperandLoc()), - Buf, SM, Ctx.getLangOptions(), &Invalid); + Buf, SM, Ctx.getLangOpts(), &Invalid); if (Invalid) return false; MigrationContext::GCAttrOccurrence::AttrKind Kind; diff --git a/lib/ARCMigrate/TransRetainReleaseDealloc.cpp b/lib/ARCMigrate/TransRetainReleaseDealloc.cpp index 15669ac973..11a6553341 100644 --- a/lib/ARCMigrate/TransRetainReleaseDealloc.cpp +++ b/lib/ARCMigrate/TransRetainReleaseDealloc.cpp @@ -173,7 +173,7 @@ private: return; SourceManager &SM = Pass.Ctx.getSourceManager(); StringRef MacroName = Lexer::getImmediateMacroName(Loc, SM, - Pass.Ctx.getLangOptions()); + Pass.Ctx.getLangOpts()); bool isGCDOrXPC = llvm::StringSwitch<bool>(MacroName) .Case("dispatch_retain", true) .Case("dispatch_release", true) diff --git a/lib/ARCMigrate/Transforms.cpp b/lib/ARCMigrate/Transforms.cpp index 45a8c989ef..c0adf16a11 100644 --- a/lib/ARCMigrate/Transforms.cpp +++ b/lib/ARCMigrate/Transforms.cpp @@ -67,7 +67,7 @@ static bool isClassInWeakBlacklist(ObjCInterfaceDecl *cls) { bool trans::canApplyWeak(ASTContext &Ctx, QualType type, bool AllowOnUnknownClass) { - if (!Ctx.getLangOptions().ObjCRuntimeHasWeak) + if (!Ctx.getLangOpts().ObjCRuntimeHasWeak) return false; QualType T = type; @@ -111,10 +111,10 @@ SourceLocation trans::findSemiAfterLocation(SourceLocation loc, ASTContext &Ctx) { SourceManager &SM = Ctx.getSourceManager(); if (loc.isMacroID()) { - if (!Lexer::isAtEndOfMacroExpansion(loc, SM, Ctx.getLangOptions(), &loc)) + if (!Lexer::isAtEndOfMacroExpansion(loc, SM, Ctx.getLangOpts(), &loc)) 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. 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. Lexer lexer(SM.getLocForStartOfFile(locInfo.first), - Ctx.getLangOptions(), + Ctx.getLangOpts(), file.begin(), tokenBegin, file.end()); Token tok; lexer.LexFromRawLexer(tok); @@ -375,7 +375,7 @@ bool MigrationContext::rewritePropertyAttribute(StringRef fromAttr, // Lex from the start of the given location. Lexer lexer(SM.getLocForStartOfFile(locInfo.first), - Pass.Ctx.getLangOptions(), + Pass.Ctx.getLangOpts(), file.begin(), tokenBegin, file.end()); Token tok; lexer.LexFromRawLexer(tok); @@ -458,7 +458,7 @@ bool MigrationContext::addPropertyAttribute(StringRef attr, // Lex from the start of the given location. Lexer lexer(SM.getLocForStartOfFile(locInfo.first), - Pass.Ctx.getLangOptions(), + Pass.Ctx.getLangOpts(), file.begin(), tokenBegin, file.end()); Token tok; lexer.LexFromRawLexer(tok); @@ -520,7 +520,7 @@ static void GCRewriteFinalize(MigrationPass &pass) { "#if !__has_feature(objc_arc)\n"); CharSourceRange::getTokenRange(FinalizeM->getSourceRange()); const SourceManager &SM = pass.Ctx.getSourceManager(); - const LangOptions &LangOpts = pass.Ctx.getLangOptions(); + const LangOptions &LangOpts = pass.Ctx.getLangOpts(); bool Invalid; std::string str = "\n#endif\n"; str += Lexer::getSourceText( |