Commit ef09a67c authored by hjk's avatar hjk Committed by hjk
Browse files

preprocessor: add some helper function to dump Environment state



Change-Id: I5e1d549f96e899aadd5c94a5d7ef7f3169f45806
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent a9a89455
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#include "PreprocessorEnvironment.h" #include "PreprocessorEnvironment.h"
#include "Macro.h" #include "Macro.h"
#include <QDebug>
#include <cstring> #include <cstring>
using namespace CPlusPlus; using namespace CPlusPlus;
...@@ -272,3 +273,11 @@ void Environment::rehash() ...@@ -272,3 +273,11 @@ void Environment::rehash()
_hash[h] = m; _hash[h] = m;
} }
} }
void Environment::dump() const
{
for (iterator it = firstMacro(); it != lastMacro(); ++it) {
Macro *m = *it;
qDebug() << m->decoratedName();
}
}
...@@ -86,6 +86,7 @@ public: ...@@ -86,6 +86,7 @@ public:
void addMacros(const QList<Macro> &macros); void addMacros(const QList<Macro> &macros);
static bool isBuiltinMacro(const ByteArrayRef &name); static bool isBuiltinMacro(const ByteArrayRef &name);
void dump() const;
private: private:
static unsigned hashCode(const QByteArray &s); static unsigned hashCode(const QByteArray &s);
......
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