llvm-6502/lib/Transforms/Instrumentation/ProfilingUtils.h
Nick Lewycky 918035f802 Add a function for profiling to run at shutdown. Unlike the existing API, this
can be used even when main() isn't present in the Module, but it means that you
don't get to read argv[].


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129163 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-08 22:19:52 +00:00

37 lines
1.2 KiB
C++

//===- ProfilingUtils.h - Helper functions shared by profilers --*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file 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 BasicBlock;
class Function;
class GlobalValue;
class Module;
class PointerType;
void InsertProfilingInitCall(Function *MainFn, const char *FnName,
GlobalValue *Arr = 0,
PointerType *arrayType = 0);
void IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum,
GlobalValue *CounterArray,
bool beginning = true);
void InsertProfilingShutdownCall(Function *Callee, Module *Mod);
}
#endif