Home
last modified time | relevance | path

Searched +full:checker +full:- (Results 1 – 25 of 1060) sorted by relevance

12345678910>>...43

/arkcompiler/ets_frontend/ets2panda/checker/
DTSAnalyzer.cpp2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
18 #include "checker/TSchecker.h"
19 #include "checker/ts/destructuringContext.h"
21 namespace ark::es2panda::checker { namespace
29 checker::Type *TSAnalyzer::Check(ir::CatchClause *st) const in Check()
31 TSChecker *checker = GetTSChecker(); in Check() local
32 ir::Expression *typeAnnotation = st->Param()->AsAnnotatedExpression()->TypeAnnotation(); in Check()
35 checker::Type *catchParamType = typeAnnotation->Check(checker); in Check()
37 if (!catchParamType->HasTypeFlag(checker::TypeFlag::ANY_OR_UNKNOWN)) { in Check()
[all …]
DETSAnalyzerHelpers.cpp2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
17 #include "checker/types/ets/etsAsyncFuncReturnType.h"
19 namespace ark::es2panda::checker { namespace
20 void CheckExtensionIsShadowedInCurrentClassOrInterface(checker::ETSChecker *checker, checker::ETSOb… in CheckExtensionIsShadowedInCurrentClassOrInterface() argument
21 … ir::ScriptFunction *extensionFunc, checker::Signature *signature) in CheckExtensionIsShadowedInCurrentClassOrInterface()
23 const auto methodName = extensionFunc->Id()->Name(); in CheckExtensionIsShadowedInCurrentClassOrInterface()
25 …auto *const variable = objType->GetOwnProperty<checker::PropertyType::INSTANCE_METHOD>(methodName); in CheckExtensionIsShadowedInCurrentClassOrInterface()
30 const auto *const funcType = variable->TsType()->AsETSFunctionType(); in CheckExtensionIsShadowedInCurrentClassOrInterface()
31 for (auto *funcSignature : funcType->CallSignatures()) { in CheckExtensionIsShadowedInCurrentClassOrInterface()
[all …]
DETSAnalyzer.cpp2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
19 #include "checker/ETSchecker.h"
20 #include "checker/ets/castingContext.h"
21 #include "checker/ets/typeRelationContext.h"
22 #include "checker/types/globalTypesHolder.h"
23 #include "checker/types/ets/etsTupleType.h"
24 #include "checker/types/ets/etsAsyncFuncReturnType.h"
28 namespace ark::es2panda::checker { namespace
36 checker::Type *ETSAnalyzer::Check(ir::CatchClause *st) const in Check()
[all …]
DETSAnalyzerHelpers.h2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
19 #include "checker/types/type.h"
21 #include "checker/ETSchecker.h"
22 #include "checker/ets/castingContext.h"
23 #include "checker/ets/typeRelationContext.h"
28 namespace ark::es2panda::checker {
29 void CheckExtensionIsShadowedInCurrentClassOrInterface(checker::ETSChecker *checker, checker::ETSOb…
31 checker::Signature *signature);
32 void CheckExtensionIsShadowedByMethod(checker::ETSChecker *checker, checker::ETSObjectType *objType,
[all …]
DTSAnalyzer.h2 * Copyright (c) 2021 - 2024 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
18 #include "checker/SemanticAnalyzer.h"
19 #include "checker/TSchecker.h"
22 namespace ark::es2panda::checker {
26 explicit TSAnalyzer(Checker *checker) : SemanticAnalyzer(checker) {}; in TSAnalyzer() argument
27 /* CC-OFFNXT(G.PRE.02,G.PRE.09) name part*/
28 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
29 #define DECLARE_TSANALYZER_CHECK_METHOD(_, nodeType) checker::Type *Check(ir::nodeType *node) const…
33 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
[all …]
DETSAnalyzer.h2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
19 #include "checker/SemanticAnalyzer.h"
20 #include "checker/ETSchecker.h"
23 namespace ark::es2panda::checker {
27 explicit ETSAnalyzer(Checker *checker) : SemanticAnalyzer(checker) {}; in ETSAnalyzer() argument
28 // CC-OFFNXT(G.PRE.02,G.PRE.09) name part
29 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
30 #define DECLARE_ETSANALYZER_CHECK_METHOD(_, nodeType) checker::Type *Check(ir::nodeType *node) cons…
34 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
[all …]
/arkcompiler/runtime_core/tests/checked/
Dchecker_tests.rb1 # Copyright (c) 2021-2022 Huawei Device Co., Ltd.
6 # http://www.apache.org/licenses/LICENSE-2.0
15 require_relative 'checker'
28 asm ---
46 # Checker will clear working directory, so create it before we create disasm.txt file
47 checker = $CheckerForTest.new(OpenStruct.new({arch: 'x64'}), "")
50 checker.ASM_METHOD(/main/)
51 checker.ASM(x64: '---')
52 checker.ASM(x64: '000')
53 checker.ASM(x64: '333')
[all …]
/arkcompiler/runtime_core/static_core/tests/checked/
Dchecker_tests.rb1 # Copyright (c) 2021-2024 Huawei Device Co., Ltd.
6 # http://www.apache.org/licenses/LICENSE-2.0
15 require_relative 'checker'
28 asm ---
46 # Checker will clear working directory, so create it before we create disasm.txt file
47 checker = $CheckerForTest.new(OpenStruct.new({arch: 'x64'}), "")
50 checker.ASM_METHOD(/main/)
51 checker.ASM(x64: '---')
52 checker.ASM(x64: '000')
53 checker.ASM(x64: '333')
[all …]
/arkcompiler/ets_frontend/ets2panda/ir/ts/
DtsTupleType.cpp2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
22 #include "checker/TSchecker.h"
23 #include "checker/types/ts/indexInfo.h"
34 it->SetTransformedNode(transformationName, transformedNode); in TransformChildren()
49 dumper->Add({{"type", "TSTupleType"}, {"elementTypes", elementTypes_}}); in Dump()
54 dumper->Add("TSTupleType"); in Dump()
59 pg->GetAstCompiler()->Compile(this); in Compile()
64 etsg->GetAstCompiler()->Compile(this); in Compile()
67 checker::Type *GetNumberIndexType(ArenaVector<checker::Type *> numberIndexTypes, checker::TSChecker… in GetNumberIndexType() argument
[all …]
/arkcompiler/ets_frontend/ets2panda/test/unit/
Dunion_normalization_test_1.cpp2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
19 #include "checker/ETSAnalyzer.h"
20 #include "checker/ETSchecker.h"
35 #include "checker/types/globalTypesHolder.h"
46 auto checker = Checker(); in TEST_F() local
47 ASSERT(checker); in TEST_F()
49 ArenaVector<checker::Type *> unionConstituents(checker->Allocator()->Adapter()); in TEST_F()
50 unionConstituents.emplace_back(checker->GlobalIntType()); in TEST_F()
51 unionConstituents.emplace_back(checker->GetGlobalTypesHolder()->GlobalETSObjectType()); in TEST_F()
[all …]
Dunion_normalization_test_2.cpp2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
19 #include "checker/ETSAnalyzer.h"
20 #include "checker/ETSchecker.h"
35 #include "checker/types/globalTypesHolder.h"
56 auto *const baseType = FindClassType(program->VarBinder()->AsETSBinder(), "Base"); in TEST_F()
58 auto *const derived1Type = FindClassType(program->VarBinder()->AsETSBinder(), "Derived1"); in TEST_F()
60 auto *const derived2Type = FindClassType(program->VarBinder()->AsETSBinder(), "Derived2"); in TEST_F()
63 auto checker = Checker(); in TEST_F() local
64 ASSERT(checker); in TEST_F()
[all …]
/arkcompiler/ets_frontend/es2panda/ir/ts/
DtsTupleType.cpp7 * http://www.apache.org/licenses/LICENSE-2.0
18 #include <typescript/checker.h>
34 dumper->Add({{"type", "TSTupleType"}, {"elementTypes", elementTypes_}}); in Dump()
39 checker::Type *TSTupleType::GetType(checker::Checker *checker) const in GetType()
41 auto found = checker->NodeCache().find(this); in GetType()
42 if (found != checker->NodeCache().end()) { in GetType()
43 return found->second; in GetType()
46checker::ObjectDescriptor *desc = checker->Allocator()->New<checker::ObjectDescriptor>(checker->Al… in GetType()
48 checker::NamedTupleMemberPool namedMembers; in GetType()
49 ArenaVector<checker::ElementFlags> elementFlags(checker->Allocator()->Adapter()); in GetType()
[all …]
DtsIndexedAccessType.cpp7 * http://www.apache.org/licenses/LICENSE-2.0
18 #include <typescript/checker.h>
31 …dumper->Add({{"type", "TSIndexedAccessType"}, {"objectType", objectType_}, {"indexType", indexType… in Dump()
36 checker::Type *TSIndexedAccessType::Check(checker::Checker *checker) const in Check()
38 objectType_->Check(checker); in Check()
39 indexType_->Check(checker); in Check()
40 checker::Type *resolved = GetType(checker); in Check()
46 checker::Type *indexType = checker->CheckTypeCached(indexType_); in Check()
48 if (!indexType->HasTypeFlag(checker::TypeFlag::STRING_LIKE | checker::TypeFlag::NUMBER_LIKE)) { in Check()
49checker->ThrowTypeError({"Type ", indexType, " cannot be used as index type"}, indexType_->Start()… in Check()
[all …]
DtsTypeLiteral.cpp7 * http://www.apache.org/licenses/LICENSE-2.0
19 #include <typescript/checker.h>
32 dumper->Add({{"type", "TSTypeLiteral"}, {"members", members_}}); in Dump()
37 checker::Type *TSTypeLiteral::Check(checker::Checker *checker) const in Check()
40 it->Check(checker); in Check()
43 checker::Type *type = GetType(checker); in Check()
44 checker->CheckIndexConstraints(type); in Check()
49 checker::Type *TSTypeLiteral::GetType(checker::Checker *checker) const in GetType()
51 auto found = checker->NodeCache().find(this); in GetType()
52 if (found != checker->NodeCache().end()) { in GetType()
[all …]
/arkcompiler/ets_frontend/es2panda/ir/expressions/
DarrayExpression.cpp7 * http://www.apache.org/licenses/LICENSE-2.0
33 switch (it->Type()) { in ConvertibleToArrayPattern()
35 convResult = it->AsArrayExpression()->ConvertibleToArrayPattern(); in ConvertibleToArrayPattern()
40 convResult = it->AsSpreadElement()->ConvertibleToRest(isDeclaration_); in ConvertibleToArrayPattern()
48 convResult = it->AsObjectExpression()->ConvertibleToObjectPattern(); in ConvertibleToArrayPattern()
52 convResult = it->AsAssignmentExpression()->ConvertibleToAssignmentPattern(); in ConvertibleToArrayPattern()
80 switch (it->Type()) { in ValidateExpression()
82 info = it->AsObjectExpression()->ValidateExpression(); in ValidateExpression()
86 info = it->AsArrayExpression()->ValidateExpression(); in ValidateExpression()
90 auto *assignmentExpr = it->AsAssignmentExpression(); in ValidateExpression()
[all …]
/arkcompiler/ets_frontend/ets2panda/ir/expressions/
DmemberExpression.cpp2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
18 #include "checker/TSchecker.h"
19 #include "checker/ets/castingContext.h"
20 #include "checker/types/ets/etsTupleType.h"
31 …object_ = other.object_ != nullptr ? other.object_->Clone(allocator, this)->AsExpression() : nullp… in MemberExpression()
32 …property_ = other.property_ != nullptr ? other.property_->Clone(allocator, this)->AsExpression() :… in MemberExpression()
37 return property_->IsIdentifier() && property_->AsIdentifier()->IsPrivateIdent(); in IsPrivateReference()
43 object_->SetTransformedNode(transformationName, transformedNode); in TransformChildren()
44 object_ = transformedNode->AsExpression(); in TransformChildren()
[all …]
DmemberExpression.h2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
19 #include "checker/types/ets/etsObjectType.h"
27 namespace ark::es2panda::checker {
30 } // namespace ark::es2panda::checker
34 // NOLINTBEGIN(modernize-avoid-c-arrays)
36 // NOLINTEND(modernize-avoid-c-arrays)
57 friend class checker::ETSAnalyzer;
98 object_->SetParent(this);
116 … return Property()->Variable() != nullptr ? Property()->Variable()->AsLocalVariable() : nullptr;
[all …]
DarrayExpression.cpp2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
18 #include "checker/ETSchecker.h"
19 #include "checker/TSchecker.h"
20 #include "checker/types/ets/etsTupleType.h"
21 #include "checker/ets/typeRelationContext.h"
22 #include "checker/ts/destructuringContext.h"
39 decorators_(allocator->Adapter()), in ArrayExpression()
40 elements_(allocator->Adapter()) in ArrayExpression()
48 elements_.emplace_back(element->Clone(allocator, this)->AsExpression()); in ArrayExpression()
[all …]
/arkcompiler/ets_frontend/ets2panda/ir/statements/
DforOfStatement.cpp2 * Copyright (c) 2021 - 2024 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
18 #include "checker/TSchecker.h"
26 checker::Type *ForOfStatement::CreateUnionIteratorTypes(checker::ETSChecker *checker, checker::Type… in CreateUnionIteratorTypes() argument
28 ArenaVector<checker::Type *> types(checker->Allocator()->Adapter()); in CreateUnionIteratorTypes()
30 for (auto it : exprType->AsETSUnionType()->ConstituentTypes()) { in CreateUnionIteratorTypes()
31 if (it->IsETSStringType()) { in CreateUnionIteratorTypes()
32 types.push_back(checker->GetGlobalTypesHolder()->GlobalCharType()); in CreateUnionIteratorTypes()
33 } else if (it->IsETSObjectType()) { in CreateUnionIteratorTypes()
34 types.push_back(this->CheckIteratorMethodForObject(checker, it->AsETSObjectType())); in CreateUnionIteratorTypes()
[all …]
DforOfStatement.h2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
19 #include <checker/types/signature.h>
26 namespace ark::es2panda::checker {
29 } // namespace ark::es2panda::checker
34 // NOLINTBEGIN(modernize-avoid-c-arrays)
38 // NOLINTEND(modernize-avoid-c-arrays)
41 friend class checker::ETSAnalyzer;
99 checker::Type *Check(checker::TSChecker *checker) override;
100 checker::Type *Check(checker::ETSChecker *checker) override;
[all …]
/arkcompiler/ets_frontend/ets2panda/checker/typeChecker/
DTypeChecker.h2 * Copyright (c) 2021 - 2024 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
21 namespace ark::es2panda::checker {
24 * This class should be launched after Checker pass.
25 …* Should contain all type checks, which are non-critical for `Checker` (`Checker` can keep working…
30 // NOTE(aleksisch): after merging #14938 add `const-AstVisitor` and make this pass const
33 node->Accept(this); in Check()
38 // NOTE(aleksisch): checker should be replaced with some `ErrorHandler`
39 explicit TypeChecker(Checker *checker) : checker_(checker) {} in TypeChecker() argument
43 checker_->LogTypeError(list, pos); in LogTypeError()
[all …]
/arkcompiler/ets_frontend/ets2panda/compiler/lowering/ets/
DinterfaceObjectLiteralLowering.cpp7 * http://www.apache.org/licenses/LICENSE-2.0
17 #include "checker/ETSchecker.h"
18 #include "checker/ets/typeRelationContext.h"
29 static inline bool IsInterfaceType(const checker::Type *type) in IsInterfaceType()
31 return type != nullptr && type->IsETSObjectType() && in IsInterfaceType()
32 type->AsETSObjectType()->HasObjectFlag(checker::ETSObjectFlags::INTERFACE) && in IsInterfaceType()
33 !type->AsETSObjectType()->HasObjectFlag(checker::ETSObjectFlags::DYNAMIC); in IsInterfaceType()
36 static ir::AstNode *CreateAnonClassImplCtor(checker::ETSChecker *checker) in CreateAnonClassImplCtor() argument
38 checker::ETSChecker::ClassInitializerBuilder initBuilder = in CreateAnonClassImplCtor()
39 [checker]([[maybe_unused]] ArenaVector<ir::Statement *> *statements, in CreateAnonClassImplCtor()
[all …]
DenumPostCheckLowering.cpp2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
17 #include "checker/types/ets/etsEnumType.h"
18 #include "checker/ETSchecker.h"
19 #include "checker/types/type.h"
28 for (ir::AstNode *curr = ast->Parent(); curr != nullptr; curr = curr->Parent()) { in FindEnclosingClass()
29 if (curr->IsClassDeclaration()) { in FindEnclosingClass()
30 return curr->AsClassDeclaration(); in FindEnclosingClass()
36 static ir::CallExpression *CallStaticEnumMethod(checker::ETSChecker *checker, checker::ETSEnumType … in CallStaticEnumMethod() argument
37checker::ETSEnumType::Method (checker::ETSEnumType::*getMethod)() const, in CallStaticEnumMethod()
[all …]
DunionLowering.cpp2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
19 #include "checker/ETSchecker.h"
20 #include "checker/ets/conversion.h"
21 #include "checker/ets/boxingConverter.h"
22 #include "checker/ets/unboxingConverter.h"
43 static ir::ClassDefinition *GetUnionFieldClass(checker::ETSChecker *checker, varbinder::VarBinder *… in GetUnionFieldClass() argument
46 …util::UString unionFieldClassName(util::StringView(panda_file::GetDummyClassName()), checker->Allo… in GetUnionFieldClass()
48 if ((foundVar = checker->Scope()->FindLocal(unionFieldClassName.View(), in GetUnionFieldClass()
50 return foundVar->Declaration()->Node()->AsClassDeclaration()->Definition(); in GetUnionFieldClass()
[all …]
/arkcompiler/ets_frontend/ets2panda/checker/ets/
DboxingConverter.cpp2 * Copyright (c) 2021 - 2024 Huawei Device Co., Ltd.
7 * http://www.apache.org/licenses/LICENSE-2.0
17 #include "checker/types/ets/types.h"
18 #include "checker/ETSchecker.h"
20 #include "checker/ets/primitiveWrappers.h"
21 #include "checker/types/globalTypesHolder.h"
23 namespace ark::es2panda::checker { namespace
25 checker::ETSObjectType *BoxingConverter::Convert(ETSChecker const *checker, Type const *source) in Convert() argument
27 auto typeHolder = checker->GetGlobalTypesHolder(); in Convert()
29 switch (checker::ETSChecker::TypeKind(source)) { in Convert()
[all …]

12345678910>>...43