[LLVMdev] GlobalsModRef

Jorge A. Navas navas at comp.nus.edu.sg
Thu Nov 17 16:22:00 PST 2011


Hi all,

I'm implementing an intra-procedural analysis. For correctness, during
the analysis of each function I need to know which global variables
may be modified by other functions in order to avoid wrong assumptions
about those variables.

I looked at lib/Analysis/IPA/GlobalsModRef.cpp and it seems that it
does what I want. My problem is that I don't know how to use it ;-(

I wrote a pass:

  struct MyPass : public FunctionPass {
    ....
    virtual void getAnalysisUsage(AnalysisUsage& AU) const {
       AU.addRequired<GlobalsModRef>();
       ...
    }
    ...
  }

but then I don't know which header file should I include. Otherwise, I
get the obvious error that "GlobalsModRef was not declared in this
scope"

Sorry because it's a basic question but I looked for any client of
GlobalsModRef in the llvm tree but it seems nobody uses it.

Regards,
Jorge



More information about the llvm-dev mailing list