[LLVMdev] Re: getAnalysis
Chris Lattner
sabre at nondot.org
Thu Nov 21 23:00:01 PST 2002
On Thu, 21 Nov 2002, Juan Nicolas Ruiz wrote:
> 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.
-Chris
--
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/
More information about the llvm-dev
mailing list