1 /** 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef PANDA_VERIFICATION_DEFAULT_PLUGIN_H 17 #define PANDA_VERIFICATION_DEFAULT_PLUGIN_H 18 19 #include "abs_int_inl_compat_checks.h" 20 #include "verification/plugins.h" 21 22 namespace panda::verifier::plugin { 23 24 class DefaultPlugin final : public Plugin { 25 public: 26 ManagedThread *CreateManagedThread() const override; 27 void DestroyManagedThread(ManagedThread *thr) const override; 28 void TypeSystemSetup(TypeSystem *types) const override; 29 CheckFieldAccessViolation(Field const * field,Method const * from,TypeSystem * types)30 CheckResult const &CheckFieldAccessViolation([[maybe_unused]] Field const *field, 31 [[maybe_unused]] Method const *from, 32 [[maybe_unused]] TypeSystem *types) const override 33 { 34 return CheckResult::ok; 35 } 36 CheckMethodAccessViolation(Method const * method,Method const * from,TypeSystem * types)37 CheckResult const &CheckMethodAccessViolation([[maybe_unused]] Method const *method, 38 [[maybe_unused]] Method const *from, 39 [[maybe_unused]] TypeSystem *types) const override 40 { 41 return CheckResult::ok; 42 } 43 CheckClassAccessViolation(Class const * method,Method const * from,TypeSystem * types)44 CheckResult const &CheckClassAccessViolation([[maybe_unused]] Class const *method, 45 [[maybe_unused]] Method const *from, 46 [[maybe_unused]] TypeSystem *types) const override 47 { 48 return CheckResult::ok; 49 } 50 CheckClass(Class const * klass)51 CheckResult const &CheckClass([[maybe_unused]] Class const *klass) const override 52 { 53 return CheckResult::ok; 54 } 55 56 Type NormalizeType(Type type, TypeSystem *types) const override; 57 }; 58 59 } // namespace panda::verifier::plugin 60 61 #endif // PANDA_VERIFICATION_DEFAULT_PLUGIN_H 62