forked from qt-creator/qt-creator
CPlusPlus: Inline some simple central functions
Depending on context, callgrind sees contributions of >8% to the total cost of project parsing for these functions. The functional are actualy executed executed out-of-line, often for a function body of one "payload" instruction only. Inlining removes the call/endbr64/ret overhead. Change-Id: I6886f08e322fcaa4e0f54d424279e0a8c24e4718 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -413,11 +413,11 @@ static void find_helper(QFutureInterface<CPlusPlus::Usage> &future,
|
||||
symbol->fileNameLength());
|
||||
Utils::FilePaths files{sourceFile};
|
||||
|
||||
if (symbol->isClass()
|
||||
|| symbol->isForwardClassDeclaration()
|
||||
if (symbol->asClass()
|
||||
|| symbol->asForwardClassDeclaration()
|
||||
|| (symbol->enclosingScope()
|
||||
&& !symbol->isStatic()
|
||||
&& symbol->enclosingScope()->isNamespace())) {
|
||||
&& symbol->enclosingScope()->asNamespace())) {
|
||||
const CPlusPlus::Snapshot snapshotFromContext = context.snapshot();
|
||||
for (auto i = snapshotFromContext.begin(), ei = snapshotFromContext.end(); i != ei; ++i) {
|
||||
if (i.key() == sourceFile)
|
||||
@@ -479,7 +479,7 @@ void CppFindReferences::findUsages(CPlusPlus::Symbol *symbol,
|
||||
parameters.symbolFileName = QByteArray(symbol->fileName());
|
||||
parameters.categorize = codeModelSettings()->categorizeFindReferences();
|
||||
|
||||
if (symbol->isClass() || symbol->isForwardClassDeclaration()) {
|
||||
if (symbol->asClass() || symbol->asForwardClassDeclaration()) {
|
||||
CPlusPlus::Overview overview;
|
||||
parameters.prettySymbolName =
|
||||
overview.prettyName(CPlusPlus::LookupContext::path(symbol).constLast());
|
||||
|
||||
Reference in New Issue
Block a user