2002-07-29 21:24:10 +00:00
|
|
|
//===- AnalysisWrappers.cpp - Wrappers around non-pass analyses -----------===//
|
2003-10-20 17:47:21 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by the LLVM research group and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
2002-07-29 21:24:10 +00:00
|
|
|
//
|
|
|
|
// This file defines pass wrappers around LLVM analyses that don't make sense to
|
|
|
|
// be passes. It provides a nice standard pass interface to these classes so
|
|
|
|
// that they can be printed out by analyze.
|
|
|
|
//
|
2003-07-14 17:20:40 +00:00
|
|
|
// These classes are separated out of analyze.cpp so that it is more clear which
|
2002-07-29 21:24:10 +00:00
|
|
|
// code is the integral part of the analyze tool, and which part of the code is
|
|
|
|
// just making it so more passes are available.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2004-04-02 20:56:33 +00:00
|
|
|
#include "llvm/Pass.h"
|
2002-07-29 21:24:10 +00:00
|
|
|
#include "llvm/Analysis/InstForest.h"
|
|
|
|
|
2003-11-11 22:41:34 +00:00
|
|
|
using namespace llvm;
|
|
|
|
|
2002-07-29 21:24:10 +00:00
|
|
|
namespace {
|
|
|
|
struct InstForestHelper : public FunctionPass {
|
|
|
|
Function *F;
|
|
|
|
virtual bool runOnFunction(Function &Func) { F = &Func; return false; }
|
|
|
|
|
|
|
|
void print(std::ostream &OS) const {
|
|
|
|
std::cout << InstForest<char>(F);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
|
|
|
AU.setPreservesAll();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
RegisterAnalysis<InstForestHelper> P1("instforest", "InstForest Printer");
|
|
|
|
}
|