diff options
author | hjk <hjk@qt.io> | 2022-06-24 16:37:14 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2022-06-28 11:02:06 +0000 |
commit | 27d51e9804f795876129700863e94096f6bc7839 (patch) | |
tree | ef021c2b7fcab1d928359439973d862ce10ab041 /src/libs/3rdparty/cplusplus/Scope.cpp | |
parent | 6b32f58225fbb276293effb52bf02e71b7bc411d (diff) |
CPlusPlus: Inline some Scope related simple functions
Change-Id: I23486fdfa749fe864c04d5c1a7cede21fb16005b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/libs/3rdparty/cplusplus/Scope.cpp')
-rw-r--r-- | src/libs/3rdparty/cplusplus/Scope.cpp | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/src/libs/3rdparty/cplusplus/Scope.cpp b/src/libs/3rdparty/cplusplus/Scope.cpp index 23fa2aad67..644b690c75 100644 --- a/src/libs/3rdparty/cplusplus/Scope.cpp +++ b/src/libs/3rdparty/cplusplus/Scope.cpp @@ -19,7 +19,6 @@ // THE SOFTWARE. #include "Scope.h" -#include "Symbols.h" #include "Names.h" #include "Literals.h" #include "Templates.h" @@ -55,19 +54,19 @@ public: void enterSymbol(Symbol *symbol); /// Returns true if this Scope is empty; otherwise returns false. - bool isEmpty() const; + bool isEmpty() const { return _symbolCount == -1; } /// Returns the number of symbols is in the scope. - int symbolCount() const; + int symbolCount() const { return _symbolCount + 1; } /// Returns the Symbol at the given position. Symbol *symbolAt(int index) const; /// Returns the first Symbol in the scope. - iterator firstSymbol() const; + iterator firstSymbol() const { return _symbols; } /// Returns the last Symbol in the scope. - iterator lastSymbol() const; + iterator lastSymbol() const { return _symbols + _symbolCount + 1; } Symbol *lookat(const Identifier *id) const; Symbol *lookat(OperatorNameId::Kind operatorId) const; @@ -225,12 +224,6 @@ unsigned SymbolTable::hashValue(Symbol *symbol) const return symbol->hashCode() % _hashSize; } -bool SymbolTable::isEmpty() const -{ return _symbolCount == -1; } - -int SymbolTable::symbolCount() const -{ return _symbolCount + 1; } - Symbol *SymbolTable::symbolAt(int index) const { if (! _symbols) @@ -238,12 +231,6 @@ Symbol *SymbolTable::symbolAt(int index) const return _symbols[index]; } -SymbolTable::iterator SymbolTable::firstSymbol() const -{ return _symbols; } - -SymbolTable::iterator SymbolTable::lastSymbol() const -{ return _symbols + _symbolCount + 1; } - Scope::Scope(TranslationUnit *translationUnit, int sourceLocation, const Name *name) : Symbol(translationUnit, sourceLocation, name), _members(nullptr), @@ -302,18 +289,4 @@ Symbol *Scope::find(OperatorNameId::Kind operatorId) const Symbol *Scope::find(const ConversionNameId *conv) const { return _members ? _members->lookat(conv) : nullptr; } -/// Set the start offset of the scope -int Scope::startOffset() const -{ return _startOffset; } - -void Scope::setStartOffset(int offset) -{ _startOffset = offset; } - -/// Set the end offset of the scope -int Scope::endOffset() const -{ return _endOffset; } - -void Scope::setEndOffset(int offset) -{ _endOffset = offset; } - } // namespace CPlusPlus |