- class CodeGenFunction has a member variable LocalDeclMap, who keeps track for local C decls.
- In my local downstream, I add a new pragma noprefetch to Indicate relate VarDecl should not be prefecthed, it works fine with nomal function, but I find it doesn’t hold VarDecl of Template function, such as testcase: Compiler Explorer
template <class flt_t>
void foo (flt_t dest[N], unsigned int index[N], flt_t src[Length], int n)
{
#pragma clang loop noprefetch(index)
for (int j = 0; j < n; j++) {
dest[j] = src[index[j]];
}
}
void foo_float (float dest[], unsigned int index[], float src[], int n) {
return foo<float>(dest, index, src, n);
}
I tried to some test code in function CodeGenFunction::EmitForStmt, then
It can be see we’ll not reach line 1183 for the above Template function, and it can reach the line 1183 if it is a normal function Compiler Explorer.
- The above experiment showed the member variable LocalDeclMap of class CodeGenFunction only hold the VarDecl of normal function ?