diff options
author | hjk <hjk121@nokiamail.com> | 2013-04-16 15:38:59 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@digia.com> | 2013-04-18 14:58:52 +0200 |
commit | f0f406bacba69b0e17843feacb5033b2956df205 (patch) | |
tree | e0308e0b48c9dd55be6e903badb9b9ab438f8d60 /src/libs/3rdparty | |
parent | b85eddb2eab446074c2fc31d3f4bbff762b28802 (diff) | |
download | qt-creator-f0f406bacba69b0e17843feacb5033b2956df205.tar.gz |
C++: Inline {TranslationUnit,Parser}::blockErrors
As indicated by profiling.
Change-Id: I04d741dcc6200eb351d7aec316572e0e94ef5bec
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/libs/3rdparty')
-rw-r--r-- | src/libs/3rdparty/cplusplus/Parser.cpp | 3 | ||||
-rw-r--r-- | src/libs/3rdparty/cplusplus/Parser.h | 2 | ||||
-rw-r--r-- | src/libs/3rdparty/cplusplus/TranslationUnit.cpp | 7 | ||||
-rw-r--r-- | src/libs/3rdparty/cplusplus/TranslationUnit.h | 17 |
4 files changed, 10 insertions, 19 deletions
diff --git a/src/libs/3rdparty/cplusplus/Parser.cpp b/src/libs/3rdparty/cplusplus/Parser.cpp index 21125f3718..00b79dfc25 100644 --- a/src/libs/3rdparty/cplusplus/Parser.cpp +++ b/src/libs/3rdparty/cplusplus/Parser.cpp @@ -216,9 +216,6 @@ bool Parser::maybeSplitGreaterGreaterToken(int n) return _translationUnit->maybeSplitGreaterGreaterToken(_tokenIndex + n - 1); } -bool Parser::blockErrors(bool block) -{ return _translationUnit->blockErrors(block); } - bool Parser::skipUntil(int token) { while (int tk = LA()) { diff --git a/src/libs/3rdparty/cplusplus/Parser.h b/src/libs/3rdparty/cplusplus/Parser.h index 0e86c26520..978b1f99a1 100644 --- a/src/libs/3rdparty/cplusplus/Parser.h +++ b/src/libs/3rdparty/cplusplus/Parser.h @@ -278,7 +278,7 @@ public: bool switchTemplateArguments(bool templateArguments); bool maybeSplitGreaterGreaterToken(int n = 1); - bool blockErrors(bool block); + bool blockErrors(bool block) { return _translationUnit->blockErrors(block); } void warning(unsigned index, const char *format, ...); void error(unsigned index, const char *format, ...); void fatal(unsigned index, const char *format, ...); diff --git a/src/libs/3rdparty/cplusplus/TranslationUnit.cpp b/src/libs/3rdparty/cplusplus/TranslationUnit.cpp index 40fc890b98..79b5af059c 100644 --- a/src/libs/3rdparty/cplusplus/TranslationUnit.cpp +++ b/src/libs/3rdparty/cplusplus/TranslationUnit.cpp @@ -459,13 +459,6 @@ void TranslationUnit::getPosition(unsigned tokenOffset, *fileName = file; } -bool TranslationUnit::blockErrors(bool block) -{ - bool previous = f._blockErrors; - f._blockErrors = block; - return previous; -} - void TranslationUnit::message(DiagnosticClient::Level level, unsigned index, const char *format, va_list args) { if (f._blockErrors) diff --git a/src/libs/3rdparty/cplusplus/TranslationUnit.h b/src/libs/3rdparty/cplusplus/TranslationUnit.h index cf667b9143..fb4ee91b7c 100644 --- a/src/libs/3rdparty/cplusplus/TranslationUnit.h +++ b/src/libs/3rdparty/cplusplus/TranslationUnit.h @@ -52,12 +52,9 @@ public: void setSource(const char *source, unsigned size); - unsigned tokenCount() const - { return _tokens->size(); } - const Token &tokenAt(unsigned index) const - { return _tokens->at(index); } - int tokenKind(unsigned index) const - { return _tokens->at(index).f.kind; } + unsigned tokenCount() const { return _tokens->size(); } + 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; unsigned commentCount() const; @@ -72,8 +69,12 @@ public: MemoryPool *memoryPool() const; AST *ast() const; - bool blockErrors() const { return f._blockErrors; } - bool blockErrors(bool block); + bool blockErrors(bool block) + { + const bool previous = f._blockErrors; + f._blockErrors = block; + return previous; + } bool qtMocRunEnabled() const; void setQtMocRunEnabled(bool onoff); |