/// such it doesn't follow many of the rules that other alias analyses must.
///
struct VISIBILITY_HIDDEN NoAA : public ImmutablePass, public AliasAnalysis {
+ static const int ID; // Class identification, replacement for typeinfo
+ NoAA() : ImmutablePass((intptr_t)&ID) {}
+
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<TargetData>();
}
};
// Register this pass...
+ const int NoAA::ID = 0;
RegisterPass<NoAA>
U("no-aa", "No Alias Analysis (always returns 'may' alias)");
/// Because it doesn't chain to a previous alias analysis (like -no-aa), it
/// derives from the NoAA class.
struct VISIBILITY_HIDDEN BasicAliasAnalysis : public NoAA {
+ static const int ID; // Class identification, replacement for typeinfo
AliasResult alias(const Value *V1, unsigned V1Size,
const Value *V2, unsigned V2Size);
};
// Register this pass...
+ const int BasicAliasAnalysis::ID = 0;
RegisterPass<BasicAliasAnalysis>
X("basicaa", "Basic Alias Analysis (default AA impl)");