Search for specific code line

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Search for specific code line

Deep Majumder via cfe-dev
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 + col*N] * 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

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev