C++: Always remove NumericLiterals when removing the AST.

Contrary to StringLiterals, keeping them around is unnecessary.

Change-Id: Idc1967c125e1373e69ce4c7640328d323a84ec14
Reviewed-on: http://codereview.qt.nokia.com/3395
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
Christian Kamm
2011-08-23 12:25:31 +02:00
parent 29c0f0bfef
commit 51ea52971f
2 changed files with 3 additions and 8 deletions

View File

@@ -256,8 +256,7 @@ Document::Document(const QString &fileName)
: _fileName(QDir::cleanPath(fileName)), : _fileName(QDir::cleanPath(fileName)),
_globalNamespace(0), _globalNamespace(0),
_revision(0), _revision(0),
_editorRevision(0), _editorRevision(0)
_fastCheck(false)
{ {
_control = new Control(); _control = new Control();
@@ -575,10 +574,8 @@ void Document::check(CheckMode mode)
_globalNamespace = _control->newNamespace(0); _globalNamespace = _control->newNamespace(0);
Bind semantic(_translationUnit); Bind semantic(_translationUnit);
if (mode == FastCheck) { if (mode == FastCheck)
_fastCheck = true;
semantic.setSkipFunctionBodies(true); semantic.setSkipFunctionBodies(true);
}
if (! _translationUnit->ast()) if (! _translationUnit->ast())
return; // nothing to do. return; // nothing to do.
@@ -602,8 +599,7 @@ void Document::releaseSourceAndAST()
if (!_keepSourceAndASTCount.deref()) { if (!_keepSourceAndASTCount.deref()) {
_source.clear(); _source.clear();
_translationUnit->release(); _translationUnit->release();
if (_fastCheck) _control->squeeze();
_control->squeeze();
} }
} }

View File

@@ -335,7 +335,6 @@ private:
QAtomicInt _keepSourceAndASTCount; QAtomicInt _keepSourceAndASTCount;
unsigned _revision; unsigned _revision;
unsigned _editorRevision; unsigned _editorRevision;
bool _fastCheck;
friend class Snapshot; friend class Snapshot;
}; };