Author: steveire Date: Thu Aug 9 14:05:56 2018 New Revision: 339384 URL: http://llvm.org/viewvc/llvm-project?rev=339384&view=rev Log: Port getStartLoc -> getBeginLoc
Reviewers: teemperor! Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50349 Modified: cfe/trunk/include/clang/AST/Decl.h cfe/trunk/lib/AST/ASTImporter.cpp cfe/trunk/lib/Analysis/CloneDetection.cpp cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp cfe/trunk/lib/Sema/SemaStmt.cpp cfe/trunk/lib/Sema/TreeTransform.h cfe/trunk/lib/Serialization/ASTWriterStmt.cpp cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp Modified: cfe/trunk/include/clang/AST/Decl.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=339384&r1=339383&r2=339384&view=diff ============================================================================== --- cfe/trunk/include/clang/AST/Decl.h (original) +++ cfe/trunk/include/clang/AST/Decl.h Thu Aug 9 14:05:56 2018 @@ -81,7 +81,7 @@ class VarTemplateDecl; /// A client can read the relevant info using TypeLoc wrappers, e.g: /// @code /// TypeLoc TL = TypeSourceInfo->getTypeLoc(); -/// TL.getStartLoc().print(OS, SrcMgr); +/// TL.getBeginLoc().print(OS, SrcMgr); /// @endcode class alignas(8) TypeSourceInfo { // Contains a memory block after the class, used for type source information, Modified: cfe/trunk/lib/AST/ASTImporter.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=339384&r1=339383&r2=339384&view=diff ============================================================================== --- cfe/trunk/lib/AST/ASTImporter.cpp (original) +++ cfe/trunk/lib/AST/ASTImporter.cpp Thu Aug 9 14:05:56 2018 @@ -5011,7 +5011,7 @@ Stmt *ASTNodeImporter::VisitDeclStmt(Dec if (!ToD) return nullptr; } - SourceLocation ToStartLoc = Importer.Import(S->getStartLoc()); + SourceLocation ToStartLoc = Importer.Import(S->getBeginLoc()); SourceLocation ToEndLoc = Importer.Import(S->getEndLoc()); return new (Importer.getToContext()) DeclStmt(ToDG, ToStartLoc, ToEndLoc); } Modified: cfe/trunk/lib/Analysis/CloneDetection.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CloneDetection.cpp?rev=339384&r1=339383&r2=339384&view=diff ============================================================================== --- cfe/trunk/lib/Analysis/CloneDetection.cpp (original) +++ cfe/trunk/lib/Analysis/CloneDetection.cpp Thu Aug 9 14:05:56 2018 @@ -45,8 +45,8 @@ bool StmtSequence::contains(const StmtSe // Otherwise check if the start and end locations of the current sequence // surround the other sequence. bool StartIsInBounds = - SM.isBeforeInTranslationUnit(getStartLoc(), Other.getStartLoc()) || - getStartLoc() == Other.getStartLoc(); + SM.isBeforeInTranslationUnit(getBeginLoc(), Other.getBeginLoc()) || + getBeginLoc() == Other.getBeginLoc(); if (!StartIsInBounds) return false; @@ -84,7 +84,7 @@ SourceLocation StmtSequence::getBeginLoc SourceLocation StmtSequence::getEndLoc() const { return back()->getLocEnd(); } SourceRange StmtSequence::getSourceRange() const { - return SourceRange(getStartLoc(), getEndLoc()); + return SourceRange(getBeginLoc(), getEndLoc()); } void CloneDetector::analyzeCodeBody(const Decl *D) { @@ -433,7 +433,7 @@ size_t MinComplexityConstraint::calculat // Look up what macros expanded into the current statement. std::string MacroStack = - data_collection::getMacroStack(Seq.getStartLoc(), Context); + data_collection::getMacroStack(Seq.getBeginLoc(), Context); // First, check if ParentMacroStack is not empty which means we are currently // dealing with a parent statement which was expanded from a macro. Modified: cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp?rev=339384&r1=339383&r2=339384&view=diff ============================================================================== --- cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp (original) +++ cfe/trunk/lib/CodeGen/CoverageMappingGen.cpp Thu Aug 9 14:05:56 2018 @@ -117,7 +117,7 @@ struct SpellingRegion { } SpellingRegion(SourceManager &SM, SourceMappingRegion &R) - : SpellingRegion(SM, R.getStartLoc(), R.getEndLoc()) {} + : SpellingRegion(SM, R.getBeginLoc(), R.getEndLoc()) {} /// Check if the start and end locations appear in source order, i.e /// top->bottom, left->right. @@ -230,7 +230,7 @@ public: llvm::SmallSet<FileID, 8> Visited; SmallVector<std::pair<SourceLocation, unsigned>, 8> FileLocs; for (const auto &Region : SourceRegions) { - SourceLocation Loc = Region.getStartLoc(); + SourceLocation Loc = Region.getBeginLoc(); FileID File = SM.getFileID(Loc); if (!Visited.insert(File).second) continue; @@ -312,7 +312,7 @@ public: for (const auto &Region : SourceRegions) { assert(Region.hasEndLoc() && "incomplete region"); - SourceLocation LocStart = Region.getStartLoc(); + SourceLocation LocStart = Region.getBeginLoc(); assert(SM.getFileID(LocStart).isValid() && "region in invalid file"); // Ignore regions from system headers. @@ -503,7 +503,7 @@ struct CounterCoverageMappingBuilder DeferredRegion = None; // If the region ends in an expansion, find the expansion site. - FileID StartFile = SM.getFileID(DR.getStartLoc()); + FileID StartFile = SM.getFileID(DR.getBeginLoc()); if (SM.getFileID(DeferredEndLoc) != StartFile) { if (isNestedIn(DeferredEndLoc, StartFile)) { do { @@ -516,12 +516,12 @@ struct CounterCoverageMappingBuilder // The parent of this deferred region ends where the containing decl ends, // so the region isn't useful. - if (DR.getStartLoc() == DeferredEndLoc) + if (DR.getBeginLoc() == DeferredEndLoc) return Index; // If we're visiting statements in non-source order (e.g switch cases or // a loop condition) we can't construct a sensible deferred region. - if (!SpellingRegion(SM, DR.getStartLoc(), DeferredEndLoc).isInSourceOrder()) + if (!SpellingRegion(SM, DR.getBeginLoc(), DeferredEndLoc).isInSourceOrder()) return Index; DR.setGap(true); @@ -563,7 +563,7 @@ struct CounterCoverageMappingBuilder while (RegionStack.size() > ParentIndex) { SourceMappingRegion &Region = RegionStack.back(); if (Region.hasStartLoc()) { - SourceLocation StartLoc = Region.getStartLoc(); + SourceLocation StartLoc = Region.getBeginLoc(); SourceLocation EndLoc = Region.hasEndLoc() ? Region.getEndLoc() : RegionStack[ParentIndex].getEndLoc(); @@ -589,7 +589,7 @@ struct CounterCoverageMappingBuilder EndLoc == getEndOfFileOrMacro(EndLoc)) MostRecentLocation = getIncludeOrExpansionLoc(EndLoc); - assert(SM.isWrittenInSameFile(Region.getStartLoc(), EndLoc)); + assert(SM.isWrittenInSameFile(Region.getBeginLoc(), EndLoc)); assert(SpellingRegion(SM, Region).isInSourceOrder()); SourceRegions.push_back(Region); @@ -649,7 +649,7 @@ struct CounterCoverageMappingBuilder return SourceRegions.rend() != std::find_if(SourceRegions.rbegin(), SourceRegions.rend(), [&](const SourceMappingRegion &Region) { - return Region.getStartLoc() == StartLoc && + return Region.getBeginLoc() == StartLoc && Region.getEndLoc() == EndLoc; }); } @@ -701,7 +701,7 @@ struct CounterCoverageMappingBuilder for (SourceMappingRegion &I : llvm::reverse(RegionStack)) { if (!I.hasStartLoc()) continue; - SourceLocation Loc = I.getStartLoc(); + SourceLocation Loc = I.getBeginLoc(); if (!isNestedIn(Loc, ParentFile)) { ParentCounter = I.getCounter(); break; @@ -1110,7 +1110,7 @@ struct CounterCoverageMappingBuilder Counter Count = addCounters(Parent.getCounter(), getRegionCounter(S)); // Reuse the existing region if it starts at our label. This is typical of // the first case in a switch. - if (Parent.hasStartLoc() && Parent.getStartLoc() == getStart(S)) + if (Parent.hasStartLoc() && Parent.getBeginLoc() == getStart(S)) Parent.setCounter(Count); else pushRegion(Count, getStart(S)); Modified: cfe/trunk/lib/Sema/SemaStmt.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaStmt.cpp?rev=339384&r1=339383&r2=339384&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaStmt.cpp (original) +++ cfe/trunk/lib/Sema/SemaStmt.cpp Thu Aug 9 14:05:56 2018 @@ -2066,7 +2066,7 @@ StmtResult Sema::ActOnCXXForRangeStmt(Sc assert(DS && "first part of for range not a decl stmt"); if (!DS->isSingleDecl()) { - Diag(DS->getStartLoc(), diag::err_type_defined_in_for_range); + Diag(DS->getBeginLoc(), diag::err_type_defined_in_for_range); return StmtError(); } Modified: cfe/trunk/lib/Sema/TreeTransform.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=339384&r1=339383&r2=339384&view=diff ============================================================================== --- cfe/trunk/lib/Sema/TreeTransform.h (original) +++ cfe/trunk/lib/Sema/TreeTransform.h Thu Aug 9 14:05:56 2018 @@ -6875,7 +6875,7 @@ TreeTransform<Derived>::TransformDeclStm if (!getDerived().AlwaysRebuild() && !DeclChanged) return S; - return getDerived().RebuildDeclStmt(Decls, S->getStartLoc(), S->getEndLoc()); + return getDerived().RebuildDeclStmt(Decls, S->getBeginLoc(), S->getEndLoc()); } template<typename Derived> Modified: cfe/trunk/lib/Serialization/ASTWriterStmt.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterStmt.cpp?rev=339384&r1=339383&r2=339384&view=diff ============================================================================== --- cfe/trunk/lib/Serialization/ASTWriterStmt.cpp (original) +++ cfe/trunk/lib/Serialization/ASTWriterStmt.cpp Thu Aug 9 14:05:56 2018 @@ -223,7 +223,7 @@ void ASTStmtWriter::VisitReturnStmt(Retu void ASTStmtWriter::VisitDeclStmt(DeclStmt *S) { VisitStmt(S); - Record.AddSourceLocation(S->getStartLoc()); + Record.AddSourceLocation(S->getBeginLoc()); Record.AddSourceLocation(S->getEndLoc()); DeclGroupRef DG = S->getDeclGroup(); for (DeclGroupRef::iterator D = DG.begin(), DEnd = DG.end(); D != DEnd; ++D) Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp?rev=339384&r1=339383&r2=339384&view=diff ============================================================================== --- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp (original) +++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp Thu Aug 9 14:05:56 2018 @@ -551,7 +551,7 @@ void ExprEngine::VisitCXXNewAllocatorCal ProgramStateRef State = Pred->getState(); const LocationContext *LCtx = Pred->getLocationContext(); PrettyStackTraceLoc CrashInfo(getContext().getSourceManager(), - CNE->getStartLoc(), + CNE->getBeginLoc(), "Error evaluating New Allocator Call"); CallEventManager &CEMgr = getStateManager().getCallEventManager(); CallEventRef<CXXAllocatorCall> Call = _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits