]> granicus.if.org Git - clang/commitdiff
Add getBeginLoc API to replace getStartLoc
authorStephen Kelly <steveire@gmail.com>
Thu, 9 Aug 2018 20:05:18 +0000 (20:05 +0000)
committerStephen Kelly <steveire@gmail.com>
Thu, 9 Aug 2018 20:05:18 +0000 (20:05 +0000)
Reviewers: teemperor!

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D50347

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339373 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/ExprCXX.h
include/clang/AST/Stmt.h
include/clang/Analysis/CloneDetection.h
lib/CodeGen/CoverageMappingGen.cpp

index 86899b34ee1b2f17f52847a3f1ddbea168486466..89ae5f1fdf7314fed0a642718470540502a585fe 100644 (file)
@@ -2094,7 +2094,8 @@ public:
     return SubExprs + Array + hasInitializer() + getNumPlacementArgs();
   }
 
-  SourceLocation getStartLoc() const { return Range.getBegin(); }
+  SourceLocation getStartLoc() const LLVM_READONLY { return getBeginLoc(); }
+  SourceLocation getBeginLoc() const { return Range.getBegin(); }
   SourceLocation getEndLoc() const { return Range.getEnd(); }
 
   SourceRange getDirectInitRange() const { return DirectInitRange; }
@@ -2104,7 +2105,6 @@ public:
   }
 
   SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); }
-  SourceLocation getBeginLoc() const LLVM_READONLY { return getStartLoc(); }
   SourceLocation getLocEnd() const LLVM_READONLY { return getEndLoc(); }
 
   static bool classof(const Stmt *T) {
index 26e47f00a7993ba16aa5ba2ec1921d7b200b3ff7..0b78de9bccbbe1c151e5f4e5a8560e20806f97a9 100644 (file)
@@ -523,7 +523,7 @@ public:
   DeclGroupRef getDeclGroup() { return DG; }
   void setDeclGroup(DeclGroupRef DGR) { DG = DGR; }
 
-  SourceLocation getStartLoc() const { return StartLoc; }
+  SourceLocation getStartLoc() const LLVM_READONLY { return getBeginLoc(); }
   void setStartLoc(SourceLocation L) { StartLoc = L; }
   SourceLocation getEndLoc() const { return EndLoc; }
   void setEndLoc(SourceLocation L) { EndLoc = L; }
index 915ec58a5144c5f0276701ddc422c160627e2d5a..b3fb447b1ece1181f9f46ac6d0daba8479262a72 100644 (file)
@@ -122,7 +122,8 @@ public:
   /// Returns the start sourcelocation of the first statement in this sequence.
   ///
   /// This method should only be called on a non-empty StmtSequence object.
-  SourceLocation getStartLoc() const;
+  SourceLocation getStartLoc() const LLVM_READONLY { return getBeginLoc(); }
+  SourceLocation getBeginLoc() const;
 
   /// Returns the end sourcelocation of the last statement in this sequence.
   ///
index 2d8446463594289e598c9cdfaea5f9583deae5dd..389d29e467b7003ffff96d764f2d99f0cdf4fb10 100644 (file)
@@ -67,7 +67,8 @@ public:
 
   void setStartLoc(SourceLocation Loc) { LocStart = Loc; }
 
-  SourceLocation getStartLoc() const {
+  SourceLocation getStartLoc() const LLVM_READONLY { return getBeginLoc(); }
+  SourceLocation getBeginLoc() const {
     assert(LocStart && "Region has no start location");
     return *LocStart;
   }