preprocessor: add some helper function to dump Environment state

Change-Id: I5e1d549f96e899aadd5c94a5d7ef7f3169f45806
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2012-04-19 11:48:16 +02:00
committed by hjk
parent a9a894558f
commit ef09a67c6b
2 changed files with 10 additions and 0 deletions

View File

@@ -51,6 +51,7 @@
#include "PreprocessorEnvironment.h"
#include "Macro.h"
#include <QDebug>
#include <cstring>
using namespace CPlusPlus;
@@ -272,3 +273,11 @@ void Environment::rehash()
_hash[h] = m;
}
}
void Environment::dump() const
{
for (iterator it = firstMacro(); it != lastMacro(); ++it) {
Macro *m = *it;
qDebug() << m->decoratedName();
}
}

View File

@@ -86,6 +86,7 @@ public:
void addMacros(const QList<Macro> &macros);
static bool isBuiltinMacro(const ByteArrayRef &name);
void dump() const;
private:
static unsigned hashCode(const QByteArray &s);