diff options
author | Xinliang David Li <davidxl@google.com> | 2015-11-05 05:46:39 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2015-11-05 05:46:39 +0000 |
commit | a026a437199c926d00480a092b18a515b4a33d2f (patch) | |
tree | 05e4d108d06cfcbafafbfc38ab49fabd8f0e4e2b /clang/lib/CodeGen/CoverageMappingGen.cpp | |
parent | 1084a94bf4e81c6fb74f84debc557249b0935744 (diff) | |
download | bcm5719-llvm-a026a437199c926d00480a092b18a515b4a33d2f.tar.gz bcm5719-llvm-a026a437199c926d00480a092b18a515b4a33d2f.zip |
Use profile data template file for covmap func record (NFC)
llvm-svn: 252147
Diffstat (limited to 'clang/lib/CodeGen/CoverageMappingGen.cpp')
-rw-r--r-- | clang/lib/CodeGen/CoverageMappingGen.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/clang/lib/CodeGen/CoverageMappingGen.cpp b/clang/lib/CodeGen/CoverageMappingGen.cpp index 0e170c468a7..2486a496a28 100644 --- a/clang/lib/CodeGen/CoverageMappingGen.cpp +++ b/clang/lib/CodeGen/CoverageMappingGen.cpp @@ -910,24 +910,23 @@ static void dump(llvm::raw_ostream &OS, StringRef FunctionName, } void CoverageMappingModuleGen::addFunctionMappingRecord( - llvm::GlobalVariable *FunctionName, StringRef FunctionNameValue, - uint64_t FunctionHash, const std::string &CoverageMapping) { + llvm::GlobalVariable *NamePtr, StringRef NameValue, + uint64_t FuncHash, const std::string &CoverageMapping) { llvm::LLVMContext &Ctx = CGM.getLLVMContext(); - auto *Int32Ty = llvm::Type::getInt32Ty(Ctx); - auto *Int64Ty = llvm::Type::getInt64Ty(Ctx); - auto *Int8PtrTy = llvm::Type::getInt8PtrTy(Ctx); if (!FunctionRecordTy) { - llvm::Type *FunctionRecordTypes[] = {Int8PtrTy, Int32Ty, Int32Ty, Int64Ty}; + #define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Init) LLVMType, + llvm::Type *FunctionRecordTypes[] = { + #include "llvm/ProfileData/InstrProfData.inc" + }; FunctionRecordTy = llvm::StructType::get(Ctx, makeArrayRef(FunctionRecordTypes), /*isPacked=*/true); } + #define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Init) Init, llvm::Constant *FunctionRecordVals[] = { - llvm::ConstantExpr::getBitCast(FunctionName, Int8PtrTy), - llvm::ConstantInt::get(Int32Ty, FunctionNameValue.size()), - llvm::ConstantInt::get(Int32Ty, CoverageMapping.size()), - llvm::ConstantInt::get(Int64Ty, FunctionHash)}; + #include "llvm/ProfileData/InstrProfData.inc" + }; FunctionRecords.push_back(llvm::ConstantStruct::get( FunctionRecordTy, makeArrayRef(FunctionRecordVals))); CoverageMappings += CoverageMapping; @@ -949,7 +948,7 @@ void CoverageMappingModuleGen::addFunctionMappingRecord( Expressions, Regions); if (Reader.read()) return; - dump(llvm::outs(), FunctionNameValue, Expressions, Regions); + dump(llvm::outs(), NameValue, Expressions, Regions); } } |