diff options
author | Chris Lattner <sabre@nondot.org> | 2002-08-22 18:25:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-08-22 18:25:20 +0000 |
commit | 4df22c0100fe27f19e6f4874f24eedd0742b9cf4 (patch) | |
tree | ec81069a1816bfe70ca666c3b9ac28783808cae7 /include/llvm/Analysis/BasicAliasAnalysis.h | |
parent | d456ec983c7e2e6c3c03b20ff3a359db5326cfde (diff) |
Checkin new alias analysis infrastructure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3464 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/BasicAliasAnalysis.h')
-rw-r--r-- | include/llvm/Analysis/BasicAliasAnalysis.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/include/llvm/Analysis/BasicAliasAnalysis.h b/include/llvm/Analysis/BasicAliasAnalysis.h new file mode 100644 index 0000000000..c6b25d6660 --- /dev/null +++ b/include/llvm/Analysis/BasicAliasAnalysis.h @@ -0,0 +1,48 @@ +//===- llvm/Analysis/BasicAliasAnalysis.h - Alias Analysis Impl -*- C++ -*-===// +// +// This file defines the generic AliasAnalysis interface, which is used as the +// common interface used by all clients of alias analysis information, and +// implemented by all alias analysis implementations. +// +// Implementations of this interface must implement the various virtual methods, +// which automatically provides functionality for the entire suite of client +// APIs. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ANALYSIS_BASIC_ALIAS_ANALYSIS_H +#define LLVM_ANALYSIS_BASIC_ALIAS_ANALYSIS_H + +#include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/Pass.h" + +struct BasicAliasAnalysis : public FunctionPass, public AliasAnalysis { + + // Pass Implementation stuff. This isn't much of a pass. + // + bool runOnFunction(Function &) { return false; } + + // getAnalysisUsage - Does not modify anything. + // + virtual void getAnalysisUsage(AnalysisUsage &AU) const { + AU.setPreservesAll(); + } + + // alias - This is the only method here that does anything interesting... + // + Result alias(const Value *V1, const Value *V2) const; + + // canCallModify - We are not interprocedural, so we do nothing exciting. + // + Result canCallModify(const CallInst &CI, const Value *Ptr) const { + return MayAlias; + } + + // canInvokeModify - We are not interprocedural, so we do nothing exciting. + // + Result canInvokeModify(const InvokeInst &I, const Value *Ptr) const { + return MayAlias; // We are not interprocedural + } +}; + +#endif |