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

#include <qqmljstyperesolver_p.h>

+ Collaboration diagram for QQmlJSTypeResolver:

Classes

struct  TrackedType
 

Public Types

enum  ParentMode { UseDocumentParent , UseParentProperty }
 
enum  CloneMode { CloneTypes , DoNotCloneTypes }
 
enum  ListMode { UseListProperty , UseQObjectList }
 
enum class  UnaryOperator {
  Not , Plus , Minus , Increment ,
  Decrement , Complement
}
 
enum class  ComponentIsGeneric { No , Yes }
 

Public Member Functions

 QQmlJSTypeResolver (QQmlJSImporter *importer)
 
void init (QQmlJSImportVisitor *visitor, QQmlJS::AST::Node *program)
 
QQmlJSScope::ConstPtr voidType () const
 
QQmlJSScope::ConstPtr emptyType () const
 
QQmlJSScope::ConstPtr nullType () const
 
QQmlJSScope::ConstPtr realType () const
 
QQmlJSScope::ConstPtr floatType () const
 
QQmlJSScope::ConstPtr int8Type () const
 
QQmlJSScope::ConstPtr uint8Type () const
 
QQmlJSScope::ConstPtr int16Type () const
 
QQmlJSScope::ConstPtr uint16Type () const
 
QQmlJSScope::ConstPtr int32Type () const
 
QQmlJSScope::ConstPtr uint32Type () const
 
QQmlJSScope::ConstPtr int64Type () const
 
QQmlJSScope::ConstPtr uint64Type () const
 
QQmlJSScope::ConstPtr boolType () const
 
QQmlJSScope::ConstPtr stringType () const
 
QQmlJSScope::ConstPtr stringListType () const
 
QQmlJSScope::ConstPtr byteArrayType () const
 
QQmlJSScope::ConstPtr urlType () const
 
QQmlJSScope::ConstPtr dateTimeType () const
 
QQmlJSScope::ConstPtr dateType () const
 
QQmlJSScope::ConstPtr timeType () const
 
QQmlJSScope::ConstPtr variantListType () const
 
QQmlJSScope::ConstPtr variantMapType () const
 
QQmlJSScope::ConstPtr varType () const
 
QQmlJSScope::ConstPtr jsValueType () const
 
QQmlJSScope::ConstPtr jsPrimitiveType () const
 
QQmlJSScope::ConstPtr listPropertyType () const
 
QQmlJSScope::ConstPtr metaObjectType () const
 
QQmlJSScope::ConstPtr functionType () const
 
QQmlJSScope::ConstPtr jsGlobalObject () const
 
QQmlJSScope::ConstPtr qObjectType () const
 
QQmlJSScope::ConstPtr qObjectListType () const
 
QQmlJSScope::ConstPtr arrayPrototype () const
 
QQmlJSScope::ConstPtr scopeForLocation (const QV4::CompiledData::Location &location) const
 
QQmlJSScope::ConstPtr scopeForId (const QString &id, const QQmlJSScope::ConstPtr &referrer) const
 
QString idForScope (const QQmlJSScope::ConstPtr &scope, const QQmlJSScope::ConstPtr &referrer) const
 
bool isPrefix (const QString &name) const
 
QQmlJSScope::ConstPtr typeForName (const QString &name) const
 
QQmlJSScope::ConstPtr typeFromAST (QQmlJS::AST::Type *type) const
 
QQmlJSScope::ConstPtr typeForConst (QV4::ReturnedValue rv) const
 
QQmlJSRegisterContent typeForBinaryOperation (QSOperator::Op oper, const QQmlJSRegisterContent &left, const QQmlJSRegisterContent &right) const
 
QQmlJSRegisterContent typeForArithmeticUnaryOperation (UnaryOperator op, const QQmlJSRegisterContent &operand) const
 
bool isPrimitive (const QQmlJSRegisterContent &type) const
 
bool isNumeric (const QQmlJSRegisterContent &type) const
 
bool isIntegral (const QQmlJSRegisterContent &type) const
 
bool canConvertFromTo (const QQmlJSScope::ConstPtr &from, const QQmlJSScope::ConstPtr &to) const
 
bool canConvertFromTo (const QQmlJSRegisterContent &from, const QQmlJSRegisterContent &to) const
 
QQmlJSRegisterContent merge (const QQmlJSRegisterContent &a, const QQmlJSRegisterContent &b) const
 
QQmlJSScope::ConstPtr genericType (const QQmlJSScope::ConstPtr &type, ComponentIsGeneric allowComponent=ComponentIsGeneric::No) const
 
QQmlJSRegisterContent builtinType (const QQmlJSScope::ConstPtr &type) const
 
QQmlJSRegisterContent globalType (const QQmlJSScope::ConstPtr &type) const
 
QQmlJSRegisterContent scopedType (const QQmlJSScope::ConstPtr &scope, const QString &name) const
 
QQmlJSRegisterContent memberType (const QQmlJSRegisterContent &type, const QString &name) const
 
QQmlJSRegisterContent valueType (const QQmlJSRegisterContent &list) const
 
QQmlJSRegisterContent returnType (const QQmlJSScope::ConstPtr &type, QQmlJSRegisterContent::ContentVariant variant, const QQmlJSScope::ConstPtr &scope) const
 
bool registerIsStoredIn (const QQmlJSRegisterContent &reg, const QQmlJSScope::ConstPtr &type) const
 
bool registerContains (const QQmlJSRegisterContent &reg, const QQmlJSScope::ConstPtr &type) const
 
QQmlJSScope::ConstPtr containedType (const QQmlJSRegisterContent &container) const
 
QString containedTypeName (const QQmlJSRegisterContent &container, bool useFancyName=false) const
 
QQmlJSRegisterContent tracked (const QQmlJSRegisterContent &type) const
 
QQmlJSRegisterContent original (const QQmlJSRegisterContent &type) const
 
QQmlJSScope::ConstPtr trackedContainedType (const QQmlJSRegisterContent &container) const
 
QQmlJSScope::ConstPtr originalContainedType (const QQmlJSRegisterContent &container) const
 
bool adjustTrackedType (const QQmlJSScope::ConstPtr &tracked, const QQmlJSScope::ConstPtr &conversion) const
 
bool adjustTrackedType (const QQmlJSScope::ConstPtr &tracked, const QList< QQmlJSScope::ConstPtr > &conversions) const
 
void adjustOriginalType (const QQmlJSScope::ConstPtr &tracked, const QQmlJSScope::ConstPtr &conversion) const
 
void generalizeType (const QQmlJSScope::ConstPtr &type) const
 
void setParentMode (ParentMode mode)
 
ParentMode parentMode () const
 
void setCloneMode (CloneMode mode)
 
bool cloneMode () const
 
QQmlJSScope::ConstPtr storedType (const QQmlJSScope::ConstPtr &type) const
 
QQmlJSScope::ConstPtr originalType (const QQmlJSScope::ConstPtr &type) const
 
QQmlJSScope::ConstPtr trackedType (const QQmlJSScope::ConstPtr &type) const
 
QQmlJSScope::ConstPtr comparableType (const QQmlJSScope::ConstPtr &type) const
 
const QQmlJSScopesByIdobjectsById () const
 
bool canCallJSFunctions () const
 
bool canAddressValueTypes () const
 
const QHash< QQmlJS::SourceLocation, QQmlJSMetaSignalHandler > & signalHandlers () const
 
bool equals (const QQmlJSScope::ConstPtr &a, const QQmlJSScope::ConstPtr &b) const
 
QQmlJSRegisterContent convert (const QQmlJSRegisterContent &from, const QQmlJSRegisterContent &to) const
 
QQmlJSScope::ConstPtr merge (const QQmlJSScope::ConstPtr &a, const QQmlJSScope::ConstPtr &b) const
 
bool canHoldUndefined (const QQmlJSRegisterContent &content) const
 
bool isNumeric (const QQmlJSScope::ConstPtr &type) const
 
bool isIntegral (const QQmlJSScope::ConstPtr &type) const
 
bool isSignedInteger (const QQmlJSScope::ConstPtr &type) const
 
bool isUnsignedInteger (const QQmlJSScope::ConstPtr &type) const
 
bool canHold (const QQmlJSScope::ConstPtr &container, const QQmlJSScope::ConstPtr &contained) const
 
bool canPopulate (const QQmlJSScope::ConstPtr &type, const QQmlJSScope::ConstPtr &argument, bool *isExtension) const
 
QQmlJSMetaMethod selectConstructor (const QQmlJSScope::ConstPtr &type, const QQmlJSScope::ConstPtr &argument, bool *isExtension) const
 
bool areEquivalentLists (const QQmlJSScope::ConstPtr &a, const QQmlJSScope::ConstPtr &b) const
 
bool isTriviallyCopyable (const QQmlJSScope::ConstPtr &type) const
 

Protected Member Functions

QQmlJSRegisterContent memberType (const QQmlJSScope::ConstPtr &type, const QString &name) const
 
QQmlJSRegisterContent memberEnumType (const QQmlJSScope::ConstPtr &type, const QString &name) const
 
bool isPrimitive (const QQmlJSScope::ConstPtr &type) const
 
bool checkEnums (const QQmlJSScope::ConstPtr &scope, const QString &name, QQmlJSRegisterContent *result, QQmlJSScope::ExtensionKind mode) const
 
bool canPrimitivelyConvertFromTo (const QQmlJSScope::ConstPtr &from, const QQmlJSScope::ConstPtr &to) const
 
QQmlJSRegisterContent lengthProperty (bool isWritable, const QQmlJSScope::ConstPtr &scope) const
 
QQmlJSRegisterContent transformed (const QQmlJSRegisterContent &origin, QQmlJSScope::ConstPtr(QQmlJSTypeResolver::*op)(const QQmlJSScope::ConstPtr &) const) const
 
QQmlJSRegisterContent registerContentForName (const QString &name, const QQmlJSScope::ConstPtr &scopeType=QQmlJSScope::ConstPtr(), bool hasObjectModuelPrefix=false) const
 

Protected Attributes

QQmlJSScope::ConstPtr m_voidType
 
QQmlJSScope::ConstPtr m_emptyType
 
QQmlJSScope::ConstPtr m_nullType
 
QQmlJSScope::ConstPtr m_numberPrototype
 
QQmlJSScope::ConstPtr m_arrayPrototype
 
QQmlJSScope::ConstPtr m_realType
 
QQmlJSScope::ConstPtr m_floatType
 
QQmlJSScope::ConstPtr m_int8Type
 
QQmlJSScope::ConstPtr m_uint8Type
 
QQmlJSScope::ConstPtr m_int16Type
 
QQmlJSScope::ConstPtr m_uint16Type
 
QQmlJSScope::ConstPtr m_int32Type
 
QQmlJSScope::ConstPtr m_uint32Type
 
QQmlJSScope::ConstPtr m_int64Type
 
QQmlJSScope::ConstPtr m_uint64Type
 
QQmlJSScope::ConstPtr m_boolType
 
QQmlJSScope::ConstPtr m_stringType
 
QQmlJSScope::ConstPtr m_stringListType
 
QQmlJSScope::ConstPtr m_byteArrayType
 
QQmlJSScope::ConstPtr m_urlType
 
QQmlJSScope::ConstPtr m_dateTimeType
 
QQmlJSScope::ConstPtr m_dateType
 
QQmlJSScope::ConstPtr m_timeType
 
QQmlJSScope::ConstPtr m_variantListType
 
QQmlJSScope::ConstPtr m_variantMapType
 
QQmlJSScope::ConstPtr m_varType
 
QQmlJSScope::ConstPtr m_jsValueType
 
QQmlJSScope::ConstPtr m_jsPrimitiveType
 
QQmlJSScope::ConstPtr m_listPropertyType
 
QQmlJSScope::ConstPtr m_qObjectType
 
QQmlJSScope::ConstPtr m_qObjectListType
 
QQmlJSScope::ConstPtr m_metaObjectType
 
QQmlJSScope::ConstPtr m_functionType
 
QQmlJSScope::ConstPtr m_jsGlobalObject
 
QQmlJSScopesById m_objectsById
 
QHash< QV4::CompiledData::Location, QQmlJSScope::ConstPtrm_objectsByLocation
 
QQmlJSImporter::ImportedTypes m_imports
 
QHash< QQmlJS::SourceLocation, QQmlJSMetaSignalHandlerm_signalHandlers
 
ParentMode m_parentMode = UseParentProperty
 
CloneMode m_cloneMode = CloneTypes
 
QQmlJSLoggerm_logger = nullptr
 
std::unique_ptr< QHash< QQmlJSScope::ConstPtr, TrackedType > > m_trackedTypes
 

Detailed Description

Definition at line 30 of file qqmljstyperesolver_p.h.

Member Enumeration Documentation

◆ CloneMode

Enumerator
CloneTypes 
DoNotCloneTypes 

Definition at line 34 of file qqmljstyperesolver_p.h.

◆ ComponentIsGeneric

Enumerator
No 
Yes 

Definition at line 110 of file qqmljstyperesolver_p.h.

◆ ListMode

Enumerator
UseListProperty 
UseQObjectList 

Definition at line 35 of file qqmljstyperesolver_p.h.

◆ ParentMode

Enumerator
UseDocumentParent 
UseParentProperty 

Definition at line 33 of file qqmljstyperesolver_p.h.

◆ UnaryOperator

Enumerator
Not 
Plus 
Minus 
Increment 
Decrement 
Complement 

Definition at line 97 of file qqmljstyperesolver_p.h.

Constructor & Destructor Documentation

◆ QQmlJSTypeResolver()

Member Function Documentation

◆ adjustOriginalType()

void QQmlJSTypeResolver::adjustOriginalType ( const QQmlJSScope::ConstPtr tracked,
const QQmlJSScope::ConstPtr conversion 
) const

Definition at line 543 of file qqmljstyperesolver.cpp.

References QQmlJSScope::clone(), DoNotCloneTypes, it, m_cloneMode, m_trackedTypes, Q_ASSERT, and tracked().

+ Here is the call graph for this function:

◆ adjustTrackedType() [1/2]

bool QQmlJSTypeResolver::adjustTrackedType ( const QQmlJSScope::ConstPtr tracked,
const QList< QQmlJSScope::ConstPtr > &  conversions 
) const

Definition at line 517 of file qqmljstyperesolver.cpp.

References canPopulate(), canPrimitivelyConvertFromTo(), QQmlJSScope::clone(), comparableType(), DoNotCloneTypes, QQmlJSMetaMethod::isValid(), it, m_cloneMode, m_trackedTypes, merge(), Q_ASSERT, selectConstructor(), and tracked().

+ Here is the call graph for this function:

◆ adjustTrackedType() [2/2]

bool QQmlJSTypeResolver::adjustTrackedType ( const QQmlJSScope::ConstPtr tracked,
const QQmlJSScope::ConstPtr conversion 
) const

Definition at line 495 of file qqmljstyperesolver.cpp.

References canPopulate(), canPrimitivelyConvertFromTo(), QQmlJSScope::clone(), comparableType(), DoNotCloneTypes, it, m_cloneMode, m_trackedTypes, Q_ASSERT, selectConstructor(), and tracked().

+ Here is the call graph for this function:

◆ areEquivalentLists()

bool QQmlJSTypeResolver::areEquivalentLists ( const QQmlJSScope::ConstPtr a,
const QQmlJSScope::ConstPtr b 
) const

Definition at line 1110 of file qqmljstyperesolver.cpp.

References equals(), QQmlJSScope::listType(), m_stringListType, m_stringType, m_variantListType, and m_varType.

Referenced by canPrimitivelyConvertFromTo(), and QQmlJSCodeGenerator::convertStored().

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

◆ arrayPrototype()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::arrayPrototype ( ) const
inline

Definition at line 74 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypePropagator::generate_CallProperty().

+ Here is the caller graph for this function:

◆ boolType()

◆ builtinType()

QQmlJSRegisterContent QQmlJSTypeResolver::builtinType ( const QQmlJSScope::ConstPtr type) const

Definition at line 862 of file qqmljstyperesolver.cpp.

References QQmlJSRegisterContent::Builtin, QQmlJSRegisterContent::create(), Q_ASSERT, and storedType().

Referenced by typeForArithmeticUnaryOperation(), and typeForBinaryOperation().

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

◆ byteArrayType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::byteArrayType ( ) const
inline

Definition at line 58 of file qqmljstyperesolver_p.h.

Referenced by canConvertForLiteralBinding(), and QQmlJSCodeGenerator::convertStored().

+ Here is the caller graph for this function:

◆ canAddressValueTypes()

bool QQmlJSTypeResolver::canAddressValueTypes ( ) const
inline

Definition at line 160 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypePropagator::generate_As(), and registerContentForName().

+ Here is the caller graph for this function:

◆ canCallJSFunctions()

bool QQmlJSTypeResolver::canCallJSFunctions ( ) const
inline

Definition at line 159 of file qqmljstyperesolver_p.h.

◆ canConvertFromTo() [1/2]

bool QQmlJSTypeResolver::canConvertFromTo ( const QQmlJSRegisterContent from,
const QQmlJSRegisterContent to 
) const

Definition at line 622 of file qqmljstyperesolver.cpp.

References canConvertFromTo(), and containedType().

+ Here is the call graph for this function:

◆ canConvertFromTo() [2/2]

bool QQmlJSTypeResolver::canConvertFromTo ( const QQmlJSScope::ConstPtr from,
const QQmlJSScope::ConstPtr to 
) const

Definition at line 593 of file qqmljstyperesolver.cpp.

References canPopulate(), canPrimitivelyConvertFromTo(), equals(), QQmlJSScope::internalName(), QDeferredSharedPointer< T >::isNull(), m_stringType, and selectConstructor().

Referenced by canConvertForLiteralBinding(), canConvertFromTo(), and canPrimitivelyConvertFromTo().

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

◆ canHold()

bool QQmlJSTypeResolver::canHold ( const QQmlJSScope::ConstPtr container,
const QQmlJSScope::ConstPtr contained 
) const

Definition at line 730 of file qqmljstyperesolver.cpp.

References QQmlJSScope::accessSemantics(), base, equals(), isPrimitive(), QQmlJSScope::isReferenceType(), m_jsPrimitiveType, m_jsValueType, m_listPropertyType, m_qObjectListType, m_variantListType, m_varType, QQmlJSUtils::searchBaseAndExtensionTypes(), and QQmlJSScope::valueType().

Referenced by canPopulate(), memberType(), and selectConstructor().

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

◆ canHoldUndefined()

bool QQmlJSTypeResolver::canHoldUndefined ( const QQmlJSRegisterContent content) const

Definition at line 773 of file qqmljstyperesolver.cpp.

References containedType(), QQmlJSRegisterContent::conversionOrigins(), equals(), QQmlJSRegisterContent::isConversion(), m_jsPrimitiveType, m_jsValueType, m_varType, m_voidType, origins, and QQmlJSRegisterContent::storedType().

Referenced by QQmlJSTypePropagator::generate_Ret(), and QQmlJSTypePropagator::generate_StoreNameCommon().

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

◆ canPopulate()

bool QQmlJSTypeResolver::canPopulate ( const QQmlJSScope::ConstPtr type,
const QQmlJSScope::ConstPtr argument,
bool *  isExtension 
) const

Definition at line 1030 of file qqmljstyperesolver.cpp.

References canHold(), and isPrimitive().

Referenced by adjustTrackedType(), adjustTrackedType(), canConvertFromTo(), QQmlJSCodeGenerator::convertContained(), QQmlJSCodeGenerator::convertStored(), and QQmlJSCodeGenerator::generate_DefineObjectLiteral().

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

◆ canPrimitivelyConvertFromTo()

bool QQmlJSTypeResolver::canPrimitivelyConvertFromTo ( const QQmlJSScope::ConstPtr from,
const QQmlJSScope::ConstPtr to 
) const
protected

Definition at line 1151 of file qqmljstyperesolver.cpp.

References QQmlJSScope::accessSemantics(), areEquivalentLists(), QQmlJSScope::baseType(), canConvertFromTo(), equals(), QQmlJSScope::internalName(), QQmlJSScope::isComposite(), QString::isEmpty(), QQmlJSScope::isListProperty(), QDeferredSharedPointer< T >::isNull(), isNumeric(), isPrimitive(), m_boolType, m_byteArrayType, m_dateTimeType, m_dateType, m_jsPrimitiveType, m_jsValueType, m_nullType, m_stringType, m_timeType, m_urlType, m_variantListType, m_varType, m_voidType, Q_ASSERT, QQmlJSScope::scopeType(), and QQmlJSScope::valueType().

Referenced by adjustTrackedType(), adjustTrackedType(), canConvertFromTo(), and selectConstructor().

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

◆ checkEnums()

bool QQmlJSTypeResolver::checkEnums ( const QQmlJSScope::ConstPtr scope,
const QString name,
QQmlJSRegisterContent result,
QQmlJSScope::ExtensionKind  mode 
) const
protected

Definition at line 995 of file qqmljstyperesolver.cpp.

References QQmlJSRegisterContent::create(), QQmlJSScope::ExtensionNamespace, QQmlJSRegisterContent::ExtensionObjectEnum, QQmlJSScope::ExtensionType, QQmlJSRegisterContent::ObjectEnum, QQmlJSScope::ownEnumerations(), and storedType().

Referenced by memberEnumType(), and memberType().

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

◆ cloneMode()

bool QQmlJSTypeResolver::cloneMode ( ) const
inline

Definition at line 151 of file qqmljstyperesolver_p.h.

◆ comparableType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::comparableType ( const QQmlJSScope::ConstPtr type) const

Definition at line 1574 of file qqmljstyperesolver.cpp.

References it, and m_trackedTypes.

Referenced by adjustTrackedType(), adjustTrackedType(), equals(), and QQmlJSCodeGenerator::run().

+ Here is the caller graph for this function:

◆ containedType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::containedType ( const QQmlJSRegisterContent container) const

Definition at line 322 of file qqmljstyperesolver.cpp.

References QQmlJSRegisterContent::conversionResult(), QQmlJSRegisterContent::enumeration(), QQmlJSRegisterContent::isConversion(), QQmlJSRegisterContent::isEnumeration(), QQmlJSRegisterContent::isImportNamespace(), QQmlJSRegisterContent::isMethod(), QQmlJSRegisterContent::isProperty(), QQmlJSRegisterContent::isType(), QQmlJSRegisterContent::ObjectModulePrefix, QQmlJSRegisterContent::property(), QQmlJSRegisterContent::ScopeModulePrefix, QQmlJSRegisterContent::scopeType(), QQmlJSRegisterContent::storedType(), QQmlJSMetaEnum::type(), QQmlJSMetaProperty::type(), QQmlJSRegisterContent::type(), and QQmlJSRegisterContent::variant().

Referenced by QQmlJSCodeGenerator::AccumulatorConverter::AccumulatorConverter(), canCompareWithQObject(), canCompareWithQUrl(), canConvertFromTo(), canHoldUndefined(), canStrictlyCompareWithVar(), containedTypeName(), QQmlJSCodeGenerator::contentPointer(), QQmlJSCodeGenerator::contentType(), QQmlJSCodeGenerator::conversion(), convert(), QQmlJSCodeGenerator::convertContained(), QQmlJSCodeGenerator::generate_As(), QQmlJSTypePropagator::generate_As(), QQmlJSTypePropagator::generate_CallProperty(), QQmlJSCodeGenerator::generate_DefineObjectLiteral(), QQmlJSCodeGenerator::generate_LoadElement(), QQmlJSTypePropagator::generate_LoadElement(), QQmlJSTypePropagator::generate_LoadQmlContextPropertyLookup(), QQmlJSTypePropagator::generate_Ret(), QQmlJSCodeGenerator::generate_SetLookup(), QQmlJSCodeGenerator::generate_StoreElement(), QQmlJSTypePropagator::generate_StoreElement(), QQmlJSTypePropagator::generate_StoreNameCommon(), QQmlJSTypePropagator::generate_StoreProperty(), isIntegral(), isNumeric(), isPrimitive(), merge(), originalContainedType(), trackedContainedType(), typeForArithmeticUnaryOperation(), and typeForBinaryOperation().

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

◆ containedTypeName()

QString QQmlJSTypeResolver::containedTypeName ( const QQmlJSRegisterContent container,
bool  useFancyName = false 
) const

Definition at line 569 of file qqmljstyperesolver.cpp.

References containedType(), QQmlJSRegisterContent::MetaType, QQmlJSScope::prettyName(), QQmlJSRegisterContent::ScopeAttached, QQmlJSRegisterContent::scopeType(), typeName, and QQmlJSRegisterContent::variant().

Referenced by QQmlJSTypePropagator::generate_CallProperty(), and QQmlJSTypePropagator::generate_Ret().

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

◆ convert()

QQmlJSRegisterContent QQmlJSTypeResolver::convert ( const QQmlJSRegisterContent from,
const QQmlJSRegisterContent to 
) const

Definition at line 1560 of file qqmljstyperesolver.cpp.

References containedType(), QQmlJSRegisterContent::conversionOrigins(), QQmlJSRegisterContent::create(), QQmlJSRegisterContent::isConversion(), QQmlJSRegisterContent::scopeType(), QQmlJSRegisterContent::storedType(), and QQmlJSRegisterContent::variant().

+ Here is the call graph for this function:

◆ dateTimeType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::dateTimeType ( ) const
inline

Definition at line 60 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSCodeGenerator::convertStored().

+ Here is the caller graph for this function:

◆ dateType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::dateType ( ) const
inline

Definition at line 61 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSCodeGenerator::convertStored().

+ Here is the caller graph for this function:

◆ emptyType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::emptyType ( ) const
inline

Definition at line 43 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypeResolver(), QQmlJSTypePropagator::generate_DeadTemporalZoneCheck(), QQmlJSTypePropagator::generate_InitializeBlockDeadTemporalZone(), and typeForConst().

+ Here is the caller graph for this function:

◆ equals()

bool QQmlJSTypeResolver::equals ( const QQmlJSScope::ConstPtr a,
const QQmlJSScope::ConstPtr b 
) const

Compares the origin types of a and b. A straight a == b would compare the identity of the pointers. However, since we clone types to keep track of them, we need a separate way to compare the clones. Usually you'd do *a == *b for that, but as QQmlJSScope is rather large, we offer an optimization here that uses the type tracking we already have in place.

Definition at line 1555 of file qqmljstyperesolver.cpp.

References comparableType().

Referenced by QQmlJSCodeGenerator::AccumulatorConverter::AccumulatorConverter(), areEquivalentLists(), canCompareWithQObject(), canCompareWithQUrl(), canConvertForLiteralBinding(), canConvertFromTo(), canHold(), canHoldUndefined(), canPrimitivelyConvertFromTo(), canStrictlyCompareWithVar(), QQmlJSCodeGenerator::contentType(), QQmlJSCodeGenerator::conversion(), QQmlJSCodeGenerator::convertContained(), QQmlJSCodeGenerator::convertStored(), QQmlJSCodeGenerator::generate_As(), QQmlJSTypePropagator::generate_CallProperty(), QQmlJSCodeGenerator::generate_CallPropertyLookup(), QQmlJSCodeGenerator::generate_CallQmlContextPropertyLookup(), QQmlJSTypePropagator::generate_DeadTemporalZoneCheck(), QQmlJSCodeGenerator::generate_DefineObjectLiteral(), QQmlJSCodeGenerator::generate_GetLookup(), QQmlJSCodeGenerator::generate_Ret(), genericType(), isNumeric(), isPrimitive(), isSignedInteger(), isTriviallyCopyable(), isTypeStorable(), isUnsignedInteger(), memberType(), merge(), QQmlJSCodeGenerator::metaType(), registerContains(), registerIsStoredIn(), scopedType(), selectConstructor(), storedType(), typeForArithmeticUnaryOperation(), typeForBinaryOperation(), and valueType().

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

◆ floatType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::floatType ( ) const
inline

Definition at line 46 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSCodeGenerator::convertStored().

+ Here is the caller graph for this function:

◆ functionType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::functionType ( ) const
inline

Definition at line 70 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypePropagator::generate_LoadClosure().

+ Here is the caller graph for this function:

◆ generalizeType()

void QQmlJSTypeResolver::generalizeType ( const QQmlJSScope::ConstPtr type) const

Definition at line 556 of file qqmljstyperesolver.cpp.

References QQmlJSScope::clone(), DoNotCloneTypes, genericType(), it, m_cloneMode, m_trackedTypes, and Q_ASSERT.

Referenced by QQmlJSStorageGeneralizer::run().

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

◆ genericType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::genericType ( const QQmlJSScope::ConstPtr type,
ComponentIsGeneric  allowComponent = ComponentIsGeneric::No 
) const

◆ globalType()

QQmlJSRegisterContent QQmlJSTypeResolver::globalType ( const QQmlJSScope::ConstPtr type) const

Definition at line 868 of file qqmljstyperesolver.cpp.

References QQmlJSRegisterContent::create(), storedType(), and QQmlJSRegisterContent::Unknown.

Referenced by QQmlJSCodeGenerator::convertContained(), QQmlJSCodeGenerator::convertStored(), QQmlJSCodeGenerator::generate_As(), QQmlJSTypePropagator::generate_As(), QQmlJSTypePropagator::generate_CallProperty(), QQmlJSTypePropagator::generate_CmpEqInt(), QQmlJSTypePropagator::generate_CmpEqNull(), QQmlJSTypePropagator::generate_CmpIn(), QQmlJSTypePropagator::generate_CmpNeInt(), QQmlJSTypePropagator::generate_CmpNeNull(), QQmlJSTypePropagator::generate_Construct(), QQmlJSTypePropagator::generate_ConvertThisToObject(), QQmlJSTypePropagator::generate_DefineArray(), QQmlJSTypePropagator::generate_DefineObjectLiteral(), QQmlJSCodeGenerator::generate_GetLookup(), QQmlJSTypePropagator::generate_InitializeBlockDeadTemporalZone(), QQmlJSTypePropagator::generate_JumpFalse(), QQmlJSTypePropagator::generate_JumpTrue(), QQmlJSTypePropagator::generate_LoadClosure(), QQmlJSTypePropagator::generate_LoadConst(), QQmlJSCodeGenerator::generate_LoadElement(), QQmlJSTypePropagator::generate_LoadElement(), QQmlJSTypePropagator::generate_LoadFalse(), QQmlJSTypePropagator::generate_LoadInt(), QQmlJSTypePropagator::generate_LoadLocal(), QQmlJSTypePropagator::generate_LoadNull(), QQmlJSTypePropagator::generate_LoadQmlContextPropertyLookup(), QQmlJSTypePropagator::generate_LoadRuntimeString(), QQmlJSTypePropagator::generate_LoadTrue(), QQmlJSTypePropagator::generate_LoadUndefined(), QQmlJSTypePropagator::generate_LoadZero(), QQmlJSTypePropagator::generate_MoveConst(), QQmlJSCodeGenerator::generate_StoreElement(), QQmlJSTypePropagator::generate_StoreElement(), QQmlJSTypePropagator::generate_StoreNameCommon(), QQmlJSCodeGenerator::generate_ThrowException(), QQmlJSTypePropagator::generate_ThrowException(), QQmlJSTypePropagator::generate_TypeofName(), QQmlJSTypePropagator::generate_TypeofValue(), QQmlJSTypePropagator::run(), QQmlJSFunctionInitializer::run(), and typeForBinaryOperation().

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

◆ idForScope()

QString QQmlJSTypeResolver::idForScope ( const QQmlJSScope::ConstPtr scope,
const QQmlJSScope::ConstPtr referrer 
) const

Definition at line 146 of file qqmljstyperesolver.cpp.

References QQmlJSScopesById::id(), and m_objectsById.

+ Here is the call graph for this function:

◆ init()

void QQmlJSTypeResolver::init ( QQmlJSImportVisitor visitor,
QQmlJS::AST::Node program 
)

Initializes the type resolver. As part of that initialization, makes visitor traverse the program when given.

Definition at line 113 of file qqmljstyperesolver.cpp.

References QQmlJSImportVisitor::addressableScopes(), QQmlJSScopesById::clear(), QHash< Key, T >::clear(), QQmlJSScope::ContextualTypes::clearTypes(), QQmlJSImportVisitor::imports(), QQmlJSImportVisitor::logger(), m_imports, m_logger, m_objectsById, m_objectsByLocation, m_signalHandlers, QQmlJSImportVisitor::scopesBylocation(), and QQmlJSImportVisitor::signalHandlers().

Referenced by QQmlJSLinter::lintFile(), and QQmlJSAotCompiler::setDocument().

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

◆ int16Type()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::int16Type ( ) const
inline

Definition at line 49 of file qqmljstyperesolver_p.h.

◆ int32Type()

◆ int64Type()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::int64Type ( ) const
inline

Definition at line 53 of file qqmljstyperesolver_p.h.

◆ int8Type()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::int8Type ( ) const
inline

Definition at line 47 of file qqmljstyperesolver_p.h.

◆ isIntegral() [1/2]

bool QQmlJSTypeResolver::isIntegral ( const QQmlJSRegisterContent type) const

Definition at line 277 of file qqmljstyperesolver.cpp.

References containedType(), and isIntegral().

Referenced by QQmlJSCodeGenerator::conversion(), QQmlJSCodeGenerator::convertContained(), QQmlJSCodeGenerator::generate_LoadElement(), QQmlJSCodeGenerator::generate_StoreElement(), isIntegral(), merge(), and typeForArithmeticUnaryOperation().

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

◆ isIntegral() [2/2]

bool QQmlJSTypeResolver::isIntegral ( const QQmlJSScope::ConstPtr type) const

Definition at line 282 of file qqmljstyperesolver.cpp.

References isSignedInteger(), and isUnsignedInteger().

+ Here is the call graph for this function:

◆ isNumeric() [1/2]

bool QQmlJSTypeResolver::isNumeric ( const QQmlJSRegisterContent type) const

Definition at line 272 of file qqmljstyperesolver.cpp.

References containedType(), and isNumeric().

Referenced by canConvertForLiteralBinding(), canPrimitivelyConvertFromTo(), QQmlJSCodeGenerator::contentPointer(), QQmlJSCodeGenerator::contentType(), QQmlJSCodeGenerator::conversion(), QQmlJSCodeGenerator::convertStored(), QQmlJSCodeGenerator::generate_LoadElement(), QQmlJSTypePropagator::generate_LoadElement(), QQmlJSCodeGenerator::generate_StoreElement(), QQmlJSTypePropagator::generate_StoreElement(), isNumeric(), isPrimitive(), merge(), and typeForBinaryOperation().

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

◆ isNumeric() [2/2]

bool QQmlJSTypeResolver::isNumeric ( const QQmlJSScope::ConstPtr type) const

Definition at line 295 of file qqmljstyperesolver.cpp.

References equals(), QQmlJSScope::ExtensionNamespace, m_numberPrototype, and QQmlJSUtils::searchBaseAndExtensionTypes().

+ Here is the call graph for this function:

◆ isPrefix()

bool QQmlJSTypeResolver::isPrefix ( const QString name) const
inline

Definition at line 82 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypePropagator::generate_LoadQmlContextPropertyLookup().

+ Here is the caller graph for this function:

◆ isPrimitive() [1/2]

bool QQmlJSTypeResolver::isPrimitive ( const QQmlJSRegisterContent type) const

Definition at line 267 of file qqmljstyperesolver.cpp.

References containedType(), and isPrimitive().

Referenced by canHold(), canPopulate(), canPrimitivelyConvertFromTo(), genericType(), isPrimitive(), and merge().

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

◆ isPrimitive() [2/2]

bool QQmlJSTypeResolver::isPrimitive ( const QQmlJSScope::ConstPtr type) const
protected

Definition at line 288 of file qqmljstyperesolver.cpp.

References equals(), isNumeric(), m_boolType, m_jsPrimitiveType, m_nullType, m_stringType, and m_voidType.

+ Here is the call graph for this function:

◆ isSignedInteger()

bool QQmlJSTypeResolver::isSignedInteger ( const QQmlJSScope::ConstPtr type) const

Definition at line 305 of file qqmljstyperesolver.cpp.

References equals(), m_int16Type, m_int32Type, and m_int8Type.

Referenced by QQmlJSCodeGenerator::convertStored(), QQmlJSTypePropagator::generate_LoadElement(), QQmlJSTypePropagator::generate_StoreElement(), and isIntegral().

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

◆ isTriviallyCopyable()

bool QQmlJSTypeResolver::isTriviallyCopyable ( const QQmlJSScope::ConstPtr type) const

Definition at line 1126 of file qqmljstyperesolver.cpp.

References QQmlSA::EnumScope, equals(), m_boolType, m_floatType, m_int16Type, m_int32Type, m_int64Type, m_int8Type, m_metaObjectType, m_nullType, m_realType, m_uint16Type, m_uint32Type, m_uint64Type, m_uint8Type, and m_voidType.

Referenced by QQmlJSCodeGenerator::shouldMoveRegister().

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

◆ isUnsignedInteger()

bool QQmlJSTypeResolver::isUnsignedInteger ( const QQmlJSScope::ConstPtr type) const

Definition at line 313 of file qqmljstyperesolver.cpp.

References equals(), m_uint16Type, m_uint32Type, and m_uint8Type.

Referenced by QQmlJSCodeGenerator::convertStored(), QQmlJSCodeGenerator::generate_LoadElement(), QQmlJSTypePropagator::generate_LoadElement(), QQmlJSCodeGenerator::generate_StoreElement(), QQmlJSTypePropagator::generate_StoreElement(), isIntegral(), and merge().

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

◆ jsGlobalObject()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::jsGlobalObject ( ) const
inline

Definition at line 71 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypePropagator::generate_CallProperty(), and QQmlJSCodeGenerator::generate_CallQmlContextPropertyLookup().

+ Here is the caller graph for this function:

◆ jsPrimitiveType()

◆ jsValueType()

◆ lengthProperty()

QQmlJSRegisterContent QQmlJSTypeResolver::lengthProperty ( bool  isWritable,
const QQmlJSScope::ConstPtr scope 
) const
protected

Definition at line 1253 of file qqmljstyperesolver.cpp.

References QQmlJSRegisterContent::Builtin, QQmlJSRegisterContent::create(), int32Type(), QQmlJSMetaProperty::setIsWritable(), QQmlJSMetaProperty::setPropertyName(), QQmlJSMetaProperty::setType(), and QQmlJSMetaProperty::setTypeName().

Referenced by memberType().

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

◆ listPropertyType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::listPropertyType ( ) const
inline

Definition at line 68 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSCodeGenerator::contentType(), QQmlJSCodeGenerator::convertStored(), QQmlJSCodeGenerator::generate_LoadElement(), and QQmlJSCodeGenerator::generate_StoreElement().

+ Here is the caller graph for this function:

◆ memberEnumType()

QQmlJSRegisterContent QQmlJSTypeResolver::memberEnumType ( const QQmlJSScope::ConstPtr type,
const QString name 
) const
protected

Definition at line 1368 of file qqmljstyperesolver.cpp.

References checkEnums(), and QQmlJSUtils::searchBaseAndExtensionTypes().

Referenced by memberType().

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

◆ memberType() [1/2]

QQmlJSRegisterContent QQmlJSTypeResolver::memberType ( const QQmlJSRegisterContent type,
const QString name 
) const

◆ memberType() [2/2]

◆ merge() [1/2]

QQmlJSRegisterContent QQmlJSTypeResolver::merge ( const QQmlJSRegisterContent a,
const QQmlJSRegisterContent b 
) const

Definition at line 634 of file qqmljstyperesolver.cpp.

References containedType(), QQmlJSRegisterContent::create(), erase(), merge(), mergeVariants(), and origins.

Referenced by adjustTrackedType(), QQmlJSTypePropagator::generate_As(), QQmlJSTypePropagator::generate_LoadElement(), QQmlJSCodeGenerator::generate_SetLookup(), merge(), and typeForBinaryOperation().

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

◆ merge() [2/2]

QQmlJSScope::ConstPtr QQmlJSTypeResolver::merge ( const QQmlJSScope::ConstPtr a,
const QQmlJSScope::ConstPtr b 
) const

Definition at line 660 of file qqmljstyperesolver.cpp.

References QQmlJSScope::baseType(), boolType(), equals(), int32Type(), isIntegral(), isNumeric(), isPrimitive(), isUnsignedInteger(), jsPrimitiveType(), jsValueType(), nullType(), realType(), stringType(), uint32Type(), and varType().

+ Here is the call graph for this function:

◆ metaObjectType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::metaObjectType ( ) const
inline

Definition at line 69 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypeResolver(), QQmlJSCodeGenerator::generate_As(), QQmlJSTypePropagator::generate_As(), memberType(), and registerContentForName().

+ Here is the caller graph for this function:

◆ nullType()

◆ objectsById()

const QQmlJSScopesById & QQmlJSTypeResolver::objectsById ( ) const
inline

Definition at line 158 of file qqmljstyperesolver_p.h.

◆ original()

QQmlJSRegisterContent QQmlJSTypeResolver::original ( const QQmlJSRegisterContent type) const

Definition at line 472 of file qqmljstyperesolver.cpp.

References originalType(), and transformed().

Referenced by QQmlJSCodeGenerator::AccumulatorConverter::AccumulatorConverter(), QQmlJSCodeGenerator::generate_As(), QQmlJSCodeGenerator::generate_Exp(), QQmlJSCodeGenerator::generate_LoadQmlContextPropertyLookup(), QQmlJSCodeGenerator::generate_SetLookup(), and QQmlJSCodeGenerator::run().

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

◆ originalContainedType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::originalContainedType ( const QQmlJSRegisterContent container) const

Definition at line 489 of file qqmljstyperesolver.cpp.

References containedType(), and originalType().

Referenced by QQmlJSCodeGenerator::AccumulatorConverter::AccumulatorConverter(), and QQmlJSCodeGenerator::generate_CallPropertyLookup().

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

◆ originalType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::originalType ( const QQmlJSScope::ConstPtr type) const

Definition at line 1541 of file qqmljstyperesolver.cpp.

References it, and m_trackedTypes.

Referenced by QQmlJSCodeGenerator::AccumulatorConverter::AccumulatorConverter(), original(), originalContainedType(), and QQmlJSCodeGenerator::run().

+ Here is the caller graph for this function:

◆ parentMode()

ParentMode QQmlJSTypeResolver::parentMode ( ) const
inline

Definition at line 148 of file qqmljstyperesolver_p.h.

◆ qObjectListType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::qObjectListType ( ) const
inline

Definition at line 73 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSFunctionInitializer::run().

+ Here is the caller graph for this function:

◆ qObjectType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::qObjectType ( ) const
inline

Definition at line 72 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSCodeGenerator::generate_ConvertThisToObject(), and QQmlJSTypePropagator::generate_ConvertThisToObject().

+ Here is the caller graph for this function:

◆ realType()

◆ registerContains()

◆ registerContentForName()

QQmlJSRegisterContent QQmlJSTypeResolver::registerContentForName ( const QString name,
const QQmlJSScope::ConstPtr scopeType = QQmlJSScope::ConstPtr(),
bool  hasObjectModuelPrefix = false 
) const
protected

Definition at line 410 of file qqmljstyperesolver.cpp.

References canAddressValueTypes(), QQmlJSRegisterContent::create(), genericType(), QQmlJSLogger::log(), m_logger, metaObjectType(), QQmlJSRegisterContent::MetaType, QQmlJSRegisterContent::ObjectAttached, qmlCompiler, QQmlJSRegisterContent::ScopeAttached, QQmlJSRegisterContent::Script, QQmlJSRegisterContent::Singleton, storedType(), and typeForName().

Referenced by memberType().

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

◆ registerIsStoredIn()

bool QQmlJSTypeResolver::registerIsStoredIn ( const QQmlJSRegisterContent reg,
const QQmlJSScope::ConstPtr type 
) const

◆ returnType()

QQmlJSRegisterContent QQmlJSTypeResolver::returnType ( const QQmlJSScope::ConstPtr type,
QQmlJSRegisterContent::ContentVariant  variant,
const QQmlJSScope::ConstPtr scope 
) const

Definition at line 1490 of file qqmljstyperesolver.cpp.

References QQmlJSRegisterContent::create(), QQmlJSRegisterContent::JavaScriptReturnValue, QQmlJSRegisterContent::MethodReturnValue, Q_ASSERT, storedType(), and variant.

+ Here is the call graph for this function:

◆ scopedType()

QQmlJSRegisterContent QQmlJSTypeResolver::scopedType ( const QQmlJSScope::ConstPtr scope,
const QString name 
) const

Definition at line 905 of file qqmljstyperesolver.cpp.

References base, child, QQmlJSRegisterContent::create(), equals(), QQmlJSScope::ExtensionNamespace, QQmlJSScope::findCurrentQMLScope(), QQmlJSScope::hasOwnMethod(), QQmlJSScope::hasOwnProperty(), if(), QString::isEmpty(), jsValueType(), methods, QQmlSA::Object, QQmlJSRegisterContent::ObjectById, parent, scopeContentVariant(), scopeForId(), QQmlJSUtils::searchBaseAndExtensionTypes(), and storedType().

Referenced by QQmlJSTypePropagator::generate_LoadName(), QQmlJSTypePropagator::generate_LoadQmlContextPropertyLookup(), QQmlJSTypePropagator::generate_StoreNameCommon(), and QQmlJSCodeGenerator::generate_StoreNameSloppy().

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

◆ scopeForId()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::scopeForId ( const QString id,
const QQmlJSScope::ConstPtr referrer 
) const

Definition at line 140 of file qqmljstyperesolver.cpp.

References m_objectsById, and QQmlJSScopesById::scope().

Referenced by QQmlJSUtils::resolveAlias(), and scopedType().

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

◆ scopeForLocation()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::scopeForLocation ( const QV4::CompiledData::Location location) const

Definition at line 132 of file qqmljstyperesolver.cpp.

References m_objectsByLocation, and qCDebug.

◆ selectConstructor()

QQmlJSMetaMethod QQmlJSTypeResolver::selectConstructor ( const QQmlJSScope::ConstPtr type,
const QQmlJSScope::ConstPtr argument,
bool *  isExtension 
) const

Definition at line 1051 of file qqmljstyperesolver.cpp.

References canHold(), canPrimitivelyConvertFromTo(), equals(), extension(), QQmlJSMetaMethod::Invalid, QQmlJSMetaMethod::isValid(), method, and Q_ASSERT.

Referenced by adjustTrackedType(), adjustTrackedType(), canConvertFromTo(), QQmlJSCodeGenerator::convertContained(), and QQmlJSCodeGenerator::convertStored().

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

◆ setCloneMode()

void QQmlJSTypeResolver::setCloneMode ( CloneMode  mode)
inline

Definition at line 150 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSLinter::lintFile().

+ Here is the caller graph for this function:

◆ setParentMode()

void QQmlJSTypeResolver::setParentMode ( ParentMode  mode)
inline

Definition at line 147 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSLinter::lintFile().

+ Here is the caller graph for this function:

◆ signalHandlers()

const QHash< QQmlJS::SourceLocation, QQmlJSMetaSignalHandler > & QQmlJSTypeResolver::signalHandlers ( ) const
inline

Definition at line 162 of file qqmljstyperesolver_p.h.

◆ storedType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::storedType ( const QQmlJSScope::ConstPtr type) const

Definition at line 1521 of file qqmljstyperesolver.cpp.

References equals(), genericType(), jsValueType(), QQmlJSScope::nonCompositeBaseType(), and voidType().

Referenced by builtinType(), checkEnums(), globalType(), memberType(), memberType(), registerContentForName(), returnType(), scopedType(), and valueType().

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

◆ stringListType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::stringListType ( ) const
inline

Definition at line 57 of file qqmljstyperesolver_p.h.

Referenced by canConvertForLiteralBinding().

+ Here is the caller graph for this function:

◆ stringType()

◆ timeType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::timeType ( ) const
inline

Definition at line 62 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSCodeGenerator::convertStored().

+ Here is the caller graph for this function:

◆ tracked()

QQmlJSRegisterContent QQmlJSTypeResolver::tracked ( const QQmlJSRegisterContent type) const

Definition at line 477 of file qqmljstyperesolver.cpp.

References trackedType(), and transformed().

Referenced by adjustOriginalType(), adjustTrackedType(), adjustTrackedType(), QQmlJSTypePropagator::generate_DefineArray(), QQmlJSTypePropagator::generate_DefineObjectLiteral(), and QQmlJSFunctionInitializer::run().

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

◆ trackedContainedType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::trackedContainedType ( const QQmlJSRegisterContent container) const

Definition at line 482 of file qqmljstyperesolver.cpp.

References containedType(), and m_trackedTypes.

+ Here is the call graph for this function:

◆ trackedType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::trackedType ( const QQmlJSScope::ConstPtr type) const

Definition at line 348 of file qqmljstyperesolver.cpp.

References QQmlJSScope::clone(), DoNotCloneTypes, it, m_cloneMode, and m_trackedTypes.

Referenced by tracked().

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

◆ transformed()

◆ typeForArithmeticUnaryOperation()

QQmlJSRegisterContent QQmlJSTypeResolver::typeForArithmeticUnaryOperation ( UnaryOperator  op,
const QQmlJSRegisterContent operand 
) const

Definition at line 246 of file qqmljstyperesolver.cpp.

References boolType(), builtinType(), Complement, containedType(), equals(), int32Type(), isIntegral(), Not, Plus, Q_FALLTHROUGH, and realType().

+ Here is the call graph for this function:

◆ typeForBinaryOperation()

QQmlJSRegisterContent QQmlJSTypeResolver::typeForBinaryOperation ( QSOperator::Op  oper,
const QQmlJSRegisterContent left,
const QQmlJSRegisterContent right 
) const

Definition at line 189 of file qqmljstyperesolver.cpp.

References QSOperator::Add, QSOperator::As, QSOperator::BitAnd, QSOperator::BitOr, QSOperator::BitXor, boolType(), builtinType(), containedType(), QSOperator::Div, QSOperator::Equal, equals(), QSOperator::Exp, QSOperator::Ge, globalType(), QSOperator::Gt, QSOperator::In, int32Type(), isNumeric(), jsPrimitiveType(), QSOperator::Le, QSOperator::LShift, QSOperator::Lt, merge(), QSOperator::Mod, QSOperator::Mul, QSOperator::NotEqual, Q_ASSERT, realType(), QSOperator::RShift, QSOperator::StrictEqual, QSOperator::StrictNotEqual, stringType(), QSOperator::Sub, uint32Type(), and QSOperator::URShift.

Referenced by QQmlJSTypePropagator::generate_CmpEqInt(), and QQmlJSTypePropagator::generate_CmpNeInt().

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

◆ typeForConst()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::typeForConst ( QV4::ReturnedValue  rv) const

Definition at line 164 of file qqmljstyperesolver.cpp.

References boolType(), emptyType(), QV4::Value::fromReturnedValue(), int32Type(), nullType(), realType(), and voidType().

Referenced by QQmlJSCodeGenerator::generate_LoadConst(), QQmlJSTypePropagator::generate_LoadConst(), and QQmlJSTypePropagator::generate_MoveConst().

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

◆ typeForName()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::typeForName ( const QString name) const
inline

Definition at line 87 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSMetaPropertyBinding::literalType(), memberType(), registerContentForName(), and typeFromAST().

+ Here is the caller graph for this function:

◆ typeFromAST()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::typeFromAST ( QQmlJS::AST::Type type) const

Definition at line 152 of file qqmljstyperesolver.cpp.

References QmlIR::IRBuilder::asString(), m_imports, QQmlJSScope::ContextualTypes::type(), and typeForName().

+ Here is the call graph for this function:

◆ uint16Type()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::uint16Type ( ) const
inline

Definition at line 50 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSCodeGenerator::convertStored().

+ Here is the caller graph for this function:

◆ uint32Type()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::uint32Type ( ) const
inline

Definition at line 52 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypePropagator::generate_LoadElement(), QQmlJSTypePropagator::generate_StoreElement(), merge(), and typeForBinaryOperation().

+ Here is the caller graph for this function:

◆ uint64Type()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::uint64Type ( ) const
inline

Definition at line 54 of file qqmljstyperesolver_p.h.

◆ uint8Type()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::uint8Type ( ) const
inline

Definition at line 48 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSCodeGenerator::convertStored().

+ Here is the caller graph for this function:

◆ urlType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::urlType ( ) const
inline

Definition at line 59 of file qqmljstyperesolver_p.h.

Referenced by canCompareWithQUrl(), canConvertForLiteralBinding(), and QQmlJSCodeGenerator::convertStored().

+ Here is the caller graph for this function:

◆ valueType()

QQmlJSRegisterContent QQmlJSTypeResolver::valueType ( const QQmlJSRegisterContent list) const

Definition at line 1452 of file qqmljstyperesolver.cpp.

References QQmlJSScope::accessSemantics(), QQmlJSRegisterContent::create(), equals(), list, QQmlJSRegisterContent::ListValue, m_jsValueType, m_stringType, m_varType, property, storedType(), QQmlJSScope::valueType(), and valueType().

Referenced by QQmlJSCodeGenerator::generate_LoadElement(), QQmlJSTypePropagator::generate_LoadElement(), QQmlJSCodeGenerator::generate_StoreElement(), QQmlJSTypePropagator::generate_StoreElement(), and valueType().

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

◆ variantListType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::variantListType ( ) const
inline

Definition at line 63 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypePropagator::generate_DefineArray().

+ Here is the caller graph for this function:

◆ variantMapType()

QQmlJSScope::ConstPtr QQmlJSTypeResolver::variantMapType ( ) const
inline

Definition at line 64 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSCodeGenerator::generate_DefineObjectLiteral(), QQmlJSTypePropagator::generate_DefineObjectLiteral(), QQmlJSCodeGenerator::generate_GetLookup(), and memberType().

+ Here is the caller graph for this function:

◆ varType()

◆ voidType()

Member Data Documentation

◆ m_arrayPrototype

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_arrayPrototype
protected

Definition at line 221 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypeResolver().

◆ m_boolType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_boolType
protected

◆ m_byteArrayType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_byteArrayType
protected

◆ m_cloneMode

CloneMode QQmlJSTypeResolver::m_cloneMode = CloneTypes
protected

◆ m_dateTimeType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_dateTimeType
protected

◆ m_dateType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_dateType
protected

◆ m_emptyType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_emptyType
protected

Definition at line 218 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypeResolver().

◆ m_floatType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_floatType
protected

Definition at line 223 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypeResolver(), genericType(), and isTriviallyCopyable().

◆ m_functionType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_functionType
protected

Definition at line 249 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypeResolver().

◆ m_imports

QQmlJSImporter::ImportedTypes QQmlJSTypeResolver::m_imports
protected

Definition at line 254 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypeResolver(), init(), and typeFromAST().

◆ m_int16Type

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_int16Type
protected

◆ m_int32Type

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_int32Type
protected

◆ m_int64Type

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_int64Type
protected

Definition at line 230 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypeResolver(), genericType(), and isTriviallyCopyable().

◆ m_int8Type

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_int8Type
protected

◆ m_jsGlobalObject

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_jsGlobalObject
protected

Definition at line 250 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypeResolver().

◆ m_jsPrimitiveType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_jsPrimitiveType
protected

◆ m_jsValueType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_jsValueType
protected

◆ m_listPropertyType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_listPropertyType
protected

Definition at line 245 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypeResolver(), canHold(), and genericType().

◆ m_logger

QQmlJSLogger* QQmlJSTypeResolver::m_logger = nullptr
protected

◆ m_metaObjectType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_metaObjectType
protected

Definition at line 248 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypeResolver(), genericType(), and isTriviallyCopyable().

◆ m_nullType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_nullType
protected

◆ m_numberPrototype

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_numberPrototype
protected

Definition at line 220 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypeResolver(), and isNumeric().

◆ m_objectsById

QQmlJSScopesById QQmlJSTypeResolver::m_objectsById
protected

Definition at line 252 of file qqmljstyperesolver_p.h.

Referenced by idForScope(), init(), and scopeForId().

◆ m_objectsByLocation

QHash<QV4::CompiledData::Location, QQmlJSScope::ConstPtr> QQmlJSTypeResolver::m_objectsByLocation
protected

Definition at line 253 of file qqmljstyperesolver_p.h.

Referenced by init(), and scopeForLocation().

◆ m_parentMode

ParentMode QQmlJSTypeResolver::m_parentMode = UseParentProperty
protected

Definition at line 257 of file qqmljstyperesolver_p.h.

◆ m_qObjectListType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_qObjectListType
protected

Definition at line 247 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypeResolver(), canHold(), and genericType().

◆ m_qObjectType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_qObjectType
protected

Definition at line 246 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypeResolver(), and genericType().

◆ m_realType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_realType
protected

Definition at line 222 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypeResolver(), genericType(), and isTriviallyCopyable().

◆ m_signalHandlers

QHash<QQmlJS::SourceLocation, QQmlJSMetaSignalHandler> QQmlJSTypeResolver::m_signalHandlers
protected

Definition at line 255 of file qqmljstyperesolver_p.h.

Referenced by init().

◆ m_stringListType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_stringListType
protected

Definition at line 234 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypeResolver(), areEquivalentLists(), and genericType().

◆ m_stringType

◆ m_timeType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_timeType
protected

◆ m_trackedTypes

◆ m_uint16Type

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_uint16Type
protected

◆ m_uint32Type

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_uint32Type
protected

◆ m_uint64Type

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_uint64Type
protected

Definition at line 231 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypeResolver(), genericType(), and isTriviallyCopyable().

◆ m_uint8Type

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_uint8Type
protected

◆ m_urlType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_urlType
protected

◆ m_variantListType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_variantListType
protected

◆ m_variantMapType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_variantMapType
protected

Definition at line 241 of file qqmljstyperesolver_p.h.

Referenced by QQmlJSTypeResolver(), and genericType().

◆ m_varType

◆ m_voidType

QQmlJSScope::ConstPtr QQmlJSTypeResolver::m_voidType
protected

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