// 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;
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) {
// 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.
}
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.
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;
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.
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 {
// 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);
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();
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);
return SourceRegions.rend() !=
std::find_if(SourceRegions.rbegin(), SourceRegions.rend(),
[&](const SourceMappingRegion &Region) {
- return Region.getStartLoc() == StartLoc &&
+ return Region.getBeginLoc() == StartLoc &&
Region.getEndLoc() == EndLoc;
});
}
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;
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));