Skip to content

Commit c733ca1

Browse files
committed
[NFC] Make EscapeState a public member of EscapeAnalysis.
Makes EscapeAnalysis::EscapeState public. This allows EscapeAnalysis::getEscapeState to be used outside of EscapeAnalysis.
1 parent 554cbda commit c733ca1

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

include/swift/SILOptimizer/Analysis/EscapeAnalysis.h

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -225,26 +225,6 @@ class EscapeAnalysis : public BottomUpIPAnalysis {
225225
Return
226226
};
227227

228-
/// Indicates to what a value escapes. Note: the order of values is important.
229-
enum class EscapeState : char {
230-
231-
/// The node's value does not escape.
232-
/// The value points to a locally allocated object who's lifetime ends in
233-
/// the same function.
234-
None,
235-
236-
/// The node's value escapes through the return value.
237-
/// The value points to a locally allocated object which escapes via the
238-
/// return instruction.
239-
Return,
240-
241-
/// The node's value escapes through a function argument.
242-
Arguments,
243-
244-
/// The node's value escapes to any global or unidentified memory.
245-
Global
246-
};
247-
248228
// Must be ordered from most precise to least precise. A meet across memory
249229
// locations (such as aggregate fields) always moves down.
250230
enum PointerKind { NoPointer, ReferenceOnly, AnyPointer };
@@ -276,6 +256,27 @@ class EscapeAnalysis : public BottomUpIPAnalysis {
276256
};
277257

278258
public:
259+
260+
/// Indicates to what a value escapes. Note: the order of values is important.
261+
enum class EscapeState : char {
262+
263+
/// The node's value does not escape.
264+
/// The value points to a locally allocated object who's lifetime ends in
265+
/// the same function.
266+
None,
267+
268+
/// The node's value escapes through the return value.
269+
/// The value points to a locally allocated object which escapes via the
270+
/// return instruction.
271+
Return,
272+
273+
/// The node's value escapes through a function argument.
274+
Arguments,
275+
276+
/// The node's value escapes to any global or unidentified memory.
277+
Global
278+
};
279+
279280

280281
/// A node in the connection graph.
281282
/// A node basically represents a "pointer" or the "memory content" where a

0 commit comments

Comments
 (0)