X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FAnalysis%2FAliasDebugger.cpp;h=1e82621e0202137d26837a0395f92a4ce434ae07;hb=6b38e29f13cb8700146e4b170567e2828553db9a;hp=ddbb7bde4cae9e6ba6eb4cb15643c33b19c6b97b;hpb=472c7918b0bc155e002db6f682c899e21bff852c;p=oota-llvm.git diff --git a/lib/Analysis/AliasDebugger.cpp b/lib/Analysis/AliasDebugger.cpp index ddbb7bde4ca..1e82621e020 100644 --- a/lib/Analysis/AliasDebugger.cpp +++ b/lib/Analysis/AliasDebugger.cpp @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by Andrew Lenharth and is distributed under -// the University of Illinois Open Source License. See LICENSE.TXT for details. +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -23,12 +23,14 @@ #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/Support/Compiler.h" #include using namespace llvm; namespace { - class AliasDebugger : public ModulePass, public AliasAnalysis { + class VISIBILITY_HIDDEN AliasDebugger + : public ModulePass, public AliasAnalysis { //What we do is simple. Keep track of every value the AA could //know about, and verify that queries are one of those. @@ -38,6 +40,9 @@ namespace { std::set Vals; public: + static char ID; // Class identification, replacement for typeinfo + AliasDebugger() : ModulePass(&ID) {} + bool runOnModule(Module &M) { InitializeAliasAnalysis(this); // set up super class @@ -48,7 +53,7 @@ namespace { for(Module::iterator I = M.begin(), E = M.end(); I != E; ++I){ Vals.insert(&*I); - if(!I->isExternal()) { + if(!I->isDeclaration()) { for (Function::arg_iterator AI = I->arg_begin(), AE = I->arg_end(); AI != AE; ++AI) Vals.insert(&*AI); @@ -97,15 +102,6 @@ namespace { return AliasAnalysis::pointsToConstantMemory(P); } - /// getModRefBehavior - Return the behavior of the specified function if - /// called from the specified call site. The call site may be null in which - /// case the most generic behavior of this function should be returned. - virtual ModRefBehavior getModRefBehavior(Function *F, CallSite CS, - std::vector *Info) { - assert(Vals.find(F) != Vals.end() && "Never seen value in AA before"); - return AliasAnalysis::getModRefBehavior(F, CS, Info); - } - virtual void deleteValue(Value *V) { assert(Vals.find(V) != Vals.end() && "Never seen value in AA before"); AliasAnalysis::deleteValue(V); @@ -116,10 +112,12 @@ namespace { } }; - - RegisterPass X("debug-aa", "AA use debugger"); - RegisterAnalysisGroup Y(X); } +char AliasDebugger::ID = 0; +static RegisterPass +X("debug-aa", "AA use debugger", false, true); +static RegisterAnalysisGroup Y(X); + Pass *llvm::createAliasDebugger() { return new AliasDebugger(); }