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