C++: Inline often used member functions of TranslationUnit

As indicated by profiling.

Change-Id: I92d79b52d2d56540da39559fe4db3c22ab53a73a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
hjk
2013-04-15 15:56:38 +02:00
parent 90b4f5c95e
commit 61059f8432
2 changed files with 6 additions and 12 deletions

View File

@@ -108,15 +108,6 @@ void TranslationUnit::setSource(const char *source, unsigned size)
_lastSourceChar = source + size; _lastSourceChar = source + size;
} }
unsigned TranslationUnit::tokenCount() const
{ return _tokens->size(); }
const Token &TranslationUnit::tokenAt(unsigned index) const
{ return _tokens->at(index); }
int TranslationUnit::tokenKind(unsigned index) const
{ return _tokens->at(index).f.kind; }
const char *TranslationUnit::spell(unsigned index) const const char *TranslationUnit::spell(unsigned index) const
{ {
if (! index) if (! index)

View File

@@ -52,9 +52,12 @@ public:
void setSource(const char *source, unsigned size); void setSource(const char *source, unsigned size);
unsigned tokenCount() const; unsigned tokenCount() const
const Token &tokenAt(unsigned index) const; { return _tokens->size(); }
int tokenKind(unsigned index) const; const Token &tokenAt(unsigned index) const
{ return _tokens->at(index); }
int tokenKind(unsigned index) const
{ return _tokens->at(index).f.kind; }
const char *spell(unsigned index) const; const char *spell(unsigned index) const;
unsigned commentCount() const; unsigned commentCount() const;