Commit a340cd11 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Get rid of the numeric literals.

parent c12866a4
......@@ -287,6 +287,9 @@ public:
_doc->check(_mode);
_doc->releaseTranslationUnit();
if (_mode == Document::FastCheck)
_doc->control()->squeeze();
if (_modelManager)
_modelManager->emitDocumentUpdated(_doc); // ### TODO: compress
}
......
......@@ -754,3 +754,8 @@ bool Control::hasSymbol(Symbol *symbol) const
{
return std::find(d->symbols.begin(), d->symbols.end(), symbol) != d->symbols.end();
}
void Control::squeeze()
{
d->numericLiterals.reset();
}
......@@ -211,6 +211,8 @@ public:
bool hasSymbol(Symbol *symbol) const;
void squeeze();
private:
class Data;
friend class Data;
......
......@@ -73,6 +73,11 @@ public:
{ }
~LiteralTable()
{
reset();
}
void reset()
{
if (_literals) {
_Literal **lastLiteral = _literals + _literalCount + 1;
......@@ -82,6 +87,12 @@ public:
}
if (_buckets)
std::free(_buckets);
_literals = 0;
_buckets = 0;
_allocatedLiterals = 0;
_literalCount = -1;
_allocatedBuckets = 0;
}
bool empty() const
......
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