LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LibCallAliasAnalysis.h
Go to the documentation of this file.
1 //===- LibCallAliasAnalysis.h - Implement AliasAnalysis for libcalls ------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines the LibCallAliasAnalysis class.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_ANALYSIS_LIBCALLALIASANALYSIS_H
15 #define LLVM_ANALYSIS_LIBCALLALIASANALYSIS_H
16 
18 #include "llvm/Pass.h"
19 
20 namespace llvm {
21  class LibCallInfo;
22  struct LibCallFunctionInfo;
23 
24  /// LibCallAliasAnalysis - Alias analysis driven from LibCallInfo.
26  static char ID; // Class identification
27 
29 
31  : FunctionPass(ID), LCI(LC) {
33  }
34  explicit LibCallAliasAnalysis(char &ID, LibCallInfo *LC)
35  : FunctionPass(ID), LCI(LC) {
37  }
39 
41  const Location &Loc);
42 
44  ImmutableCallSite CS2) {
45  // TODO: Could compare two direct calls against each other if we cared to.
46  return AliasAnalysis::getModRefInfo(CS1, CS2);
47  }
48 
49  virtual void getAnalysisUsage(AnalysisUsage &AU) const;
50 
51  virtual bool runOnFunction(Function &F) {
52  InitializeAliasAnalysis(this); // set up super class
53  return false;
54  }
55 
56  /// getAdjustedAnalysisPointer - This method is used when a pass implements
57  /// an analysis interface through multiple inheritance. If needed, it
58  /// should override this to adjust the this pointer as needed for the
59  /// specified pass info.
60  virtual void *getAdjustedAnalysisPointer(const void *PI) {
61  if (PI == &AliasAnalysis::ID)
62  return (AliasAnalysis*)this;
63  return this;
64  }
65 
66  private:
67  ModRefResult AnalyzeLibCallDetails(const LibCallFunctionInfo *FI,
69  const Location &Loc);
70  };
71 } // End of llvm namespace
72 
73 #endif
static PassRegistry * getPassRegistry()
ModRefResult getModRefInfo(const Instruction *I, const Location &Loc)
F(f)
virtual bool runOnFunction(Function &F)
LibCallAliasAnalysis(LibCallInfo *LC=0)
void InitializeAliasAnalysis(Pass *P)
ModRefResult getModRefInfo(ImmutableCallSite CS1, ImmutableCallSite CS2)
void initializeLibCallAliasAnalysisPass(PassRegistry &)
LibCallAliasAnalysis(char &ID, LibCallInfo *LC)
virtual void * getAdjustedAnalysisPointer(const void *PI)
ImmutableCallSite - establish a view to a call site for examination.
Definition: CallSite.h:318
ModRefResult getModRefInfo(ImmutableCallSite CS, const Location &Loc)
LibCallAliasAnalysis - Alias analysis driven from LibCallInfo.
virtual void getAnalysisUsage(AnalysisUsage &AU) const