summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Kosmale <[email protected]>2023-07-28 16:03:20 +0200
committerFabian Kosmale <[email protected]>2023-08-10 10:17:45 +0200
commitc4bb02ce623ad2a6c3a1bead84bd16ae03cd4252 (patch)
tree4a0054f0b770c8bbe3c396a4b75e8241dc46c1b1
parent29d07101e5dd7efbb0ffbab1acb5d8d4ef0ed731 (diff)
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 <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
-rw-r--r--src/tools/moc/parser.cpp4
-rw-r--r--src/tools/moc/preprocessor.cpp21
-rw-r--r--src/tools/moc/preprocessor.h4
-rw-r--r--src/tools/moc/symbols.h34
4 files changed, 2 insertions, 61 deletions
diff --git a/src/tools/moc/parser.cpp b/src/tools/moc/parser.cpp
index ab3131f7325..1cfb8ce4868 100644
--- a/src/tools/moc/parser.cpp
+++ b/src/tools/moc/parser.cpp
@@ -8,10 +8,6 @@
QT_BEGIN_NAMESPACE
-#ifdef USE_LEXEM_STORE
-Symbol::LexemStore Symbol::lexemStore;
-#endif
-
static const char *error_msg = nullptr;
/*! \internal
diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp
index 49df66baf76..f0a61ce6217 100644
--- a/src/tools/moc/preprocessor.cpp
+++ b/src/tools/moc/preprocessor.cpp
@@ -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
diff --git a/src/tools/moc/preprocessor.h b/src/tools/moc/preprocessor.h
index 624b00ff105..3509e83dce8 100644
--- a/src/tools/moc/preprocessor.h
+++ b/src/tools/moc/preprocessor.h
@@ -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;
diff --git a/src/tools/moc/symbols.h b/src/tools/moc/symbols.h
index c02f306c12e..a0c83de5750 100644
--- a/src/tools/moc/symbols.h
+++ b/src/tools/moc/symbols.h
@@ -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);