1 //===- llvm/Analysis/BasicAliasAnalysis.h - Alias Analysis Impl -*- C++ -*-===//
3 // This file defines the default implementation of the Alias Analysis interface
4 // that simply implements a few identities (two different globals cannot alias,
5 // etc), but otherwise does no analysis.
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_ANALYSIS_BASIC_ALIAS_ANALYSIS_H
10 #define LLVM_ANALYSIS_BASIC_ALIAS_ANALYSIS_H
12 #include "llvm/Analysis/AliasAnalysis.h"
13 #include "llvm/Pass.h"
15 struct BasicAliasAnalysis : public ImmutablePass, public AliasAnalysis {
17 // Pass Implementation stuff. This isn't much of a pass.
19 bool runOnFunction(Function &) { return false; }
21 // getAnalysisUsage - Does not modify anything.
23 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
27 // alias - This is the only method here that does anything interesting...
29 Result alias(const Value *V1, const Value *V2) const;
31 /// canCallModify - We are not interprocedural, so we do nothing exciting.
33 Result canCallModify(const CallInst &CI, const Value *Ptr) const {
37 /// canInvokeModify - We are not interprocedural, so we do nothing exciting.
39 Result canInvokeModify(const InvokeInst &I, const Value *Ptr) const {
40 return MayAlias; // We are not interprocedural