blob: 3ab125493b948a39e47decf3c9e6bc729a742b3d [file] [log] [blame]
Andrew Lenharth93e59f62005-11-28 00:58:09 +00001//===- RSProfiling.cpp - Various profiling using random sampling ----------===//
2//
3// The LLVM Compiler Infrastructure
4//
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.
7//
8//===----------------------------------------------------------------------===//
9//
10// See notes in RSProfiling.cpp
11//
12//===----------------------------------------------------------------------===//
13
14namespace llvm {
15 // By default, we provide some convienence stuff to clients, so they
16 // can just store the instructions they create to do profiling.
17 // also, handle all chaining issues.
18 // a client is free to overwrite these, as long as it implements the
19 // chaining itself.
20 struct RSProfilers : public ModulePass {
21 std::set<Value*> profcode;
22 virtual bool isProfiling(Value* v);
23 virtual ~RSProfilers() {}
24 virtual void getAnalysisUsage(AnalysisUsage &AU) const;
25 void IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
26 GlobalValue *CounterArray);
27 };
28};