1 /** 2 * Copyright (c) 2024 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 #include "libabckit/src/ir_impl.h" 17 #include <cassert> 18 GetMethodIdByOffset(uint32_t offset) const19std::string AbckitIrInterface::GetMethodIdByOffset(uint32_t offset) const 20 { 21 auto it = methods.find(offset); 22 ASSERT(it != methods.cend()); 23 24 return std::string(it->second); 25 } 26 GetStringIdByOffset(uint32_t offset) const27std::string AbckitIrInterface::GetStringIdByOffset(uint32_t offset) const 28 { 29 auto it = strings.find(offset); 30 ASSERT(it != strings.cend()); 31 32 return std::string(it->second); 33 } 34 GetLiteralArrayIdByOffset(uint32_t offset) const35std::string AbckitIrInterface::GetLiteralArrayIdByOffset(uint32_t offset) const 36 { 37 auto it = literalarrays.find(offset); 38 ASSERT(it != literalarrays.cend()); 39 40 return std::string(it->second); 41 } 42 GetTypeIdByOffset(uint32_t offset) const43std::string AbckitIrInterface::GetTypeIdByOffset(uint32_t offset) const 44 { 45 auto it = classes.find(offset); 46 ASSERT(it != classes.cend()); 47 48 return std::string(it->second); 49 } 50 GetFieldIdByOffset(uint32_t offset) const51std::string AbckitIrInterface::GetFieldIdByOffset(uint32_t offset) const 52 { 53 auto it = fields.find(offset); 54 ASSERT(it != fields.cend()); 55 56 return std::string(it->second); 57 } 58