UNPKG

@eagleoutice/flowr-dev

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

25 lines 1.11 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.executeCallGraphQuery = executeCallGraphQuery; const log_1 = require("../../../util/log"); const expand_library_internals_1 = require("./expand-library-internals"); const call_graph_1 = require("../../../dataflow/graph/call-graph"); /** * Executes the given call graph queries. */ async function executeCallGraphQuery({ analyzer }, queries) { if (queries.length !== 1) { log_1.log.warn('Call Graph query expects only up to one query, but got', queries.length); } const startTime = Date.now(); const graph = await analyzer.callGraph(); const expand = queries.some(q => q.expandLibraryInternals); return { '.meta': { timing: Date.now() - startTime }, graph: expand ? (0, expand_library_internals_1.expandCallGraphLibraryInternals)(graph, analyzer.inspectContext().deps) : graph, unreachable: queries.some(q => q.reportUnreachable) ? call_graph_1.CallGraph.unreachableCalls(graph) : undefined }; } //# sourceMappingURL=call-graph-query-executor.js.map