forked from OSchip/llvm-project
[libclang] Add Logger::operator<< overloads for CXCursor and FileEntry.
llvm-svn: 176680
This commit is contained in:
parent
e7838a4c53
commit
ba4b5f8646
|
@ -6397,6 +6397,18 @@ Logger &cxindex::Logger::operator<<(CXTranslationUnit TU) {
|
|||
return *this;
|
||||
}
|
||||
|
||||
Logger &cxindex::Logger::operator<<(const FileEntry *FE) {
|
||||
*this << FE->getName();
|
||||
return *this;
|
||||
}
|
||||
|
||||
Logger &cxindex::Logger::operator<<(CXCursor cursor) {
|
||||
CXString cursorName = clang_getCursorDisplayName(cursor);
|
||||
*this << cursorName << "@" << clang_getCursorLocation(cursor);
|
||||
clang_disposeString(cursorName);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Logger &cxindex::Logger::operator<<(CXSourceLocation Loc) {
|
||||
CXFile File;
|
||||
unsigned Line, Column;
|
||||
|
|
|
@ -367,6 +367,9 @@ void clang_findReferencesInFile(CXCursor cursor, CXFile file,
|
|||
return;
|
||||
}
|
||||
|
||||
if (Log)
|
||||
*Log << cursor << " @" << static_cast<const FileEntry *>(file);
|
||||
|
||||
ASTUnit *CXXUnit = cxcursor::getCursorASTUnit(cursor);
|
||||
if (!CXXUnit)
|
||||
return;
|
||||
|
|
|
@ -23,6 +23,7 @@ class format_object_base;
|
|||
}
|
||||
|
||||
namespace clang {
|
||||
class FileEntry;
|
||||
|
||||
namespace cxindex {
|
||||
|
||||
|
@ -64,6 +65,8 @@ public:
|
|||
~Logger();
|
||||
|
||||
Logger &operator<<(CXTranslationUnit);
|
||||
Logger &operator<<(const FileEntry *FE);
|
||||
Logger &operator<<(CXCursor cursor);
|
||||
Logger &operator<<(CXSourceLocation);
|
||||
Logger &operator<<(CXSourceRange);
|
||||
Logger &operator<<(CXString);
|
||||
|
|
Loading…
Reference in New Issue