From 8dcd17c938a11fe7b16592a70170cc850c45dcc1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 26 Feb 2003 19:57:10 +0000 Subject: [PATCH] Add new -no-aa implementation git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5641 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/AliasAnalysis.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/Analysis/AliasAnalysis.cpp b/lib/Analysis/AliasAnalysis.cpp index 4816a67d102..a85d28daf2b 100644 --- a/lib/Analysis/AliasAnalysis.cpp +++ b/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 -- 2.40.0