Commit f0f406ba authored by hjk's avatar hjk Committed by Erik Verbruggen

C++: Inline {TranslationUnit,Parser}::blockErrors

As indicated by profiling.

Change-Id: I04d741dcc6200eb351d7aec316572e0e94ef5bec
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent b85eddb2
......@@ -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()) {
......
......@@ -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, ...);
......
......@@ -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)
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment