forked from qt-creator/qt-creator
Clang: Return ClangString instead of Utf8String
Utf8String is allocating memory but for many compares it is not needed. In an inner loop this can be expensive. Change-Id: I6320823ab7e086008447eea255e52859a7faaad7 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -198,12 +198,12 @@ bool Cursor::isUnexposed() const
|
||||
return clang_isUnexposed(kind());
|
||||
}
|
||||
|
||||
Utf8String Cursor::unifiedSymbolResolution() const
|
||||
ClangString Cursor::unifiedSymbolResolution() const
|
||||
{
|
||||
return ClangString(clang_getCursorUSR(cxCursor));
|
||||
}
|
||||
|
||||
Utf8String Cursor::mangling() const
|
||||
ClangString Cursor::mangling() const
|
||||
{
|
||||
return ClangString(clang_Cursor_getMangling(cxCursor));
|
||||
}
|
||||
@@ -213,17 +213,17 @@ ClangString Cursor::spelling() const
|
||||
return ClangString(clang_getCursorSpelling(cxCursor));
|
||||
}
|
||||
|
||||
Utf8String Cursor::displayName() const
|
||||
ClangString Cursor::displayName() const
|
||||
{
|
||||
return ClangString(clang_getCursorDisplayName(cxCursor));
|
||||
}
|
||||
|
||||
Utf8String Cursor::briefComment() const
|
||||
ClangString Cursor::briefComment() const
|
||||
{
|
||||
return ClangString(clang_Cursor_getBriefCommentText(cxCursor));
|
||||
}
|
||||
|
||||
Utf8String Cursor::rawComment() const
|
||||
ClangString Cursor::rawComment() const
|
||||
{
|
||||
return ClangString(clang_Cursor_getRawCommentText(cxCursor));
|
||||
}
|
||||
@@ -418,7 +418,7 @@ void PrintTo(const Cursor &cursor, ::std::ostream*os)
|
||||
auto identifier = cursor.displayName();
|
||||
if (identifier.hasContent()) {
|
||||
*os << "\""
|
||||
<< identifier.constData()
|
||||
<< identifier
|
||||
<< "\": ";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user