- /// FunctionEffect - Capture whether or not this function reads or writes to
- /// ANY memory. If not, we can do a lot of aggressive analysis on it.
- unsigned FunctionEffect;
-
- FunctionRecord() : FunctionEffect(0) {}
- };
-
- /// GlobalsModRef - The actual analysis pass.
- class VISIBILITY_HIDDEN GlobalsModRef
- : public ModulePass, public AliasAnalysis {
- /// NonAddressTakenGlobals - The globals that do not have their addresses
- /// taken.
- std::set<GlobalValue*> NonAddressTakenGlobals;
-
- /// IndirectGlobals - The memory pointed to by this global is known to be
- /// 'owned' by the global.
- std::set<GlobalValue*> IndirectGlobals;
-
- /// AllocsForIndirectGlobals - If an instruction allocates memory for an
- /// indirect global, this map indicates which one.
- std::map<Value*, GlobalValue*> AllocsForIndirectGlobals;
-
- /// FunctionInfo - For each function, keep track of what globals are
- /// modified or read.
- std::map<Function*, FunctionRecord> FunctionInfo;
-
- public:
- static char ID;
- GlobalsModRef() : ModulePass((intptr_t)&ID) {}
-
- bool runOnModule(Module &M) {
- InitializeAliasAnalysis(this); // set up super class
- AnalyzeGlobals(M); // find non-addr taken globals
- AnalyzeCallGraph(getAnalysis<CallGraph>(), M); // Propagate on CG
- return false;
- }
+ /// FunctionEffect - Capture whether or not this function reads or writes to
+ /// ANY memory. If not, we can do a lot of aggressive analysis on it.
+ unsigned FunctionEffect;