1 /* 2 * Copyright (c) 2021-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 #ifndef PANDA_ASSEMBLER_ASSEMBLY_DEBUG_H 17 #define PANDA_ASSEMBLER_ASSEMBLY_DEBUG_H 18 19 #include <cstdint> 20 #include <string> 21 22 namespace ark::pandasm::debuginfo { 23 24 // NOLINTBEGIN(misc-non-private-member-variables-in-classes) 25 struct Ins { 26 size_t lineNumber = 0; 27 uint32_t columnNumber = 0; 28 std::string wholeLine; // NOTE(mbolshov): redundant given file and line_number 29 size_t boundLeft = 0; 30 size_t boundRight = 0; 31 SetLineNumberIns32 void SetLineNumber(size_t ln) 33 { 34 lineNumber = ln; 35 } 36 SetColumnNumberIns37 void SetColumnNumber(size_t cn) 38 { 39 columnNumber = cn; 40 } 41 42 Ins() = default; InsIns43 Ins(size_t lN, std::string &fC, size_t bL, size_t bR) 44 : lineNumber(lN), wholeLine(std::move(fC)), boundLeft(bL), boundRight(bR) 45 { 46 } 47 }; 48 // NOLINTEND(misc-non-private-member-variables-in-classes) 49 50 struct LocalVariable { 51 std::string name; 52 std::string signature; 53 std::string signatureType; 54 int32_t reg = 0; 55 uint32_t start = 0; 56 uint32_t length = 0; 57 }; 58 59 } // namespace ark::pandasm::debuginfo 60 61 #endif // PANDA_ASSEMBLER_ASSEMBLY_DEBUG_H 62