2004-03-08 17:06:13 +00:00
|
|
|
//===- ProfilingUtils.h - Helper functions shared by profilers --*- C++ -*-===//
|
2005-04-21 23:48:37 +00:00
|
|
|
//
|
2004-03-08 17:06:13 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:36:04 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 23:48:37 +00:00
|
|
|
//
|
2004-03-08 17:06:13 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2008-03-06 10:36:00 +00:00
|
|
|
// This file defines a few helper functions which are used by profile
|
2004-03-08 17:06:13 +00:00
|
|
|
// instrumentation code to instrument the code. This allows the profiler pass
|
|
|
|
// to worry about *what* to insert, and these functions take care of *how* to do
|
|
|
|
// it.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef PROFILINGUTILS_H
|
|
|
|
#define PROFILINGUTILS_H
|
|
|
|
|
|
|
|
namespace llvm {
|
2011-04-08 22:19:52 +00:00
|
|
|
class BasicBlock;
|
2004-03-08 17:06:13 +00:00
|
|
|
class Function;
|
|
|
|
class GlobalValue;
|
2011-04-08 22:19:52 +00:00
|
|
|
class Module;
|
2011-01-29 01:09:53 +00:00
|
|
|
class PointerType;
|
2004-03-08 17:06:13 +00:00
|
|
|
|
|
|
|
void InsertProfilingInitCall(Function *MainFn, const char *FnName,
|
2011-01-29 01:09:53 +00:00
|
|
|
GlobalValue *Arr = 0,
|
|
|
|
PointerType *arrayType = 0);
|
2004-03-08 17:06:13 +00:00
|
|
|
void IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
|
2011-01-29 01:09:53 +00:00
|
|
|
GlobalValue *CounterArray,
|
|
|
|
bool beginning = true);
|
2011-04-08 22:19:52 +00:00
|
|
|
void InsertProfilingShutdownCall(Function *Callee, Module *Mod);
|
2004-03-08 17:06:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|