Chris Lattner | 467dd2e | 2004-03-08 17:06:13 +0000 | [diff] [blame] | 1 | //===- ProfilingUtils.h - Helper functions shared by profilers --*- C++ -*-===// |
Misha Brukman | fd93908 | 2005-04-21 23:48:37 +0000 | [diff] [blame] | 2 | // |
Chris Lattner | 467dd2e | 2004-03-08 17:06:13 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 4ee451d | 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. |
Misha Brukman | fd93908 | 2005-04-21 23:48:37 +0000 | [diff] [blame] | 7 | // |
Chris Lattner | 467dd2e | 2004-03-08 17:06:13 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This files defines a few helper functions which are used by profile |
| 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; |
Chris Lattner | 467dd2e | 2004-03-08 17:06:13 +0000 | [diff] [blame] | 23 | class BasicBlock; |
| 24 | |
| 25 | void InsertProfilingInitCall(Function *MainFn, const char *FnName, |
Brian Gaeke | ebbc0e9 | 2004-05-03 22:06:33 +0000 | [diff] [blame] | 26 | GlobalValue *Arr = 0); |
Chris Lattner | 467dd2e | 2004-03-08 17:06:13 +0000 | [diff] [blame] | 27 | void IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum, |
Reid Spencer | 518310c | 2004-07-18 00:44:37 +0000 | [diff] [blame] | 28 | GlobalValue *CounterArray); |
Chris Lattner | 467dd2e | 2004-03-08 17:06:13 +0000 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | #endif |