|
1 | 1 | /*
|
2 |
| - This file is part of solidity. |
| 2 | + This file is part of solidity. |
3 | 3 |
|
4 |
| - solidity is free software: you can redistribute it and/or modify |
5 |
| - it under the terms of the GNU General Public License as published by |
6 |
| - the Free Software Foundation, either version 3 of the License, or |
7 |
| - (at your option) any later version. |
| 4 | + solidity is free software: you can redistribute it and/or modify |
| 5 | + it under the terms of the GNU General Public License as published by |
| 6 | + the Free Software Foundation, either version 3 of the License, or |
| 7 | + (at your option) any later version. |
8 | 8 |
|
9 |
| - solidity is distributed in the hope that it will be useful, |
10 |
| - but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 |
| - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 |
| - GNU General Public License for more details. |
| 9 | + solidity is distributed in the hope that it will be useful, |
| 10 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | + GNU General Public License for more details. |
13 | 13 |
|
14 |
| - You should have received a copy of the GNU General Public License |
15 |
| - along with solidity. If not, see <http://www.gnu.org/licenses/>. |
| 14 | + You should have received a copy of the GNU General Public License |
| 15 | + along with solidity. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | */
|
17 | 17 | // SPDX-License-Identifier: GPL-3.0
|
18 | 18 |
|
@@ -42,44 +42,43 @@ class IRVariable
|
42 | 42 | {
|
43 | 43 |
|
44 | 44 | public:
|
45 |
| - /// IR variable with explicit base name @a _baseName and type @a _type. |
46 |
| - IRVariable(std::string _baseName, Type _type, size_t _stackSize); |
47 |
| - /// IR variable referring to the declaration @a _decl. |
48 |
| - explicit IRVariable(VariableDeclaration const& _decl, Type _type, size_t _stackSize); |
49 |
| - /// IR variable referring to the expression @a _expr. |
50 |
| - /// Intentionally not defined as explicit to allow defining IRVariables for expressions directly via implicit conversions. |
51 |
| - IRVariable(Expression const& _expression, Type _type, size_t _stackSize); |
| 45 | + /// IR variable with explicit base name @a _baseName and type @a _type. |
| 46 | + IRVariable(std::string _baseName, Type _type, size_t _stackSize); |
| 47 | + /// IR variable referring to the declaration @a _decl. |
| 48 | + explicit IRVariable(VariableDeclaration const& _decl, Type _type, size_t _stackSize); |
| 49 | + /// IR variable referring to the expression @a _expr. |
| 50 | + /// Intentionally not defined as explicit to allow defining IRVariables for expressions directly via implicit conversions. |
| 51 | + IRVariable(Expression const& _expression, Type _type, size_t _stackSize); |
52 | 52 |
|
53 |
| - /// @returns the name of the variable, if it occupies a single stack slot (otherwise throws). |
54 |
| - std::string name() const; |
| 53 | + /// @returns the name of the variable, if it occupies a single stack slot (otherwise throws). |
| 54 | + std::string name() const; |
55 | 55 |
|
56 |
| - /// @returns a comma-separated list of the stack slots of the variable. |
57 |
| - std::string commaSeparatedList() const; |
| 56 | + /// @returns a comma-separated list of the stack slots of the variable. |
| 57 | + std::string commaSeparatedList() const; |
58 | 58 |
|
59 |
| - /// @returns a comma-separated list of the stack slots of the variable that is |
60 |
| - /// prefixed with a comma, unless it is empty. |
61 |
| - std::string commaSeparatedListPrefixed() const; |
| 59 | + /// @returns a comma-separated list of the stack slots of the variable that is |
| 60 | + /// prefixed with a comma, unless it is empty. |
| 61 | + std::string commaSeparatedListPrefixed() const; |
62 | 62 |
|
63 |
| - /// @returns an IRVariable referring to the tuple component @a _i of a tuple variable. |
64 |
| - IRVariable tupleComponent(std::size_t _i) const; |
| 63 | + /// @returns an IRVariable referring to the tuple component @a _i of a tuple variable. |
| 64 | + IRVariable tupleComponent(std::size_t _i) const; |
65 | 65 |
|
66 |
| - /// @returns the type of the variable. |
67 |
| - Type type() const { return m_type; } |
| 66 | + /// @returns the type of the variable. |
| 67 | + Type type() const { return m_type; } |
68 | 68 |
|
69 |
| - /// @returns the stack size of the variable. |
70 |
| - size_t stackSize() const { return m_stackSize; } |
| 69 | + /// @returns the stack size of the variable. |
| 70 | + size_t stackSize() const { return m_stackSize; } |
71 | 71 |
|
72 |
| - /// @returns a vector containing the names of the stack slots of the variable. |
73 |
| - std::vector<std::string> stackSlots() const; |
| 72 | + /// @returns a vector containing the names of the stack slots of the variable. |
| 73 | + std::vector<std::string> stackSlots() const; |
74 | 74 |
|
75 | 75 | private:
|
76 |
| - /// @returns a name consisting of the base name appended with an underscore and @a _suffix, |
77 |
| - /// unless @a _suffix is empty, in which case the base name itself is returned. |
78 |
| - std::string suffixedName(std::string const& _suffix) const; |
79 |
| - std::string m_baseName; |
80 |
| - Type m_type; |
81 |
| - size_t m_stackSize; |
| 76 | + /// @returns a name consisting of the base name appended with an underscore and @a _suffix, |
| 77 | + /// unless @a _suffix is empty, in which case the base name itself is returned. |
| 78 | + std::string suffixedName(std::string const& _suffix) const; |
| 79 | + std::string m_baseName; |
| 80 | + Type m_type; |
| 81 | + size_t m_stackSize; |
82 | 82 | };
|
83 | 83 |
|
84 |
| - |
85 | 84 | }
|
0 commit comments