[PATCH] D50347: Add getBeginLoc API to replace getStartLoc
Stephen Kelly via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 9 13:06:11 PDT 2018
This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rC339373: Add getBeginLoc API to replace getStartLoc (authored by steveire, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D50347?vs=159358&id=159986#toc
Repository:
rC Clang
https://reviews.llvm.org/D50347
Files:
include/clang/AST/ExprCXX.h
include/clang/AST/Stmt.h
include/clang/Analysis/CloneDetection.h
lib/CodeGen/CoverageMappingGen.cpp
Index: lib/CodeGen/CoverageMappingGen.cpp
===================================================================
--- lib/CodeGen/CoverageMappingGen.cpp
+++ lib/CodeGen/CoverageMappingGen.cpp
@@ -67,7 +67,8 @@
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;
}
Index: include/clang/AST/ExprCXX.h
===================================================================
--- include/clang/AST/ExprCXX.h
+++ include/clang/AST/ExprCXX.h
@@ -2094,7 +2094,8 @@
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 @@
}
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: include/clang/AST/Stmt.h
===================================================================
--- include/clang/AST/Stmt.h
+++ include/clang/AST/Stmt.h
@@ -523,7 +523,7 @@
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: include/clang/Analysis/CloneDetection.h
===================================================================
--- include/clang/Analysis/CloneDetection.h
+++ include/clang/Analysis/CloneDetection.h
@@ -122,7 +122,8 @@
/// 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.
///
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50347.159986.patch
Type: text/x-patch
Size: 2640 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180809/ffa1a66c/attachment.bin>
More information about the llvm-commits
mailing list