7#include <QtCore/qmutex.h>
14template<
typename T>
class WriteSynchronizedRef
16 Q_DISABLE_COPY_MOVE(WriteSynchronizedRef)
19 WriteSynchronizedRef(std::vector<T> &vector) Q_DECL_NOEXCEPT
23 void emplace_back(T &&value)
25 QMutexLocker lock(&m_mutex);
26 m_vector.push_back(std::move(value));
29 void emplace_back(
const T &value)
31 QMutexLocker lock(&m_mutex);
32 m_vector.emplace_back(value);
35 void emplace_bulk(std::vector<T> && values)
37 QMutexLocker lock(&m_mutex);
38 if (!m_vector.empty()) {
39 m_vector.insert(m_vector.cend(), std::make_move_iterator(values.begin()),
40 std::make_move_iterator(values.end()));
42 m_vector = std::move(values);
47 mutable QMutex m_mutex;
48 std::vector<T> &m_vector;
76 mutable std::atomic<size_t> m_next = 0;
void HandleTranslationUnit(clang::ASTContext &context) override
LupdateASTConsumer(clang::ASTContext *context, Stores *stores)
std::unique_ptr< clang::ASTConsumer > CreateASTConsumer(clang::CompilerInstance &compiler, llvm::StringRef) override
LupdateFrontendAction(Stores *stores)
bool operator()(const clang::RawComment &LHS, const clang::RawComment &RHS)
BeforeThanCompare(const clang::SourceManager &SM)
bool operator()(const clang::RawComment *LHS, const clang::RawComment *RHS)
bool VisitNamedDecl(clang::NamedDecl *namedDeclaration)
void findContextForTranslationStoresFromPP(clang::NamedDecl *namedDeclaration)
LupdateVisitor(clang::ASTContext *context, Stores *stores)
bool VisitCallExpr(clang::CallExpr *callExpression)
void processPreprocessorCalls()
QT_WARNING_PUSH QT_WARNING_POP QT_BEGIN_NAMESPACE QString toQt(llvm::StringRef str)
#define LUPDATE_CLANG_VERSION
#define LUPDATE_CLANG_VERSION_CHECK(major, minor, patch)
std::vector< std::string > getAliasFunctionDefinition()
void finalize(ReadSynchronizedRef< TranslationRelatedStore > &ast, WriteSynchronizedRef< TranslationRelatedStore > &newAst)
bool stringContainsTranslationInformation(llvm::StringRef ba)
void correctAstTranslationContext(ReadSynchronizedRef< TranslationRelatedStore > &ast, WriteSynchronizedRef< TranslationRelatedStore > &newAst, const TranslationStores &qDecl)
void collectMessages(TranslatorMessageVector &result, TranslationRelatedStore &store)
TranslatorMessage translatorMessage(const TranslationRelatedStore &store, const QString &id, bool plural, bool isID, bool isWarningOnly=false)
void loadCPP(Translator &translator, const QStringList &filenames, ConversionData &cd, bool *fail)
bool hasQuote(llvm::StringRef source)
QString cleanQuote(const std::string &token)
void exploreChildrenForFirstStringLiteral(clang::Stmt *stmt, QString &context)
bool trFunctionPresent(llvm::StringRef text)
QString exploreBases(clang::CXXRecordDecl *recordDecl, const clang::SourceManager &sm)
QString cleanQuote(llvm::StringRef s, QuoteCompulsary quote)
bool isPointWithin(const clang::SourceRange &sourceRange, const clang::SourceLocation &point, const clang::SourceManager &sm)
bool isQObjectOrQDeclareTrFunctionMacroDeclared(clang::CXXRecordDecl *recordDecl, QString &context, const clang::SourceManager &sm)
static bool capture(const QRegularExpression &exp, const QString &line, QString *i, QString *c)
bool isFileSignificant(const std::string &filePath)
QString fixedLineEndings(const QString &s)
QString contextForFunctionDecl(clang::FunctionDecl *func, const std::string &funcName)
QString contextForNoopMacro(clang::NamedDecl *namedDecl, const clang::SourceManager &sm)
QString lookForContext(clang::CXXRecordDecl *recordDecl, const clang::SourceManager &sm)
Combined button and popup list for selecting options.
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcEventDispatcher)
Stores(TranslationStores &a, TranslationStores &qd, TranslationStores &qn)
WriteSynchronizedRef< TranslationRelatedStore > QDeclareTrWithContext
WriteSynchronizedRef< TranslationRelatedStore > QNoopTranlsationWithContext
TranslationStores Preprocessor
WriteSynchronizedRef< TranslationRelatedStore > AST