moc: Remove remnants of USE_LEXEM_STORE

Defining USE_LEXEM_STORE breaks compilation, and the commit that
introduce it (in the pre-public history) does not shed any light on its
usage.

Change-Id: Ic616bf9f2584151dab3f654d64025fcdc0ade25c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
bb10
Fabian Kosmale 2023-07-28 16:03:20 +02:00
parent 29d07101e5
commit c4bb02ce62
4 changed files with 2 additions and 61 deletions

View File

@ -8,10 +8,6 @@
QT_BEGIN_NAMESPACE
#ifdef USE_LEXEM_STORE
Symbol::LexemStore Symbol::lexemStore;
#endif
static const char *error_msg = nullptr;
/*! \internal

View File

@ -318,16 +318,7 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso
continue; //ignore
}
}
#ifdef USE_LEXEM_STORE
if (!Preprocessor::preprocessOnly
&& token != IDENTIFIER
&& token != STRING_LITERAL
&& token != FLOATING_LITERAL
&& token != INTEGER_LITERAL)
symbols += Symbol(lineNum, token);
else
#endif
symbols += Symbol(lineNum, token, input, lexem-begin, data-lexem);
symbols += Symbol(lineNum, token, input, lexem-begin, data-lexem);
} else { // Preprocessor
@ -499,15 +490,7 @@ Symbols Preprocessor::tokenize(const QByteArray& input, int lineNum, Preprocesso
}
if (mode == PreparePreprocessorStatement)
continue;
#ifdef USE_LEXEM_STORE
if (token != PP_IDENTIFIER
&& token != PP_STRING_LITERAL
&& token != PP_FLOATING_LITERAL
&& token != PP_INTEGER_LITERAL)
symbols += Symbol(lineNum, token);
else
#endif
symbols += Symbol(lineNum, token, input, lexem-begin, data-lexem);
symbols += Symbol(lineNum, token, input, lexem-begin, data-lexem);
}
}
symbols += Symbol(); // eof symbol

View File

@ -20,11 +20,7 @@ struct Macro
Symbols symbols;
};
#ifdef USE_LEXEM_STORE
typedef QByteArray MacroName;
#else
typedef SubArray MacroName;
#endif
typedef QHash<MacroName, Macro> Macros;
class QFile;

View File

@ -15,8 +15,6 @@
QT_BEGIN_NAMESPACE
//#define USE_LEXEM_STORE
struct SubArray
{
inline SubArray() = default;
@ -47,36 +45,6 @@ inline size_t qHash(const SubArray &key)
struct Symbol
{
#ifdef USE_LEXEM_STORE
typedef QHash<SubArray, QHashDummyValue> LexemStore;
static LexemStore lexemStore;
inline Symbol() : lineNum(-1),token(NOTOKEN){}
inline Symbol(int lineNum, Token token):
lineNum(lineNum), token(token){}
inline Symbol(int lineNum, Token token, const QByteArray &lexem):
lineNum(lineNum), token(token),lex(lexem){}
inline Symbol(int lineNum, Token token, const QByteArray &lexem, int from, int len):
lineNum(lineNum), token(token){
LexemStore::const_iterator it = lexemStore.constFind(SubArray(lexem, from, len));
if (it != lexemStore.constEnd()) {
lex = it.key().array;
} else {
lex = lexem.mid(from, len);
lexemStore.insert(lex, QHashDummyValue());
}
}
int lineNum;
Token token;
inline QByteArray unquotedLexem() const { return lex.mid(1, lex.length()-2); }
inline QByteArray lexem() const { return lex; }
inline operator QByteArray() const { return lex; }
QByteArray lex;
#else
inline Symbol() = default;
inline Symbol(int lineNum, Token token) : lineNum(lineNum), token(token) { }
inline Symbol(int lineNum, Token token, const QByteArray &lexem)
@ -99,8 +67,6 @@ struct Symbol
QByteArray lex;
qsizetype from = 0;
qsizetype len = -1;
#endif
};
Q_DECLARE_TYPEINFO(Symbol, Q_RELOCATABLE_TYPE);