Cache the macros.

This commit is contained in:
Roberto Raggi
2009-09-30 18:52:19 +02:00
parent 06bba1dc78
commit ae43149c97
4 changed files with 34 additions and 46 deletions

View File

@@ -44,18 +44,17 @@ namespace CPlusPlus {
class CPLUSPLUS_EXPORT FastMacroResolver: public MacroResolver
{
public:
FastMacroResolver(const Snapshot &snapshot);
FastMacroResolver(TranslationUnit *unit, const Snapshot &snapshot);
virtual bool isMacro(TranslationUnit *unit, unsigned tokenIndex) const;
private:
bool isMacro_helper(const QByteArray &macroName,
const QString &fileName,
QSet<QString> *processed,
bool *done) const;
void updateCache(const QString &fileName, QSet<QString> *processed);
private:
TranslationUnit *_unit;
Snapshot _snapshot;
QSet<QByteArray> _cachedMacros;
};
class CPLUSPLUS_EXPORT FastPreprocessor: public Client