2004-03-09 01:06:13 +08:00
|
|
|
//===- ProfilingUtils.h - Helper functions shared by profilers --*- C++ -*-===//
|
2005-04-22 07:48:37 +08:00
|
|
|
//
|
2004-03-09 01:06:13 +08:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-30 04:36:04 +08:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-22 07:48:37 +08:00
|
|
|
//
|
2004-03-09 01:06:13 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This files defines a few helper functions which are used by profile
|
|
|
|
// 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 {
|
|
|
|
class Function;
|
|
|
|
class GlobalValue;
|
|
|
|
class BasicBlock;
|
|
|
|
|
|
|
|
void InsertProfilingInitCall(Function *MainFn, const char *FnName,
|
2004-05-04 06:06:33 +08:00
|
|
|
GlobalValue *Arr = 0);
|
2004-03-09 01:06:13 +08:00
|
|
|
void IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
|
2004-07-18 08:44:37 +08:00
|
|
|
GlobalValue *CounterArray);
|
2004-03-09 01:06:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|