LLVM Discussion Forums

Is it a dead code?

I’m reading the llvm code of IRTranslator. By simply searching the repository. I found the function translateLoad never get called in any part of the source tree. How does this happen? Many thanks!!!

I think it’ll be called by some TableGen generated code. One way to figure out is to delete the function and its declaration and try to build LLVM?

Another way is to add abort() in the function body and run the tests, it should produce a stack trace (better build in Debug mode to get accurate info)

The translateLoad is declared as private, so it can be called only by IRTranslator itself and I can’t find the call in the cpp file

Did you try the advice I gave you?

I suspect it will point you to: https://github.com/llvm/llvm-project/blob/7497b861f49629e84be1215b8d2da18898b1097c/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp#L2488

Got it. Sorry for my careless :slight_smile: