File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -89,9 +89,19 @@ CallInst *findControlPointCall(Module &M) {
8989}
9090
9191// / Extract all live variables that need to be passed into the control point.
92+ // /
93+ // / YKFIXME: This currently computes an over-approximation of what's live.
94+ // / https://github.com/ykjit/yk/issues/515
9295std::vector<Value *> getLiveVars (DominatorTree &DT, CallInst *OldCtrlPoint) {
9396 std::vector<Value *> Vec;
9497 Function *Func = OldCtrlPoint->getFunction ();
98+
99+ // Add function arguments to the live set.
100+ for (Value &Arg : Func->args ()) {
101+ Vec.push_back (&Arg);
102+ }
103+
104+ // Then add anything which dominates the control point to the live set.
95105 for (auto &BB : *Func) {
96106 if (!DT.dominates (cast<Instruction>(OldCtrlPoint), &BB)) {
97107 for (auto &I : BB) {
You can’t perform that action at this time.
0 commit comments