From dca12c77dfec3ab2fb8f2056b3f610f916e48919 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 26 Feb 2003 19:57:10 +0000 Subject: Add new -no-aa implementation llvm-svn: 5641 --- llvm/lib/Analysis/AliasAnalysis.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'llvm/lib/Analysis') diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp index 4816a67d102..a85d28daf2b 100644 --- a/llvm/lib/Analysis/AliasAnalysis.cpp +++ b/llvm/lib/Analysis/AliasAnalysis.cpp @@ -97,3 +97,22 @@ bool AliasAnalysis::canInstructionRangeModify(const Instruction &I1, extern void BasicAAStub(); static IncludeFile INCLUDE_BASICAA_CPP((void*)&BasicAAStub); + +namespace { + struct NoAA : public ImmutablePass, public AliasAnalysis { + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AliasAnalysis::getAnalysisUsage(AU); + } + + virtual void initializePass() { + InitializeAliasAnalysis(this); + } + }; + + // Register this pass... + RegisterOpt + X("no-aa", "No Alias Analysis (always returns 'may' alias)"); + + // Declare that we implement the AliasAnalysis interface + RegisterAnalysisGroup Y; +} // End of anonymous namespace -- cgit v1.2.3