LLVM  6.0.0svn
Macros | Functions | Variables
GCOVProfiling.cpp File Reference
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/UniqueVector.h"
#include "llvm/Analysis/EHPersonalities.h"
#include "llvm/IR/DebugInfo.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/InstIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Module.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/GCOVProfiler.h"
#include "llvm/Transforms/Instrumentation.h"
#include "llvm/Transforms/Utils/ModuleUtils.h"
#include <algorithm>
#include <memory>
#include <string>
#include <utility>
Include dependency graph for GCOVProfiling.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "insert-gcov-profiling"
 

Functions

 INITIALIZE_PASS (GCOVProfilerLegacyPass, "insert-gcov-profiling", "Insert instrumentation for GCOV profiling", false, false) ModulePass *llvm
 
static StringRef getFunctionName (const DISubprogram *SP)
 
static bool functionHasLines (Function &F)
 
static bool isUsingFuncletBasedEH (Function &F)
 
static bool shouldKeepInEntry (BasicBlock::iterator It)
 

Variables

static cl::opt< std::string > DefaultGCOVVersion ("default-gcov-version", cl::init("402*"), cl::Hidden, cl::ValueRequired)
 
static cl::opt< boolDefaultExitBlockBeforeBody ("gcov-exit-block-before-body", cl::init(false), cl::Hidden)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "insert-gcov-profiling"

Definition at line 47 of file GCOVProfiling.cpp.

Function Documentation

◆ functionHasLines()

static bool functionHasLines ( Function F)
static

Definition at line 484 of file GCOVProfiling.cpp.

References llvm::DebugLoc::getLine(), and I.

Referenced by shouldKeepInEntry().

◆ getFunctionName()

static StringRef getFunctionName ( const DISubprogram SP)
static

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( GCOVProfilerLegacyPass  ,
"insert-gcov-profiling"  ,
"Insert instrumentation for GCOV profiling"  ,
false  ,
false   
)

Definition at line 156 of file GCOVProfiling.cpp.

◆ isUsingFuncletBasedEH()

static bool isUsingFuncletBasedEH ( Function F)
static

◆ shouldKeepInEntry()

static bool shouldKeepInEntry ( BasicBlock::iterator  It)
static

Definition at line 513 of file GCOVProfiling.cpp.

References llvm::MCID::Add, llvm::Function::addFnAttr(), llvm::appendToGlobalCtors(), Arg, llvm::Function::arg_begin(), llvm::AMDGPU::HSAMD::Kernel::Key::Args, assert(), llvm::BasicBlock::begin(), llvm::raw_fd_ostream::close(), llvm::BasicBlock::Create(), llvm::Function::Create(), llvm::BranchInst::Create(), llvm::IRBuilder< T, Inserter >::CreateAdd(), llvm::IRBuilder< T, Inserter >::CreateBr(), llvm::IRBuilder< T, Inserter >::CreateCall(), llvm::IRBuilder< T, Inserter >::CreateCondBr(), llvm::IRBuilder< T, Inserter >::CreateConstGEP2_64(), llvm::IRBuilder< T, Inserter >::CreateConstInBoundsGEP2_64(), llvm::IRBuilder< T, Inserter >::CreateGEP(), llvm::IRBuilder< T, Inserter >::CreateGlobalStringPtr(), llvm::IRBuilder< T, Inserter >::CreateICmpEQ(), llvm::IRBuilder< T, Inserter >::CreateInBoundsGEP(), llvm::IRBuilder< T, Inserter >::CreateLoad(), llvm::IRBuilder< T, Inserter >::CreateRet(), llvm::IRBuilder< T, Inserter >::CreateRetVoid(), llvm::IRBuilder< T, Inserter >::CreateSelect(), llvm::IRBuilder< T, Inserter >::CreateStore(), llvm::IRBuilder< T, Inserter >::CreateZExt(), llvm::UniqueVector< T >::empty(), F(), llvm::sys::fs::F_None, functionHasLines(), llvm::Module::functions(), GEP, llvm::ConstantInt::get(), llvm::FunctionType::get(), llvm::ArrayType::get(), llvm::ConstantArray::get(), llvm::PointerType::get(), llvm::getDISubprogram(), llvm::DICompileUnit::getDWOId(), llvm::DIScope::getFilename(), llvm::Module::getFunction(), llvm::getFunctionName(), llvm::Module::getGlobalVariable(), llvm::IRBuilderBase::getInt32(), llvm::Type::getInt32Ty(), llvm::IRBuilderBase::getInt64(), llvm::Type::getInt64PtrTy(), llvm::IRBuilderBase::getInt64Ty(), llvm::Type::getInt64Ty(), llvm::IRBuilderBase::getInt8(), llvm::IRBuilderBase::getInt8PtrTy(), llvm::Type::getInt8PtrTy(), llvm::Type::getInt8Ty(), llvm::DebugLoc::getLine(), llvm::Module::getNamedMetadata(), llvm::Constant::getNullValue(), llvm::NamedMDNode::getNumOperands(), llvm::TerminatorInst::getNumSuccessors(), llvm::NamedMDNode::getOperand(), llvm::Module::getOrInsertFunction(), llvm::Type::getPointerTo(), llvm::Function::getReturnType(), llvm::DebugLoc::getScope(), llvm::TerminatorInst::getSuccessor(), llvm::GlobalValue::getValueType(), llvm::IRBuilderBase::getVoidTy(), llvm::Type::getVoidTy(), llvm::GlobalValue::Global, llvm::hash_value(), I, llvm::UniqueVector< T >::idFor(), llvm::UniqueVector< T >::insert(), Int32Ty, llvm::GlobalValue::InternalLinkage, llvm::Type::isIntegerTy(), isUsingFuncletBasedEH(), llvm::makeArrayRef(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::report_fatal_error(), llvm::IRBuilderBase::SetInsertPoint(), llvm::GlobalValue::setLinkage(), llvm::Value::setName(), llvm::GlobalValue::setUnnamedAddr(), llvm::UniqueVector< T >::size(), llvm::BasicBlock::splitBasicBlock(), llvm::successors(), and llvm::raw_ostream::write().

Variable Documentation

◆ DefaultExitBlockBeforeBody

cl::opt<bool> DefaultExitBlockBeforeBody("gcov-exit-block-before-body", cl::init(false), cl::Hidden)
static

◆ DefaultGCOVVersion

cl::opt<std::string> DefaultGCOVVersion("default-gcov-version", cl::init("402*"), cl::Hidden, cl::ValueRequired)
static