sorry for sending this question just to you: What do I need to include
or declare in order to be able to use an external analysis? I'm trying
to do:

DSGraph* DSG = getAnalysis<BUDataStructures>().getDSGraph(F);

I have
#include "llvm/PassAnalysisSupport.h" // getAnalysis

Please do not ever #include this file directly, always #include Pass.h

but still keep getting the error:
MemLeak.cpp:34: `getAnalysis' undeclared (first use this function)

You must call it from one of the methods of your Pass subclass. IOW, the
"this" object that the getAnalyisis method expects is a Pass.