Using helper functions from another pass

Hello everyone!

I’m unsure whether my question is appropriately phrased, but I am currently trying to use functions from the SafeStack pass (LLVM: lib/CodeGen/SafeStack.cpp Source File) for my pass.

For example, inside the SafeStack pass, there are many functions (e.g., IsSafeStackAlloca and findInsts) that I could use for my pass, and I was wondering what the right way to include this SafeStack pass for my pass to call necessary functions is.

The reason why I’m asking this is that until now, I have been able to getResult of different analyses (e.g., StackSafetyInfo *SS = FAM.getResult<StackSafetyAnalysis>(*F);) after including the necessary header file (e.g., "#include "llvm/Analysis/StackSafetyAnalysis.h"), but in this case, I simply want to derive functions that are used in other passes.

Thank you in advance for any help,
Kind regards.