diff options
author | hjk <hjk@qt.io> | 2022-06-23 16:56:36 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2022-06-24 11:49:41 +0000 |
commit | ffa3aad57647be2d33246b5f07eaa32450dd87a6 (patch) | |
tree | 6ad17cd8d0e23ddedd461fd846777287f4029573 /src/libs/3rdparty/cplusplus/Symbol.cpp | |
parent | 85cd97a33446699f97a21429ceb22f3acf40a5be (diff) | |
download | qt-creator-ffa3aad57647be2d33246b5f07eaa32450dd87a6.tar.gz |
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>
Diffstat (limited to 'src/libs/3rdparty/cplusplus/Symbol.cpp')
-rw-r--r-- | src/libs/3rdparty/cplusplus/Symbol.cpp | 157 |
1 files changed, 0 insertions, 157 deletions
diff --git a/src/libs/3rdparty/cplusplus/Symbol.cpp b/src/libs/3rdparty/cplusplus/Symbol.cpp index 05254e9d96..01410ecea9 100644 --- a/src/libs/3rdparty/cplusplus/Symbol.cpp +++ b/src/libs/3rdparty/cplusplus/Symbol.cpp @@ -142,23 +142,7 @@ void Symbol::visitSymbol(Symbol *symbol, SymbolVisitor *visitor) symbol->visitSymbol(visitor); } -int Symbol::sourceLocation() const -{ return _sourceLocation; } -bool Symbol::isGenerated() const -{ return _isGenerated; } - -bool Symbol::isDeprecated() const -{ return _isDeprecated; } - -void Symbol::setDeprecated(bool isDeprecated) -{ _isDeprecated = isDeprecated; } - -bool Symbol::isUnavailable() const -{ return _isUnavailable; } - -void Symbol::setUnavailable(bool isUnavailable) -{ _isUnavailable = isUnavailable; } void Symbol::setSourceLocation(int sourceLocation, TranslationUnit *translationUnit) { @@ -176,21 +160,6 @@ void Symbol::setSourceLocation(int sourceLocation, TranslationUnit *translationU } } -int Symbol::line() const -{ - return _line; -} - -int Symbol::column() const -{ - return _column; -} - -const StringLiteral *Symbol::fileId() const -{ - return _fileId; -} - const char *Symbol::fileName() const { return _fileId ? _fileId->chars() : ""; } @@ -208,9 +177,6 @@ const Name *Symbol::unqualifiedName() const return _name; } -const Name *Symbol::name() const -{ return _name; } - void Symbol::setName(const Name *name) { _name = name; @@ -231,9 +197,6 @@ const Identifier *Symbol::identifier() const return nullptr; } -Scope *Symbol::enclosingScope() const -{ return _enclosingScope; } - void Symbol::setEnclosingScope(Scope *scope) { CPP_CHECK(! _enclosingScope); @@ -299,126 +262,6 @@ Block *Symbol::enclosingBlock() const return nullptr; } -unsigned Symbol::index() const -{ return _index; } - -Symbol *Symbol::next() const -{ return _next; } - -unsigned Symbol::hashCode() const -{ return _hashCode; } - -int Symbol::storage() const -{ return _storage; } - -void Symbol::setStorage(int storage) -{ _storage = storage; } - -int Symbol::visibility() const -{ return _visibility; } - -void Symbol::setVisibility(int visibility) -{ _visibility = visibility; } - -bool Symbol::isFriend() const -{ return _storage == Friend; } - -bool Symbol::isRegister() const -{ return _storage == Register; } - -bool Symbol::isStatic() const -{ return _storage == Static; } - -bool Symbol::isExtern() const -{ return _storage == Extern; } - -bool Symbol::isMutable() const -{ return _storage == Mutable; } - -bool Symbol::isTypedef() const -{ return _storage == Typedef; } - -bool Symbol::isPublic() const -{ return _visibility == Public; } - -bool Symbol::isProtected() const -{ return _visibility == Protected; } - -bool Symbol::isPrivate() const -{ return _visibility == Private; } - -bool Symbol::isScope() const -{ return asScope() != nullptr; } - -bool Symbol::isEnum() const -{ return asEnum() != nullptr; } - -bool Symbol::isFunction() const -{ return asFunction() != nullptr; } - -bool Symbol::isNamespace() const -{ return asNamespace() != nullptr; } - -bool Symbol::isTemplate() const -{ return asTemplate() != nullptr; } - -bool Symbol::isClass() const -{ return asClass() != nullptr; } - -bool Symbol::isForwardClassDeclaration() const -{ return asForwardClassDeclaration() != nullptr; } - -bool Symbol::isQtPropertyDeclaration() const -{ return asQtPropertyDeclaration() != nullptr; } - -bool Symbol::isQtEnum() const -{ return asQtEnum() != nullptr; } - -bool Symbol::isBlock() const -{ return asBlock() != nullptr; } - -bool Symbol::isUsingNamespaceDirective() const -{ return asUsingNamespaceDirective() != nullptr; } - -bool Symbol::isUsingDeclaration() const -{ return asUsingDeclaration() != nullptr; } - -bool Symbol::isDeclaration() const -{ return asDeclaration() != nullptr; } - -bool Symbol::isArgument() const -{ return asArgument() != nullptr; } - -bool Symbol::isTypenameArgument() const -{ return asTypenameArgument() != nullptr; } - -bool Symbol::isBaseClass() const -{ return asBaseClass() != nullptr; } - -bool Symbol::isObjCBaseClass() const -{ return asObjCBaseClass() != nullptr; } - -bool Symbol::isObjCBaseProtocol() const -{ return asObjCBaseProtocol() != nullptr; } - -bool Symbol::isObjCClass() const -{ return asObjCClass() != nullptr; } - -bool Symbol::isObjCForwardClassDeclaration() const -{ return asObjCForwardClassDeclaration() != nullptr; } - -bool Symbol::isObjCProtocol() const -{ return asObjCProtocol() != nullptr; } - -bool Symbol::isObjCForwardProtocolDeclaration() const -{ return asObjCForwardProtocolDeclaration() != nullptr; } - -bool Symbol::isObjCMethod() const -{ return asObjCMethod() != nullptr; } - -bool Symbol::isObjCPropertyDeclaration() const -{ return asObjCPropertyDeclaration() != nullptr; } - void Symbol::copy(Symbol *other) { _sourceLocation = other->_sourceLocation; |