• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_LABEL_H
17 #define PANDA_ASSEMBLER_ASSEMBLY_LABEL_H
18 
19 #include <string>
20 #include "assembly-file-location.h"
21 
22 namespace ark::pandasm {
23 
24 struct Label {
25     std::string name;                          // NOLINT(misc-non-private-member-variables-in-classes)
26     std::optional<FileLocation> fileLocation;  // NOLINT(misc-non-private-member-variables-in-classes)
27 
28     // CC-OFFNXT(G.FUN.01-CPP) solid logic
LabelLabel29     Label(std::string s, size_t bL, size_t bR, std::string fC, bool d, size_t lN)
30         : name(std::move(s)), fileLocation({fC, bL, bR, lN, d})
31     {
32     }
33 
LabelLabel34     explicit Label(std::string s) : name(std::move(s)) {}
35 };
36 
37 }  // namespace ark::pandasm
38 
39 #endif  // PANDA_ASSEMBLER_ASSEMBLY_LABEL_H
40