diff options
author | Daniel Dunbar <daniel@zuster.org> | 2012-03-09 18:35:03 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2012-03-09 18:35:03 +0000 |
commit | 96a0014f9b963d8a987f1cccd48808a47f9c6331 (patch) | |
tree | 648ade07f20cf96e38d8b66e21859f2794a8f579 /tools | |
parent | 3d4144f32ea4c24aaf48cbff4f476c1446ba2641 (diff) |
[AST/Sema/libclang] Replace getSourceRange().getBegin() with getLocStart().
- getSourceRange().getBegin() is about as awesome a pattern as .copy().size().
I already killed the hot paths so this doesn't seem to impact performance on my
tests-of-the-day, but it is a much more sensible (and shorter) pattern.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152419 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libclang/CIndex.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index 7e4a1ede74..a91146c8b3 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -3702,7 +3702,7 @@ CXSourceLocation clang_getCursorLocation(CXCursor C) { TSInfo->getTypeLoc().getBeginLoc()); return cxloc::translateSourceLocation(getCursorContext(C), - BaseSpec->getSourceRange().getBegin()); + BaseSpec->getLocStart()); } case CXCursor_LabelRef: { @@ -3908,10 +3908,10 @@ static SourceRange getFullCursorExtent(CXCursor C, SourceManager &SrcMgr) { SourceLocation StartLoc; if (const DeclaratorDecl *DD = dyn_cast<DeclaratorDecl>(D)) { if (TypeSourceInfo *TI = DD->getTypeSourceInfo()) - StartLoc = TI->getTypeLoc().getSourceRange().getBegin(); + StartLoc = TI->getTypeLoc().getLocStart(); } else if (TypedefDecl *Typedef = dyn_cast<TypedefDecl>(D)) { if (TypeSourceInfo *TI = Typedef->getTypeSourceInfo()) - StartLoc = TI->getTypeLoc().getSourceRange().getBegin(); + StartLoc = TI->getTypeLoc().getLocStart(); } if (StartLoc.isValid() && R.getBegin().isValid() && @@ -4845,10 +4845,10 @@ AnnotateTokensWorker::Visit(CXCursor cursor, CXCursor parent) { SourceLocation StartLoc; if (const DeclaratorDecl *DD = dyn_cast_or_null<DeclaratorDecl>(D)) { if (TypeSourceInfo *TI = DD->getTypeSourceInfo()) - StartLoc = TI->getTypeLoc().getSourceRange().getBegin(); + StartLoc = TI->getTypeLoc().getLocStart(); } else if (TypedefDecl *Typedef = dyn_cast_or_null<TypedefDecl>(D)) { if (TypeSourceInfo *TI = Typedef->getTypeSourceInfo()) - StartLoc = TI->getTypeLoc().getSourceRange().getBegin(); + StartLoc = TI->getTypeLoc().getLocStart(); } if (StartLoc.isValid() && L.isValid() && |