[llvm-dev] Why do backend pass definitions call a seperate function just to call the constructor?

Ahmed Samara via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 16 12:40:25 PST 2018

Things like this in `lib/Target/ARM/ARMExpandPseudoInsts.cpp`

FunctionPass *llvm::createARMExpandPseudoPass() {
>   return new ARMExpandPseudo();
> }

And other functions have basically the same style.

What's the point of doing it this way instead of just calling `new
ARMExpandPseudo` in any place that you would have called this function?

Ahmed Samara
M.S. Computer Engineering
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180116/9f055d5c/attachment.html>

More information about the llvm-dev mailing list