summaryrefslogtreecommitdiff
path: root/lib/Transforms/Instrumentation/RSProfiling.h
blob: c1250a26af19e3b89d1b9480d1a2fa3adc4f067b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//===- RSProfiling.h - Various profiling using random sampling ----------===//
//
//                      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.
//
//===----------------------------------------------------------------------===//
//
// See notes in RSProfiling.cpp
//
//===----------------------------------------------------------------------===//
#include "llvm/Transforms/RSProfiling.h"
#include <set>

namespace llvm {
  /// RSProfilers_std - a simple support class for profilers that handles most
  /// of the work of chaining and tracking inserted code.
  struct RSProfilers_std : public RSProfilers {
    static const char ID;
    std::set<Value*> profcode;
    // Lookup up values in profcode
    virtual bool isProfiling(Value* v);
    // handles required chaining
    virtual void getAnalysisUsage(AnalysisUsage &AU) const;
    // places counter updates in basic blocks and recordes added instructions in
    // profcode
    void IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
                                 GlobalValue *CounterArray);
  };
}