LLVM
8.0.1
|
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Sequence.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/Analysis/EHPersonalities.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/IR/CFG.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/Regex.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Instrumentation.h"
#include "llvm/Transforms/Instrumentation/GCOVProfiler.h"
#include "llvm/Transforms/Utils/ModuleUtils.h"
#include <algorithm>
#include <memory>
#include <string>
#include <utility>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "insert-gcov-profiling" |
Functions | |
INITIALIZE_PASS_BEGIN (GCOVProfilerLegacyPass, "insert-gcov-profiling", "Insert instrumentation for GCOV profiling", false, false) INITIALIZE_PASS_END(GCOVProfilerLegacyPass | |
static StringRef | getFunctionName (const DISubprogram *SP) |
static SmallString< 128 > | getFilename (const DISubprogram *SP) |
Extract a filename for a DISubprogram. More... | |
static bool | functionHasLines (Function &F) |
static bool | isUsingScopeBasedEH (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< bool > | DefaultExitBlockBeforeBody ("gcov-exit-block-before-body", cl::init(false), cl::Hidden) |
insert gcov | profiling |
insert gcov Insert instrumentation for GCOV | false |
#define DEBUG_TYPE "insert-gcov-profiling" |
Definition at line 50 of file GCOVProfiling.cpp.
Definition at line 586 of file GCOVProfiling.cpp.
References llvm::DebugLoc::getLine(), and I.
Referenced by shouldKeepInEntry().
|
static |
Extract a filename for a DISubprogram.
Prefer relative paths in the coverage notes. Clang also may split up absolute paths into a directory and filename component. When the relative path doesn't exist, reconstruct the absolute path.
Definition at line 188 of file GCOVProfiling.cpp.
References addEdge(), llvm::sys::path::append(), assert(), llvm::Function::begin(), llvm::StringRef::data(), llvm::dbgs(), llvm::StringRef::empty(), llvm::sys::fs::exists(), llvm::GCOVOptions::ExitBlockBeforeBody, F(), llvm::raw_ostream::flush(), llvm::DIScope::getDirectory(), llvm::DIScope::getFilename(), llvm::getFunctionName(), llvm::StringMapEntry< ValueTy >::getKey(), llvm::hash_value(), I, LLVM_DEBUG, llvm::Number, llvm::SmallVectorTemplateBase< T >::push_back(), Size, llvm::StringRef::size(), llvm::sort(), llvm::StringRef::split(), llvm::Successor, llvm::GCOVOptions::UseCfgChecksum, and write().
Referenced by llvm::DIScope::getFile(), llvm::DIFile::ChecksumInfo< T >::getKindAsString(), and shouldKeepInEntry().
|
static |
Definition at line 177 of file GCOVProfiling.cpp.
References llvm::DIScope::getName().
INITIALIZE_PASS_BEGIN | ( | GCOVProfilerLegacyPass | , |
"insert-gcov-profiling" | , | ||
"Insert instrumentation for GCOV profiling" | , | ||
false | , | ||
false | |||
) |
Referenced by llvm::GCOVOptions::getDefault().
Definition at line 608 of file GCOVProfiling.cpp.
References llvm::classifyEHPersonality(), llvm::Function::getPersonalityFn(), llvm::Function::hasPersonalityFn(), and llvm::isScopedEHPersonality().
Referenced by shouldKeepInEntry().
|
static |
Definition at line 615 of file GCOVProfiling.cpp.
References llvm::Function::addFnAttr(), llvm::PHINode::addIncoming(), llvm::CallBase::addParamAttr(), llvm::appendToGlobalCtors(), llvm::AMDGPU::HSAMD::Kernel::Key::Args, assert(), llvm::BasicBlock::begin(), Callee, llvm::raw_fd_ostream::close(), llvm::BasicBlock::Create(), llvm::Function::Create(), llvm::StructType::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 >::CreateGlobalStringPtr(), llvm::IRBuilder< T, Inserter >::CreateICmpSLT(), llvm::IRBuilder< T, Inserter >::CreateInBoundsGEP(), llvm::IRBuilder< T, Inserter >::CreateLoad(), llvm::IRBuilder< T, Inserter >::CreatePHI(), llvm::IRBuilder< T, Inserter >::CreateRet(), llvm::IRBuilder< T, Inserter >::CreateRetVoid(), llvm::IRBuilder< T, Inserter >::CreateStore(), llvm::IRBuilder< T, Inserter >::CreateStructGEP(), llvm::SmallVectorBase::empty(), llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::sys::fs::F_None, llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::find(), functionHasLines(), llvm::Module::functions(), llvm::ConstantInt::get(), llvm::FunctionType::get(), llvm::ArrayType::get(), llvm::ConstantArray::get(), llvm::ConstantStruct::get(), llvm::PointerType::get(), llvm::getDISubprogram(), llvm::DICompileUnit::getDWOId(), llvm::Function::getEntryBlock(), llvm::TargetLibraryInfo::getExtAttrForI32Param(), getFilename(), llvm::Module::getFunction(), llvm::getFunctionName(), llvm::ConstantExpr::getInBoundsGetElementPtr(), llvm::IRBuilderBase::getInt32(), llvm::IRBuilderBase::getInt32Ty(), 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::IRBuilderBase::getInt8Ty(), llvm::Type::getInt8Ty(), llvm::TargetLibraryInfo::getLibFunc(), llvm::DebugLoc::getLine(), llvm::Module::getNamedMetadata(), llvm::Constant::getNullValue(), llvm::NamedMDNode::getNumOperands(), llvm::Instruction::getNumSuccessors(), llvm::NamedMDNode::getOperand(), llvm::Module::getOrInsertFunction(), llvm::Type::getPointerTo(), llvm::Function::getReturnType(), llvm::DebugLoc::getScope(), llvm::Function::getSubprogram(), llvm::Instruction::getSuccessor(), llvm::GlobalValue::getValueType(), llvm::IRBuilderBase::getVoidTy(), llvm::Type::getVoidTy(), llvm::GlobalValue::Global, llvm::hash_value(), I, llvm::instructions(), llvm::GlobalValue::InternalLinkage, llvm::DebugLoc::isImplicitCode(), llvm::Type::isIntegerTy(), isUsingScopeBasedEH(), llvm::Intrinsic::localescape, llvm::Attribute::NoInline, llvm::Attribute::NoRedZone, llvm::pred_begin(), llvm::pred_end(), llvm::predecessors(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::report_fatal_error(), llvm::SmallVectorImpl< T >::resize(), llvm::IRBuilderBase::SetInsertPoint(), llvm::GlobalValue::setLinkage(), llvm::GlobalValue::setUnnamedAddr(), llvm::SmallVectorBase::size(), llvm::BasicBlock::splitBasicBlock(), llvm::successors(), and llvm::raw_ostream::write().
|
static |
Referenced by llvm::GCOVOptions::getDefault().
|
static |
Referenced by llvm::GCOVOptions::getDefault().
insert gcov Insert instrumentation for GCOV false |
Definition at line 170 of file GCOVProfiling.cpp.
insert gcov Insert instrumentation for GCOV profiling |
Definition at line 170 of file GCOVProfiling.cpp.