@@ -17,7 +17,9 @@ import type { AsyncOrSync, AsyncOrSyncType } from 'ts-essentials';
1717import type { ReadonlyFlowrAnalysisProvider } from '../../project/flowr-analyzer' ;
1818import { promoteCallName } from '../../queries/catalog/call-context-query/call-context-query-executor' ;
1919import { CfgKind } from '../../project/cfg-kind' ;
20- import { identifyLinkToRelation } from '../../queries/catalog/call-context-query/identify-link-to-relation' ;
20+ import {
21+ identifyLinkToLastCallRelationSync
22+ } from '../../queries/catalog/call-context-query/identify-link-to-last-call-relation' ;
2123
2224
2325export interface EnrichmentData < ElementContent extends MergeableRecord , ElementArguments = undefined , SearchContent extends MergeableRecord = never , SearchArguments = ElementArguments > {
@@ -154,12 +156,13 @@ export const Enrichments = {
154156 enrichElement : async ( e , _s , analyzer , args , prev ) => {
155157 guard ( args && args . length , `${ Enrichment . LastCall } enrichment requires at least one argument` ) ;
156158 const content = prev ?? { linkedIds : [ ] } ;
157- const df = await analyzer . dataflow ( ) ;
158- const n = await analyzer . normalize ( ) ;
159- const vertex = df . graph . get ( e . node . info . id ) ;
160- if ( vertex !== undefined && vertex [ 0 ] . tag === VertexType . FunctionCall ) {
159+ const df = ( await analyzer . dataflow ( ) ) . graph ;
160+ const vertex = df . getVertex ( e . node . info . id ) ;
161+ if ( vertex ?. tag === VertexType . FunctionCall ) {
162+ const n = await analyzer . normalize ( ) ;
163+ const cfg = ( await analyzer . controlflow ( undefined , CfgKind . Quick ) ) . graph ;
161164 for ( const arg of args ) {
162- const lastCalls = await identifyLinkToRelation ( vertex [ 0 ] . id , analyzer , {
165+ const lastCalls = identifyLinkToLastCallRelationSync ( vertex . id , cfg , df , {
163166 ...arg ,
164167 callName : promoteCallName ( arg . callName ) ,
165168 type : 'link-to-last-call' ,
0 commit comments