diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-01-07 19:16:27 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-01-07 19:16:27 +0000 |
commit | 98a8874a0d09c0b58f7cfce38365b7a119a73edd (patch) | |
tree | bf728a7b1854431fe22d5807ea2db557d187b00f /clang/tools/libclang/CIndex.cpp | |
parent | 579825a50aad9759912f349fd9f52c8961056dd3 (diff) | |
download | bcm5719-llvm-98a8874a0d09c0b58f7cfce38365b7a119a73edd.tar.gz bcm5719-llvm-98a8874a0d09c0b58f7cfce38365b7a119a73edd.zip |
[libclang] Make token annotation of type/storage qualifiers accurate.
Previously type/storage qualifiers would not be annotated as the declaration they belonged to.
Just use the resulting source range of getRawCursorExtent() which is more correct
than what AnnotateTokensWorker::Visit() was adjusting it to.
llvm-svn: 171774
Diffstat (limited to 'clang/tools/libclang/CIndex.cpp')
-rw-r--r-- | clang/tools/libclang/CIndex.cpp | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index 96c7c586fa3..51ed343f528 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -5142,24 +5142,7 @@ AnnotateTokensWorker::Visit(CXCursor cursor, CXCursor parent) { SourceLocation L = SourceLocation::getFromRawEncoding(Loc.int_data); - // Adjust the annotated range based specific declarations. const enum CXCursorKind cursorK = clang_getCursorKind(cursor); - if (clang_isDeclaration(cursorK)) { - Decl *D = cxcursor::getCursorDecl(cursor); - - SourceLocation StartLoc; - if (const DeclaratorDecl *DD = dyn_cast_or_null<DeclaratorDecl>(D)) { - if (TypeSourceInfo *TI = DD->getTypeSourceInfo()) - StartLoc = TI->getTypeLoc().getLocStart(); - } else if (TypedefDecl *Typedef = dyn_cast_or_null<TypedefDecl>(D)) { - if (TypeSourceInfo *TI = Typedef->getTypeSourceInfo()) - StartLoc = TI->getTypeLoc().getLocStart(); - } - - if (StartLoc.isValid() && L.isValid() && - SrcMgr.isBeforeInTranslationUnit(StartLoc, L)) - cursorRange.setBegin(StartLoc); - } // If the location of the cursor occurs within a macro instantiation, record // the spelling location of the cursor in our annotation map. We can then |