blob: a76e3576e1ca24b854fa2cecae4ca9c76d470fd7 [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//
Gabor Greif29d8aa72008-03-06 10:36:00 +000010// This file defines a few helper functions which are used by profile
Chris Lattner467dd2e2004-03-08 17:06:13 +000011// 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;
Andrew Trick04317cc2011-01-29 01:09:53 +000024 class PointerType;
Chris Lattner467dd2e2004-03-08 17:06:13 +000025
26 void InsertProfilingInitCall(Function *MainFn, const char *FnName,
Andrew Trick04317cc2011-01-29 01:09:53 +000027 GlobalValue *Arr = 0,
28 PointerType *arrayType = 0);
Chris Lattner467dd2e2004-03-08 17:06:13 +000029 void IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
Andrew Trick04317cc2011-01-29 01:09:53 +000030 GlobalValue *CounterArray,
31 bool beginning = true);
Chris Lattner467dd2e2004-03-08 17:06:13 +000032}
33
34#endif