LLVM API Documentation
00001 //===- RSProfiling.h - Various profiling using random sampling ----------===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // See notes in RSProfiling.cpp 00011 // 00012 //===----------------------------------------------------------------------===// 00013 #include "llvm/Transforms/RSProfiling.h" 00014 #include <set> 00015 00016 namespace llvm { 00017 /// RSProfilers_std - a simple support class for profilers that handles most 00018 /// of the work of chaining and tracking inserted code. 00019 struct RSProfilers_std : public RSProfilers { 00020 static char ID; 00021 std::set<Value*> profcode; 00022 // Lookup up values in profcode 00023 virtual bool isProfiling(Value* v); 00024 // handles required chaining 00025 virtual void getAnalysisUsage(AnalysisUsage &AU) const; 00026 // places counter updates in basic blocks and recordes added instructions in 00027 // profcode 00028 void IncrementCounterInBlock(BasicBlock *BB, unsigned CounterNum, 00029 GlobalValue *CounterArray); 00030 }; 00031 }