Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QQmlJSAotCompiler Class Reference

#include <qqmljscompiler_p.h>

+ Inheritance diagram for QQmlJSAotCompiler:
+ Collaboration diagram for QQmlJSAotCompiler:

Public Member Functions

 QQmlJSAotCompiler (QQmlJSImporter *importer, const QString &resourcePath, const QStringList &qmldirFiles, QQmlJSLogger *logger)
 
virtual ~QQmlJSAotCompiler ()=default
 
virtual void setDocument (const QmlIR::JSCodeGen *codegen, const QmlIR::Document *document)
 
virtual void setScope (const QmlIR::Object *object, const QmlIR::Object *scope)
 
virtual std::variant< QQmlJSAotFunction, QQmlJS::DiagnosticMessagecompileBinding (const QV4::Compiler::Context *context, const QmlIR::Binding &irBinding, QQmlJS::AST::Node *astNode)
 
virtual std::variant< QQmlJSAotFunction, QQmlJS::DiagnosticMessagecompileFunction (const QV4::Compiler::Context *context, const QString &name, QQmlJS::AST::Node *astNode)
 
virtual QQmlJSAotFunction globalCode () const
 

Protected Member Functions

virtual QQmlJS::DiagnosticMessage diagnose (const QString &message, QtMsgType type, const QQmlJS::SourceLocation &location) const
 

Protected Attributes

QQmlJSTypeResolver m_typeResolver
 
const QString m_resourcePath
 
const QStringList m_qmldirFiles
 
const QmlIR::Documentm_document = nullptr
 
const QmlIR::Objectm_currentObject = nullptr
 
const QmlIR::Objectm_currentScope = nullptr
 
const QV4::Compiler::JSUnitGeneratorm_unitGenerator = nullptr
 
QQmlJSImporterm_importer = nullptr
 
QQmlJSLoggerm_logger = nullptr
 

Detailed Description

Definition at line 56 of file qqmljscompiler_p.h.

Constructor & Destructor Documentation

◆ QQmlJSAotCompiler()

QQmlJSAotCompiler::QQmlJSAotCompiler ( QQmlJSImporter importer,
const QString resourcePath,
const QStringList qmldirFiles,
QQmlJSLogger logger 
)

Definition at line 633 of file qqmljscompiler.cpp.

◆ ~QQmlJSAotCompiler()

virtual QQmlJSAotCompiler::~QQmlJSAotCompiler ( )
virtualdefault

Member Function Documentation

◆ compileBinding()

std::variant< QQmlJSAotFunction, QQmlJS::DiagnosticMessage > QQmlJSAotCompiler::compileBinding ( const QV4::Compiler::Context context,
const QmlIR::Binding irBinding,
QQmlJS::AST::Node astNode 
)
virtual

Reimplemented in QQmlJSLinterCodegen.

Definition at line 697 of file qqmljscompiler.cpp.

References QQmlJSAotFunction::code, context, diagnose(), error, function, QQmlJSAotFunction::includes, QmlIR::Object::location, m_currentObject, m_currentScope, m_document, m_typeResolver, QV4::CompiledData::Binding::propertyNameIndex, qCDebug, QtDebugMsg, QtWarningMsg, QQmlJSFunctionInitializer::run(), and QmlIR::Document::stringAt().

+ Here is the call graph for this function:

◆ compileFunction()

std::variant< QQmlJSAotFunction, QQmlJS::DiagnosticMessage > QQmlJSAotCompiler::compileFunction ( const QV4::Compiler::Context context,
const QString name,
QQmlJS::AST::Node astNode 
)
virtual

Reimplemented in QQmlJSLinterCodegen.

Definition at line 724 of file qqmljscompiler.cpp.

References QQmlJSAotFunction::code, context, diagnose(), error, function, QQmlJSAotFunction::includes, QmlIR::Object::location, m_currentObject, m_currentScope, m_typeResolver, qCDebug, QtWarningMsg, and QQmlJSFunctionInitializer::run().

+ Here is the call graph for this function:

◆ diagnose()

QQmlJS::DiagnosticMessage QQmlJSAotCompiler::diagnose ( const QString message,
QtMsgType  type,
const QQmlJS::SourceLocation location 
) const
protectedvirtual

Definition at line 675 of file qqmljscompiler.cpp.

References fileName, QQmlJSLogger::isCategoryFatal(), isStrict(), QQmlJSLogger::log(), m_document, m_logger, m_resourcePath, qFatal, qmlCompiler, qPrintable, QtCriticalMsg, QtFatalMsg, and QtWarningMsg.

Referenced by compileBinding(), QQmlJSLinterCodegen::compileBinding(), compileFunction(), and QQmlJSLinterCodegen::compileFunction().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ globalCode()

QQmlJSAotFunction QQmlJSAotCompiler::globalCode ( ) const
virtual

Definition at line 741 of file qqmljscompiler.cpp.

References global.

Referenced by qCompileQmlFile().

+ Here is the caller graph for this function:

◆ setDocument()

void QQmlJSAotCompiler::setDocument ( const QmlIR::JSCodeGen codegen,
const QmlIR::Document document 
)
virtual

Reimplemented in QQmlJSLinterCodegen.

Definition at line 644 of file qqmljscompiler.cpp.

References QFileInfo::canonicalPath(), QmlIR::Document::code, QQmlJSScope::create(), QFileInfo::fileName(), QQmlJSTypeResolver::init(), QmlIR::Document::jsGenerator, m_document, m_importer, m_logger, m_qmldirFiles, m_resourcePath, m_typeResolver, m_unitGenerator, QmlIR::Document::program, Q_UNUSED, QQmlJSLogger::setCode(), and QQmlJSLogger::setFileName().

Referenced by qCompileQmlFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setScope()

void QQmlJSAotCompiler::setScope ( const QmlIR::Object object,
const QmlIR::Object scope 
)
virtual

Definition at line 660 of file qqmljscompiler.cpp.

References m_currentObject, and m_currentScope.

Referenced by qCompileQmlFile().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_currentObject

const QmlIR::Object* QQmlJSAotCompiler::m_currentObject = nullptr
protected

◆ m_currentScope

const QmlIR::Object* QQmlJSAotCompiler::m_currentScope = nullptr
protected

◆ m_document

const QmlIR::Document* QQmlJSAotCompiler::m_document = nullptr
protected

◆ m_importer

QQmlJSImporter* QQmlJSAotCompiler::m_importer = nullptr
protected

Definition at line 88 of file qqmljscompiler_p.h.

Referenced by setDocument().

◆ m_logger

QQmlJSLogger* QQmlJSAotCompiler::m_logger = nullptr
protected

Definition at line 89 of file qqmljscompiler_p.h.

Referenced by diagnose(), and setDocument().

◆ m_qmldirFiles

const QStringList QQmlJSAotCompiler::m_qmldirFiles
protected

Definition at line 81 of file qqmljscompiler_p.h.

Referenced by setDocument().

◆ m_resourcePath

const QString QQmlJSAotCompiler::m_resourcePath
protected

Definition at line 80 of file qqmljscompiler_p.h.

Referenced by diagnose(), and setDocument().

◆ m_typeResolver

◆ m_unitGenerator

const QV4::Compiler::JSUnitGenerator* QQmlJSAotCompiler::m_unitGenerator = nullptr
protected

Definition at line 86 of file qqmljscompiler_p.h.

Referenced by setDocument(), and QQmlJSLinterCodegen::setDocument().


The documentation for this class was generated from the following files: