bool ScopDetection::isValidCallInst(CallInst &CI) { if (CI.mayHaveSideEffects() || CI.doesNotReturn()) return false; if (CI.doesNotAccessMemory()) return true; Function *CalledFunction = CI.getCalledFunction(); // Indirect calls are not supported. if (CalledFunction == 0) return false; // TODO: Intrinsics. return false; }