1 //===- AnalysisWrappers.cpp - Wrappers around non-pass analyses -----------===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines pass wrappers around LLVM analyses that don't make sense to
11 // be passes. It provides a nice standard pass interface to these classes so
12 // that they can be printed out by analyze.
14 // These classes are separated out of analyze.cpp so that it is more clear which
15 // code is the integral part of the analyze tool, and which part of the code is
16 // just making it so more passes are available.
18 //===----------------------------------------------------------------------===//
20 #include "llvm/Pass.h"
21 #include "llvm/Analysis/InstForest.h"
26 struct InstForestHelper : public FunctionPass {
28 virtual bool runOnFunction(Function &Func) { F = &Func; return false; }
30 void print(std::ostream &OS) const {
31 std::cout << InstForest<char>(F);
34 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
39 RegisterAnalysis<InstForestHelper> P1("instforest", "InstForest Printer");