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:
22
src/libs/3rdparty/cplusplus/Names.h
vendored
22
src/libs/3rdparty/cplusplus/Names.h
vendored
@@ -234,10 +234,8 @@ public:
|
||||
|
||||
Kind kind() const;
|
||||
|
||||
const Identifier *identifier() const override;
|
||||
|
||||
const OperatorNameId *asOperatorNameId() const override
|
||||
{ return this; }
|
||||
const Identifier *identifier() const override { return nullptr; }
|
||||
const OperatorNameId *asOperatorNameId() const override { return this; }
|
||||
|
||||
protected:
|
||||
void accept0(NameVisitor *visitor) const override;
|
||||
@@ -253,12 +251,9 @@ public:
|
||||
ConversionNameId(const FullySpecifiedType &type);
|
||||
virtual ~ConversionNameId();
|
||||
|
||||
FullySpecifiedType type() const;
|
||||
|
||||
const Identifier *identifier() const override;
|
||||
|
||||
const ConversionNameId *asConversionNameId() const override
|
||||
{ return this; }
|
||||
FullySpecifiedType type() const { return _type; }
|
||||
const Identifier *identifier() const override { return nullptr; }
|
||||
const ConversionNameId *asConversionNameId() const override { return this; }
|
||||
|
||||
protected:
|
||||
void accept0(NameVisitor *visitor) const override;
|
||||
@@ -300,7 +295,7 @@ private:
|
||||
bool _hasArguments;
|
||||
};
|
||||
|
||||
class CPLUSPLUS_EXPORT AnonymousNameId: public Name
|
||||
class CPLUSPLUS_EXPORT AnonymousNameId final : public Name
|
||||
{
|
||||
public:
|
||||
AnonymousNameId(int classTokenIndex);
|
||||
@@ -308,10 +303,9 @@ public:
|
||||
|
||||
int classTokenIndex() const;
|
||||
|
||||
const Identifier *identifier() const override;
|
||||
const Identifier *identifier() const override { return nullptr; }
|
||||
|
||||
const AnonymousNameId *asAnonymousNameId() const override
|
||||
{ return this; }
|
||||
const AnonymousNameId *asAnonymousNameId() const override { return this; }
|
||||
|
||||
protected:
|
||||
void accept0(NameVisitor *visitor) const override;
|
||||
|
||||
Reference in New Issue
Block a user