blob: 643b9e1b12c225d442a3316b30e3a65249ff57cd [file] [log] [blame]
Chris Lattner467dd2e2004-03-08 17:06:13 +00001//===- ProfilingUtils.h - Helper functions shared by profilers --*- C++ -*-===//
Misha Brukmanfd939082005-04-21 23:48:37 +00002//
Chris Lattner467dd2e2004-03-08 17:06:13 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Misha Brukmanfd939082005-04-21 23:48:37 +00007//
Chris Lattner467dd2e2004-03-08 17:06:13 +00008//===----------------------------------------------------------------------===//
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
20namespace llvm {
21 class Function;
22 class GlobalValue;
Chris Lattner467dd2e2004-03-08 17:06:13 +000023 class BasicBlock;
24
25 void InsertProfilingInitCall(Function *MainFn, const char *FnName,
Brian Gaekeebbc0e92004-05-03 22:06:33 +000026 GlobalValue *Arr = 0);
Chris Lattner467dd2e2004-03-08 17:06:13 +000027 void IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
Reid Spencer518310c2004-07-18 00:44:37 +000028 GlobalValue *CounterArray);
Chris Lattner467dd2e2004-03-08 17:06:13 +000029}
30
31#endif