ContextVector ContextUtils::getAllContexts(SandboxVector& sandboxes) { ContextVector Cs; Cs.push_back(PRIV_CONTEXT); Cs.push_back(NO_CONTEXT); Cs.insert(Cs.end(), sandboxes.begin(), sandboxes.end()); return Cs; }
bool ContextUtils::isInContext(Instruction* I, Context* C, bool contextInsensitive, SandboxVector& sandboxes, Module& M) { ContextVector Cs = getContextsForInstruction(I, contextInsensitive, sandboxes, M); SDEBUG("soaap.util.context", 5, dbgs() << "Looking for " << stringifyContext(C) << " amongst " << Cs.size() << " contexts\n"); SDEBUG("soaap.util.context", 5, dbgs() << "sandboxes.size(): " << sandboxes.size() << "\n"); return find(Cs.begin(), Cs.end(), C) != Cs.end(); }