Search for specific code line

Dear everyone,

Is it possible in LLVM/clang to search for a specific code line and print out/extract the whole function/relevant code region where the code line was found?

Here is an example. I would like to analyze the c file in https://github.com/UoB-HPC/intro-hpc-jacobi.

Let’s say the specific code line is line 62:
dot += A[row + col*N] * x[col];

In that case I would be interested in that code region:

// Perfom Jacobi iteration
for (row = 0; row < N; row++)
{
dot = 0.0;
for (col = 0; col < N; col++)
{
if (row != col)
dot += A[row + colN] * x[col];
}
xtmp[row] = (b[row] - dot) / A[row + row
N];
}

How can I get this result via LLVM/clang?

Thank you very much for your ideas!

Best
Anja