diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/CIndex/CIndex.cpp | 9 | ||||
-rw-r--r-- | tools/c-index-test/c-index-test.c | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp index c5c7409ffc..a11f54b879 100644 --- a/tools/CIndex/CIndex.cpp +++ b/tools/CIndex/CIndex.cpp @@ -643,7 +643,7 @@ unsigned clang_getDeclColumn(CXDecl AnonDecl) { return SourceMgr.getSpellingColumnNumber(ND->getLocation()); } -CXDeclExtent clang_getDeclExtent(CXDecl AnonDecl) { +CXSourceRange clang_getDeclExtent(CXDecl AnonDecl) { assert(AnonDecl && "Passed null CXDecl"); NamedDecl *ND = static_cast<NamedDecl *>(AnonDecl); SourceManager &SM = ND->getASTContext().getSourceManager(); @@ -653,7 +653,7 @@ CXDeclExtent clang_getDeclExtent(CXDecl AnonDecl) { SourceLocation End = SM.getInstantiationLoc(R.getEnd()); if (!Begin.isValid()) { - CXDeclExtent extent = { { 0, 0 }, { 0, 0 } }; + CXSourceRange extent = { { 0, 0, 0 }, { 0, 0, 0 } }; return extent; } @@ -691,8 +691,9 @@ CXDeclExtent clang_getDeclExtent(CXDecl AnonDecl) { } // Package up the line/column data and return to the caller. - CXDeclExtent extent = { { StartLineNo, StartColNo }, - { EndLineNo, EndColNo } }; + const FileEntry *FEntry = SM.getFileEntryForID(SM.getFileID(Begin)); + CXSourceRange extent = { { (void *)FEntry, StartLineNo, StartColNo }, + { (void *)FEntry, EndLineNo, EndColNo } }; return extent; } diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c index db95644c4c..e3d6ad88bb 100644 --- a/tools/c-index-test/c-index-test.c +++ b/tools/c-index-test/c-index-test.c @@ -74,7 +74,7 @@ static const char* GetCursorSource(CXCursor Cursor) { static const char *FileCheckPrefix = "CHECK"; static void PrintDeclExtent(CXDecl Dcl) { - CXSourceExtent extent; + CXSourceRange extent; if (!Dcl) return; extent = clang_getDeclExtent(Dcl); |