Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 1 | //===- ProfilingUtils.h - Helper functions shared by profilers --*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 081ce94 | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
Gabor Greif | 4750dac | 2008-03-06 10:36:00 +0000 | [diff] [blame^] | 10 | // This file defines a few helper functions which are used by profile |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 11 | // instrumentation code to instrument the code. This allows the profiler pass |
| 12 | // to worry about *what* to insert, and these functions take care of *how* to do |
| 13 | // it. |
| 14 | // |
| 15 | //===----------------------------------------------------------------------===// |
| 16 | |
| 17 | #ifndef PROFILINGUTILS_H |
| 18 | #define PROFILINGUTILS_H |
| 19 | |
| 20 | namespace llvm { |
| 21 | class Function; |
| 22 | class GlobalValue; |
| 23 | class BasicBlock; |
| 24 | |
| 25 | void InsertProfilingInitCall(Function *MainFn, const char *FnName, |
| 26 | GlobalValue *Arr = 0); |
| 27 | void IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum, |
| 28 | GlobalValue *CounterArray); |
| 29 | } |
| 30 | |
| 31 | #endif |