/**
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// NOLINTNEXTLINE(misc-definitions-in-headers,readability-function-size)
inline void SetAbcKitFlags(Inst *inst)
{
    auto opcode = inst->GetOpcode();
    if (opcode == Opcode::Intrinsic) {
        inst->ClearFlag(inst_flags::REQUIRE_STATE);
        return;
    }
    switch(opcode) {
        case Opcode::Neg:
            return;
        case Opcode::Abs:
            return;
        case Opcode::Sqrt:
            return;
        case Opcode::Not:
            return;
        case Opcode::Add:
            return;
        case Opcode::Sub:
            return;
        case Opcode::Mul:
            return;
        case Opcode::MulOverflowCheck:
            return;
        case Opcode::Div:
            return;
        case Opcode::Mod:
            return;
        case Opcode::Min:
            return;
        case Opcode::Max:
            return;
        case Opcode::Shl:
            return;
        case Opcode::Shr:
            return;
        case Opcode::AShr:
            return;
        case Opcode::And:
            return;
        case Opcode::Or:
            return;
        case Opcode::Xor:
            return;
        case Opcode::ExtractBitfield:
            return;
        case Opcode::Compare:
            return;
        case Opcode::Cmp:
            return;
        case Opcode::CompareAnyType:
            return;
        case Opcode::GetAnyTypeName:
            return;
        case Opcode::CastAnyTypeValue:
            return;
        case Opcode::CastValueToAnyType:
            return;
        case Opcode::Cast:
            return;
        case Opcode::Bitcast:
            return;
        case Opcode::Constant:
            return;
        case Opcode::Parameter: {
            inst->SetFlagsMask(static_cast<inst_flags::Flags>(inst_flags::NO_CSE|inst_flags::NO_HOIST|inst_flags::NO_DCE));
            return;
        }
        case Opcode::NullPtr:
            return;
        case Opcode::LoadUniqueObject:
            return;
        case Opcode::NewArray:
            return;
        case Opcode::NewObject:
            return;
        case Opcode::InitObject: {
            inst->SetFlagsMask(static_cast<inst_flags::Flags>(inst_flags::CAN_THROW|inst_flags::NO_DCE|inst_flags::NO_HOIST|inst_flags::NO_CSE|inst_flags::ALLOC|inst_flags::RUNTIME_CALL|inst_flags::ACC_WRITE));
            return;
        }
        case Opcode::InitEmptyString:
            return;
        case Opcode::InitString:
            return;
        case Opcode::LoadArray:
            return;
        case Opcode::LoadCompressedStringChar:
            return;
        case Opcode::StoreArray:
            return;
        case Opcode::LoadObject:
            return;
        case Opcode::LoadObjectDynamic:
            return;
        case Opcode::Load:
            return;
        case Opcode::LoadNative:
            return;
        case Opcode::LoadI:
            return;
        case Opcode::Store:
            return;
        case Opcode::StoreNative:
            return;
        case Opcode::StoreI:
            return;
        case Opcode::ResolveObjectField:
            return;
        case Opcode::LoadResolvedObjectField:
            return;
        case Opcode::StoreObject:
            return;
        case Opcode::StoreObjectDynamic:
            return;
        case Opcode::StoreResolvedObjectField:
            return;
        case Opcode::LoadStatic:
            return;
        case Opcode::ResolveObjectFieldStatic:
            return;
        case Opcode::LoadResolvedObjectFieldStatic:
            return;
        case Opcode::StoreStatic:
            return;
        case Opcode::UnresolvedStoreStatic:
            return;
        case Opcode::StoreResolvedObjectFieldStatic:
            return;
        case Opcode::LenArray:
            return;
        case Opcode::LoadString:
            return;
        case Opcode::LoadFromConstantPool:
            return;
        case Opcode::LoadConstArray:
            return;
        case Opcode::LoadConstantPool:
            return;
        case Opcode::LoadLexicalEnv:
            return;
        case Opcode::FillConstArray:
            return;
        case Opcode::LoadType:
            return;
        case Opcode::UnresolvedLoadType:
            return;
        case Opcode::CheckCast:
            return;
        case Opcode::IsInstance:
            return;
        case Opcode::InitClass:
            return;
        case Opcode::LoadClass:
            return;
        case Opcode::LoadAndInitClass:
            return;
        case Opcode::UnresolvedLoadAndInitClass:
            return;
        case Opcode::LoadRuntimeClass:
            return;
        case Opcode::GetInstanceClass:
            return;
        case Opcode::LoadImmediate:
            return;
        case Opcode::FunctionImmediate:
            return;
        case Opcode::LoadObjFromConst:
            return;
        case Opcode::GetGlobalVarAddress:
            return;
        case Opcode::NullCheck:
            return;
        case Opcode::BoundsCheck:
            return;
        case Opcode::RefTypeCheck:
            return;
        case Opcode::ZeroCheck:
            return;
        case Opcode::NegativeCheck:
            return;
        case Opcode::NotPositiveCheck:
            return;
        case Opcode::ObjByIndexCheck:
            return;
        case Opcode::AnyTypeCheck:
            return;
        case Opcode::HclassCheck:
            return;
        case Opcode::StringFlatCheck:
            return;
        case Opcode::Deoptimize:
            return;
        case Opcode::DeoptimizeIf:
            return;
        case Opcode::DeoptimizeCompare:
            return;
        case Opcode::DeoptimizeCompareImm:
            return;
        case Opcode::IsMustDeoptimize:
            return;
        case Opcode::ReturnVoid:
            return;
        case Opcode::Return:
            return;
        case Opcode::ReturnInlined:
            return;
        case Opcode::Throw:
            return;
        case Opcode::CallStatic: {
            inst->SetFlagsMask(static_cast<inst_flags::Flags>(inst_flags::CAN_THROW|inst_flags::NO_DCE|inst_flags::NO_HOIST|inst_flags::NO_CSE|inst_flags::BARRIER|inst_flags::RUNTIME_CALL|inst_flags::CALL|inst_flags::ACC_WRITE|inst_flags::ACC_READ));
            return;
        }
        case Opcode::ResolveStatic: {
            inst->SetFlagsMask(static_cast<inst_flags::Flags>(inst_flags::CAN_THROW|inst_flags::BARRIER|inst_flags::RUNTIME_CALL));
            return;
        }
        case Opcode::CallResolvedStatic: {
            inst->SetFlagsMask(static_cast<inst_flags::Flags>(inst_flags::CAN_THROW|inst_flags::NO_DCE|inst_flags::NO_HOIST|inst_flags::NO_CSE|inst_flags::BARRIER|inst_flags::CALL|inst_flags::ACC_WRITE|inst_flags::ACC_READ));
            return;
        }
        case Opcode::CallVirtual: {
            inst->SetFlagsMask(static_cast<inst_flags::Flags>(inst_flags::CAN_THROW|inst_flags::NO_DCE|inst_flags::NO_HOIST|inst_flags::NO_CSE|inst_flags::BARRIER|inst_flags::RUNTIME_CALL|inst_flags::CALL|inst_flags::ACC_WRITE|inst_flags::ACC_READ));
            return;
        }
        case Opcode::ResolveVirtual: {
            inst->SetFlagsMask(static_cast<inst_flags::Flags>(inst_flags::CAN_THROW|inst_flags::BARRIER|inst_flags::RUNTIME_CALL));
            return;
        }
        case Opcode::CallResolvedVirtual: {
            inst->SetFlagsMask(static_cast<inst_flags::Flags>(inst_flags::CAN_THROW|inst_flags::NO_DCE|inst_flags::NO_HOIST|inst_flags::NO_CSE|inst_flags::BARRIER|inst_flags::CALL|inst_flags::ACC_WRITE|inst_flags::ACC_READ));
            return;
        }
        case Opcode::CallDynamic: {
            inst->SetFlagsMask(static_cast<inst_flags::Flags>(inst_flags::CAN_THROW|inst_flags::NO_DCE|inst_flags::NO_HOIST|inst_flags::NO_CSE|inst_flags::BARRIER|inst_flags::RUNTIME_CALL|inst_flags::CALL));
            return;
        }
        case Opcode::CallIndirect:
            return;
        case Opcode::Call:
            return;
        case Opcode::MultiArray: {
            inst->SetFlagsMask(static_cast<inst_flags::Flags>(inst_flags::CAN_THROW|inst_flags::NO_DCE|inst_flags::NO_HOIST|inst_flags::NO_CSE|inst_flags::ALLOC|inst_flags::BARRIER|inst_flags::RUNTIME_CALL|inst_flags::MEM_BARRIER));
            return;
        }
        case Opcode::Monitor:
            return;
        case Opcode::Intrinsic: {
            inst->SetFlagsMask(static_cast<inst_flags::Flags>(inst_flags::CAN_THROW|inst_flags::HEAP_INV|inst_flags::NO_DCE|inst_flags::NO_HOIST|inst_flags::NO_CSE|inst_flags::BARRIER|inst_flags::RUNTIME_CALL|inst_flags::CALL|inst_flags::ACC_WRITE|inst_flags::ACC_READ));
            return;
        }
        case Opcode::CallNative:
            return;
        case Opcode::WrapObjectNative:
            return;
        case Opcode::Builtin:
            return;
        case Opcode::ResolveByName: {
            inst->SetFlagsMask(static_cast<inst_flags::Flags>(inst_flags::CAN_THROW|inst_flags::BARRIER|inst_flags::RUNTIME_CALL));
            return;
        }
        case Opcode::AddI:
            return;
        case Opcode::SubI:
            return;
        case Opcode::MulI:
            return;
        case Opcode::DivI:
            return;
        case Opcode::ModI:
            return;
        case Opcode::ShlI:
            return;
        case Opcode::ShrI:
            return;
        case Opcode::AShrI:
            return;
        case Opcode::AndI:
            return;
        case Opcode::OrI:
            return;
        case Opcode::XorI:
            return;
        case Opcode::MAdd:
            return;
        case Opcode::MSub:
            return;
        case Opcode::MNeg:
            return;
        case Opcode::OrNot:
            return;
        case Opcode::AndNot:
            return;
        case Opcode::XorNot:
            return;
        case Opcode::AndSR:
            return;
        case Opcode::OrSR:
            return;
        case Opcode::XorSR:
            return;
        case Opcode::AndNotSR:
            return;
        case Opcode::OrNotSR:
            return;
        case Opcode::XorNotSR:
            return;
        case Opcode::AddSR:
            return;
        case Opcode::SubSR:
            return;
        case Opcode::NegSR:
            return;
        case Opcode::BoundsCheckI:
            return;
        case Opcode::LoadArrayI:
            return;
        case Opcode::LoadCompressedStringCharI:
            return;
        case Opcode::StoreArrayI:
            return;
        case Opcode::LoadArrayPair:
            return;
        case Opcode::LoadArrayPairI:
            return;
        case Opcode::LoadPairPart:
            return;
        case Opcode::LoadObjectPair:
            return;
        case Opcode::StoreArrayPair:
            return;
        case Opcode::StoreArrayPairI:
            return;
        case Opcode::StoreObjectPair:
            return;
        case Opcode::ReturnI:
            return;
        case Opcode::Phi:
            return;
        case Opcode::SpillFill:
            return;
        case Opcode::SaveState:
            return;
        case Opcode::SafePoint:
            return;
        case Opcode::SaveStateDeoptimize:
            return;
        case Opcode::SaveStateOsr:
            return;
        case Opcode::SaveStateSuspend:
            return;
        case Opcode::Select:
            return;
        case Opcode::SelectTransform:
            return;
        case Opcode::SelectImm:
            return;
        case Opcode::SelectImmTransform:
            return;
        case Opcode::AddOverflow:
            return;
        case Opcode::SubOverflow:
            return;
        case Opcode::AddOverflowCheck:
            return;
        case Opcode::SubOverflowCheck:
            return;
        case Opcode::NegOverflowAndZeroCheck:
            return;
        case Opcode::If:
            return;
        case Opcode::IfImm:
            return;
        case Opcode::NOP:
            return;
        case Opcode::Try:
            return;
        case Opcode::CatchPhi:
            return;
        case Opcode::LiveIn:
            return;
        case Opcode::LiveOut:
            return;
        default:
            return;
    }
}
