Add the notion of releasing instructions to SILNodes.def.

This will be used in call graph construction so that we can model calls
to deinits that are potentially called as a result of executing
instructions that can end up releasing memory.
This commit is contained in:
Mark Lacey
2015-11-04 13:32:18 -08:00
parent 2e796aeb9f
commit 5eb64493e4
8 changed files with 178 additions and 142 deletions

View File

@@ -97,6 +97,13 @@ public:
MayHaveSideEffects,
};
/// Enumeration representing whether the execution of an instruction can
/// result in memory being released.
enum class ReleasingBehavior {
DoesNotRelease,
MayRelease,
};
const SILBasicBlock *getParent() const { return ParentBB; }
SILBasicBlock *getParent() { return ParentBB; }
@@ -151,6 +158,7 @@ public:
}
MemoryBehavior getMemoryBehavior() const;
ReleasingBehavior getReleasingBehavior() const;
/// Can this instruction abort the program in some manner?
bool mayTrap() const;