Add initial support for a globals graph
[oota-llvm.git] / include / llvm / Analysis / BasicAliasAnalysis.h
1 //===- llvm/Analysis/BasicAliasAnalysis.h - Alias Analysis Impl -*- C++ -*-===//
2 //
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.
6 //
7 //===----------------------------------------------------------------------===//
8
9 #ifndef LLVM_ANALYSIS_BASIC_ALIAS_ANALYSIS_H
10 #define LLVM_ANALYSIS_BASIC_ALIAS_ANALYSIS_H
11
12 #include "llvm/Analysis/AliasAnalysis.h"
13 #include "llvm/Pass.h"
14
15 struct BasicAliasAnalysis : public ImmutablePass, public AliasAnalysis {
16
17   // alias - This is the only method here that does anything interesting...
18   //
19   Result alias(const Value *V1, const Value *V2);
20     
21   /// canCallModify - We are not interprocedural, so we do nothing exciting.
22   ///
23   Result canCallModify(const CallInst &CI, const Value *Ptr) {
24     return MayAlias;
25   }
26     
27   /// canInvokeModify - We are not interprocedural, so we do nothing exciting.
28   ///
29   Result canInvokeModify(const InvokeInst &I, const Value *Ptr) {
30     return MayAlias;  // We are not interprocedural
31   }
32 };
33
34 #endif