2015-01-18 16:17:27 +00:00
|
|
|
//=-- CoverageMappingReader.cpp - Code coverage mapping reader ----*- C++ -*-=//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains support for reading coverage mapping data for
|
|
|
|
// instrumentation based coverage.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
#include "llvm/ProfileData/Coverage/CoverageMappingReader.h"
|
|
|
|
#include "llvm/ADT/DenseMap.h"
|
2015-05-27 18:44:32 +00:00
|
|
|
#include "llvm/Object/MachOUniversal.h"
|
2015-01-18 16:17:27 +00:00
|
|
|
#include "llvm/Object/ObjectFile.h"
|
|
|
|
#include "llvm/Support/Debug.h"
|
2015-05-27 18:44:32 +00:00
|
|
|
#include "llvm/Support/Endian.h"
|
2015-01-18 16:17:27 +00:00
|
|
|
#include "llvm/Support/LEB128.h"
|
2015-06-09 19:06:30 +00:00
|
|
|
#include "llvm/Support/MathExtras.h"
|
2015-05-27 18:44:32 +00:00
|
|
|
#include "llvm/Support/raw_ostream.h"
|
2015-01-18 16:17:27 +00:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
using namespace coverage;
|
|
|
|
using namespace object;
|
|
|
|
|
|
|
|
#define DEBUG_TYPE "coverage-mapping"
|
|
|
|
|
|
|
|
void CoverageMappingIterator::increment() {
|
|
|
|
// Check if all the records were read or if an error occurred while reading
|
|
|
|
// the next record.
|
2016-07-23 20:41:05 +00:00
|
|
|
if (auto E = Reader->readNextRecord(Record)) {
|
|
|
|
handleAllErrors(std::move(E), [&](const CoverageMapError &CME) {
|
|
|
|
if (CME.get() == coveragemap_error::eof)
|
|
|
|
*this = CoverageMappingIterator();
|
|
|
|
else
|
|
|
|
llvm_unreachable("Unexpected error in coverage mapping iterator");
|
|
|
|
});
|
|
|
|
}
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
Error RawCoverageReader::readULEB128(uint64_t &Result) {
|
2015-01-18 16:17:27 +00:00
|
|
|
if (Data.size() < 1)
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::truncated);
|
2015-01-18 16:17:27 +00:00
|
|
|
unsigned N = 0;
|
|
|
|
Result = decodeULEB128(reinterpret_cast<const uint8_t *>(Data.data()), &N);
|
|
|
|
if (N > Data.size())
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::malformed);
|
2015-01-18 16:17:27 +00:00
|
|
|
Data = Data.substr(N);
|
2016-07-23 20:41:05 +00:00
|
|
|
return Error::success();
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
Error RawCoverageReader::readIntMax(uint64_t &Result, uint64_t MaxPlus1) {
|
2015-01-18 16:17:27 +00:00
|
|
|
if (auto Err = readULEB128(Result))
|
|
|
|
return Err;
|
|
|
|
if (Result >= MaxPlus1)
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::malformed);
|
|
|
|
return Error::success();
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
Error RawCoverageReader::readSize(uint64_t &Result) {
|
2015-01-18 16:17:27 +00:00
|
|
|
if (auto Err = readULEB128(Result))
|
|
|
|
return Err;
|
|
|
|
// Sanity check the number.
|
|
|
|
if (Result > Data.size())
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::malformed);
|
|
|
|
return Error::success();
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
Error RawCoverageReader::readString(StringRef &Result) {
|
2015-01-18 16:17:27 +00:00
|
|
|
uint64_t Length;
|
|
|
|
if (auto Err = readSize(Length))
|
|
|
|
return Err;
|
|
|
|
Result = Data.substr(0, Length);
|
|
|
|
Data = Data.substr(Length);
|
2016-07-23 20:41:05 +00:00
|
|
|
return Error::success();
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
Error RawCoverageFilenamesReader::read() {
|
2015-01-18 16:17:27 +00:00
|
|
|
uint64_t NumFilenames;
|
|
|
|
if (auto Err = readSize(NumFilenames))
|
|
|
|
return Err;
|
|
|
|
for (size_t I = 0; I < NumFilenames; ++I) {
|
|
|
|
StringRef Filename;
|
|
|
|
if (auto Err = readString(Filename))
|
|
|
|
return Err;
|
|
|
|
Filenames.push_back(Filename);
|
|
|
|
}
|
2016-07-23 20:41:05 +00:00
|
|
|
return Error::success();
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
Error RawCoverageMappingReader::decodeCounter(unsigned Value, Counter &C) {
|
2015-01-18 16:17:27 +00:00
|
|
|
auto Tag = Value & Counter::EncodingTagMask;
|
|
|
|
switch (Tag) {
|
|
|
|
case Counter::Zero:
|
|
|
|
C = Counter::getZero();
|
2016-07-23 20:41:05 +00:00
|
|
|
return Error::success();
|
2015-01-18 16:17:27 +00:00
|
|
|
case Counter::CounterValueReference:
|
|
|
|
C = Counter::getCounter(Value >> Counter::EncodingTagBits);
|
2016-07-23 20:41:05 +00:00
|
|
|
return Error::success();
|
2015-01-18 16:17:27 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
Tag -= Counter::Expression;
|
|
|
|
switch (Tag) {
|
|
|
|
case CounterExpression::Subtract:
|
|
|
|
case CounterExpression::Add: {
|
|
|
|
auto ID = Value >> Counter::EncodingTagBits;
|
|
|
|
if (ID >= Expressions.size())
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::malformed);
|
2015-01-18 16:17:27 +00:00
|
|
|
Expressions[ID].Kind = CounterExpression::ExprKind(Tag);
|
|
|
|
C = Counter::getExpression(ID);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::malformed);
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
2016-07-23 20:41:05 +00:00
|
|
|
return Error::success();
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
Error RawCoverageMappingReader::readCounter(Counter &C) {
|
2015-01-18 16:17:27 +00:00
|
|
|
uint64_t EncodedCounter;
|
|
|
|
if (auto Err =
|
|
|
|
readIntMax(EncodedCounter, std::numeric_limits<unsigned>::max()))
|
|
|
|
return Err;
|
|
|
|
if (auto Err = decodeCounter(EncodedCounter, C))
|
|
|
|
return Err;
|
2016-07-23 20:41:05 +00:00
|
|
|
return Error::success();
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const unsigned EncodingExpansionRegionBit = 1
|
|
|
|
<< Counter::EncodingTagBits;
|
|
|
|
|
|
|
|
/// \brief Read the sub-array of regions for the given inferred file id.
|
|
|
|
/// \param NumFileIDs the number of file ids that are defined for this
|
|
|
|
/// function.
|
2016-07-23 20:41:05 +00:00
|
|
|
Error RawCoverageMappingReader::readMappingRegionsSubArray(
|
2015-01-18 16:17:27 +00:00
|
|
|
std::vector<CounterMappingRegion> &MappingRegions, unsigned InferredFileID,
|
|
|
|
size_t NumFileIDs) {
|
|
|
|
uint64_t NumRegions;
|
|
|
|
if (auto Err = readSize(NumRegions))
|
|
|
|
return Err;
|
|
|
|
unsigned LineStart = 0;
|
|
|
|
for (size_t I = 0; I < NumRegions; ++I) {
|
|
|
|
Counter C;
|
|
|
|
CounterMappingRegion::RegionKind Kind = CounterMappingRegion::CodeRegion;
|
|
|
|
|
|
|
|
// Read the combined counter + region kind.
|
|
|
|
uint64_t EncodedCounterAndRegion;
|
|
|
|
if (auto Err = readIntMax(EncodedCounterAndRegion,
|
|
|
|
std::numeric_limits<unsigned>::max()))
|
|
|
|
return Err;
|
|
|
|
unsigned Tag = EncodedCounterAndRegion & Counter::EncodingTagMask;
|
|
|
|
uint64_t ExpandedFileID = 0;
|
|
|
|
if (Tag != Counter::Zero) {
|
|
|
|
if (auto Err = decodeCounter(EncodedCounterAndRegion, C))
|
|
|
|
return Err;
|
|
|
|
} else {
|
|
|
|
// Is it an expansion region?
|
|
|
|
if (EncodedCounterAndRegion & EncodingExpansionRegionBit) {
|
|
|
|
Kind = CounterMappingRegion::ExpansionRegion;
|
|
|
|
ExpandedFileID = EncodedCounterAndRegion >>
|
|
|
|
Counter::EncodingCounterTagAndExpansionRegionTagBits;
|
|
|
|
if (ExpandedFileID >= NumFileIDs)
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::malformed);
|
2015-01-18 16:17:27 +00:00
|
|
|
} else {
|
|
|
|
switch (EncodedCounterAndRegion >>
|
|
|
|
Counter::EncodingCounterTagAndExpansionRegionTagBits) {
|
|
|
|
case CounterMappingRegion::CodeRegion:
|
|
|
|
// Don't do anything when we have a code region with a zero counter.
|
|
|
|
break;
|
|
|
|
case CounterMappingRegion::SkippedRegion:
|
|
|
|
Kind = CounterMappingRegion::SkippedRegion;
|
|
|
|
break;
|
|
|
|
default:
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::malformed);
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Read the source range.
|
2015-05-27 18:44:32 +00:00
|
|
|
uint64_t LineStartDelta, ColumnStart, NumLines, ColumnEnd;
|
2015-01-18 16:17:27 +00:00
|
|
|
if (auto Err =
|
|
|
|
readIntMax(LineStartDelta, std::numeric_limits<unsigned>::max()))
|
|
|
|
return Err;
|
2015-05-27 18:44:32 +00:00
|
|
|
if (auto Err = readULEB128(ColumnStart))
|
2015-01-18 16:17:27 +00:00
|
|
|
return Err;
|
|
|
|
if (ColumnStart > std::numeric_limits<unsigned>::max())
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::malformed);
|
2015-01-18 16:17:27 +00:00
|
|
|
if (auto Err = readIntMax(NumLines, std::numeric_limits<unsigned>::max()))
|
|
|
|
return Err;
|
|
|
|
if (auto Err = readIntMax(ColumnEnd, std::numeric_limits<unsigned>::max()))
|
|
|
|
return Err;
|
|
|
|
LineStart += LineStartDelta;
|
|
|
|
// Adjust the column locations for the empty regions that are supposed to
|
|
|
|
// cover whole lines. Those regions should be encoded with the
|
|
|
|
// column range (1 -> std::numeric_limits<unsigned>::max()), but because
|
|
|
|
// the encoded std::numeric_limits<unsigned>::max() is several bytes long,
|
|
|
|
// we set the column range to (0 -> 0) to ensure that the column start and
|
|
|
|
// column end take up one byte each.
|
|
|
|
// The std::numeric_limits<unsigned>::max() is used to represent a column
|
|
|
|
// position at the end of the line without knowing the length of that line.
|
|
|
|
if (ColumnStart == 0 && ColumnEnd == 0) {
|
|
|
|
ColumnStart = 1;
|
|
|
|
ColumnEnd = std::numeric_limits<unsigned>::max();
|
|
|
|
}
|
|
|
|
|
|
|
|
DEBUG({
|
|
|
|
dbgs() << "Counter in file " << InferredFileID << " " << LineStart << ":"
|
|
|
|
<< ColumnStart << " -> " << (LineStart + NumLines) << ":"
|
|
|
|
<< ColumnEnd << ", ";
|
|
|
|
if (Kind == CounterMappingRegion::ExpansionRegion)
|
|
|
|
dbgs() << "Expands to file " << ExpandedFileID;
|
|
|
|
else
|
|
|
|
CounterMappingContext(Expressions).dump(C, dbgs());
|
|
|
|
dbgs() << "\n";
|
|
|
|
});
|
|
|
|
|
|
|
|
MappingRegions.push_back(CounterMappingRegion(
|
2015-05-27 18:44:32 +00:00
|
|
|
C, InferredFileID, ExpandedFileID, LineStart, ColumnStart,
|
|
|
|
LineStart + NumLines, ColumnEnd, Kind));
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
2016-07-23 20:41:05 +00:00
|
|
|
return Error::success();
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
Error RawCoverageMappingReader::read() {
|
2015-01-18 16:17:27 +00:00
|
|
|
|
|
|
|
// Read the virtual file mapping.
|
|
|
|
llvm::SmallVector<unsigned, 8> VirtualFileMapping;
|
|
|
|
uint64_t NumFileMappings;
|
|
|
|
if (auto Err = readSize(NumFileMappings))
|
|
|
|
return Err;
|
|
|
|
for (size_t I = 0; I < NumFileMappings; ++I) {
|
|
|
|
uint64_t FilenameIndex;
|
|
|
|
if (auto Err = readIntMax(FilenameIndex, TranslationUnitFilenames.size()))
|
|
|
|
return Err;
|
|
|
|
VirtualFileMapping.push_back(FilenameIndex);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Construct the files using unique filenames and virtual file mapping.
|
|
|
|
for (auto I : VirtualFileMapping) {
|
|
|
|
Filenames.push_back(TranslationUnitFilenames[I]);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Read the expressions.
|
|
|
|
uint64_t NumExpressions;
|
|
|
|
if (auto Err = readSize(NumExpressions))
|
|
|
|
return Err;
|
|
|
|
// Create an array of dummy expressions that get the proper counters
|
|
|
|
// when the expressions are read, and the proper kinds when the counters
|
|
|
|
// are decoded.
|
|
|
|
Expressions.resize(
|
|
|
|
NumExpressions,
|
|
|
|
CounterExpression(CounterExpression::Subtract, Counter(), Counter()));
|
|
|
|
for (size_t I = 0; I < NumExpressions; ++I) {
|
|
|
|
if (auto Err = readCounter(Expressions[I].LHS))
|
|
|
|
return Err;
|
|
|
|
if (auto Err = readCounter(Expressions[I].RHS))
|
|
|
|
return Err;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Read the mapping regions sub-arrays.
|
|
|
|
for (unsigned InferredFileID = 0, S = VirtualFileMapping.size();
|
|
|
|
InferredFileID < S; ++InferredFileID) {
|
|
|
|
if (auto Err = readMappingRegionsSubArray(MappingRegions, InferredFileID,
|
|
|
|
VirtualFileMapping.size()))
|
|
|
|
return Err;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Set the counters for the expansion regions.
|
|
|
|
// i.e. Counter of expansion region = counter of the first region
|
|
|
|
// from the expanded file.
|
|
|
|
// Perform multiple passes to correctly propagate the counters through
|
|
|
|
// all the nested expansion regions.
|
|
|
|
SmallVector<CounterMappingRegion *, 8> FileIDExpansionRegionMapping;
|
|
|
|
FileIDExpansionRegionMapping.resize(VirtualFileMapping.size(), nullptr);
|
|
|
|
for (unsigned Pass = 1, S = VirtualFileMapping.size(); Pass < S; ++Pass) {
|
|
|
|
for (auto &R : MappingRegions) {
|
|
|
|
if (R.Kind != CounterMappingRegion::ExpansionRegion)
|
|
|
|
continue;
|
|
|
|
assert(!FileIDExpansionRegionMapping[R.ExpandedFileID]);
|
|
|
|
FileIDExpansionRegionMapping[R.ExpandedFileID] = &R;
|
|
|
|
}
|
|
|
|
for (auto &R : MappingRegions) {
|
|
|
|
if (FileIDExpansionRegionMapping[R.FileID]) {
|
|
|
|
FileIDExpansionRegionMapping[R.FileID]->Count = R.Count;
|
|
|
|
FileIDExpansionRegionMapping[R.FileID] = nullptr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
return Error::success();
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
Expected<bool> RawCoverageMappingDummyChecker::isDummy() {
|
|
|
|
// A dummy coverage mapping data consists of just one region with zero count.
|
|
|
|
uint64_t NumFileMappings;
|
|
|
|
if (Error Err = readSize(NumFileMappings))
|
|
|
|
return std::move(Err);
|
|
|
|
if (NumFileMappings != 1)
|
|
|
|
return false;
|
|
|
|
// We don't expect any specific value for the filename index, just skip it.
|
|
|
|
uint64_t FilenameIndex;
|
|
|
|
if (Error Err =
|
|
|
|
readIntMax(FilenameIndex, std::numeric_limits<unsigned>::max()))
|
|
|
|
return std::move(Err);
|
|
|
|
uint64_t NumExpressions;
|
|
|
|
if (Error Err = readSize(NumExpressions))
|
|
|
|
return std::move(Err);
|
|
|
|
if (NumExpressions != 0)
|
|
|
|
return false;
|
|
|
|
uint64_t NumRegions;
|
|
|
|
if (Error Err = readSize(NumRegions))
|
|
|
|
return std::move(Err);
|
|
|
|
if (NumRegions != 1)
|
|
|
|
return false;
|
|
|
|
uint64_t EncodedCounterAndRegion;
|
|
|
|
if (Error Err = readIntMax(EncodedCounterAndRegion,
|
|
|
|
std::numeric_limits<unsigned>::max()))
|
|
|
|
return std::move(Err);
|
|
|
|
unsigned Tag = EncodedCounterAndRegion & Counter::EncodingTagMask;
|
|
|
|
return Tag == Counter::Zero;
|
|
|
|
}
|
|
|
|
|
|
|
|
Error InstrProfSymtab::create(SectionRef &Section) {
|
|
|
|
if (auto EC = Section.getContents(Data))
|
|
|
|
return errorCodeToError(EC);
|
2015-12-30 11:46:15 +00:00
|
|
|
Address = Section.getAddress();
|
2016-07-23 20:41:05 +00:00
|
|
|
return Error::success();
|
2015-12-30 11:46:15 +00:00
|
|
|
}
|
2015-01-18 16:17:27 +00:00
|
|
|
|
2015-12-30 11:46:15 +00:00
|
|
|
StringRef InstrProfSymtab::getFuncName(uint64_t Pointer, size_t Size) {
|
|
|
|
if (Pointer < Address)
|
|
|
|
return StringRef();
|
|
|
|
auto Offset = Pointer - Address;
|
|
|
|
if (Offset + Size > Data.size())
|
|
|
|
return StringRef();
|
|
|
|
return Data.substr(Pointer - Address, Size);
|
2015-07-05 14:21:36 +00:00
|
|
|
}
|
2015-01-18 16:17:27 +00:00
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
// Check if the mapping data is a dummy, i.e. is emitted for an unused function.
|
|
|
|
static Expected<bool> isCoverageMappingDummy(uint64_t Hash, StringRef Mapping) {
|
|
|
|
// The hash value of dummy mapping records is always zero.
|
|
|
|
if (Hash)
|
|
|
|
return false;
|
|
|
|
return RawCoverageMappingDummyChecker(Mapping).isDummy();
|
|
|
|
}
|
2015-01-18 16:17:27 +00:00
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
namespace {
|
|
|
|
struct CovMapFuncRecordReader {
|
|
|
|
// The interface to read coverage mapping function records for a module.
|
|
|
|
//
|
|
|
|
// \p Buf points to the buffer containing the \c CovHeader of the coverage
|
|
|
|
// mapping data associated with the module.
|
|
|
|
//
|
|
|
|
// Returns a pointer to the next \c CovHeader if it exists, or a pointer
|
|
|
|
// greater than \p End if not.
|
|
|
|
virtual Expected<const char *> readFunctionRecords(const char *Buf,
|
|
|
|
const char *End) = 0;
|
|
|
|
virtual ~CovMapFuncRecordReader() {}
|
|
|
|
template <class IntPtrT, support::endianness Endian>
|
|
|
|
static Expected<std::unique_ptr<CovMapFuncRecordReader>>
|
|
|
|
get(coverage::CovMapVersion Version, InstrProfSymtab &P,
|
|
|
|
std::vector<BinaryCoverageReader::ProfileMappingRecord> &R,
|
|
|
|
std::vector<StringRef> &F);
|
|
|
|
};
|
|
|
|
|
|
|
|
// A class for reading coverage mapping function records for a module.
|
|
|
|
template <coverage::CovMapVersion Version, class IntPtrT,
|
|
|
|
support::endianness Endian>
|
|
|
|
class VersionedCovMapFuncRecordReader : public CovMapFuncRecordReader {
|
|
|
|
typedef typename coverage::CovMapTraits<
|
|
|
|
Version, IntPtrT>::CovMapFuncRecordType FuncRecordType;
|
|
|
|
typedef typename coverage::CovMapTraits<Version, IntPtrT>::NameRefType
|
|
|
|
NameRefType;
|
|
|
|
|
|
|
|
// Maps function's name references to the indexes of their records
|
|
|
|
// in \c Records.
|
|
|
|
llvm::DenseMap<NameRefType, size_t> FunctionRecords;
|
|
|
|
InstrProfSymtab &ProfileNames;
|
|
|
|
std::vector<StringRef> &Filenames;
|
|
|
|
std::vector<BinaryCoverageReader::ProfileMappingRecord> &Records;
|
|
|
|
|
|
|
|
// Add the record to the collection if we don't already have a record that
|
|
|
|
// points to the same function name. This is useful to ignore the redundant
|
|
|
|
// records for the functions with ODR linkage.
|
|
|
|
// In addition, prefer records with real coverage mapping data to dummy
|
|
|
|
// records, which were emitted for inline functions which were seen but
|
|
|
|
// not used in the corresponding translation unit.
|
|
|
|
Error insertFunctionRecordIfNeeded(const FuncRecordType *CFR,
|
|
|
|
StringRef Mapping, size_t FilenamesBegin) {
|
|
|
|
uint64_t FuncHash = CFR->template getFuncHash<Endian>();
|
|
|
|
NameRefType NameRef = CFR->template getFuncNameRef<Endian>();
|
|
|
|
auto InsertResult =
|
|
|
|
FunctionRecords.insert(std::make_pair(NameRef, Records.size()));
|
|
|
|
if (InsertResult.second) {
|
|
|
|
StringRef FuncName;
|
|
|
|
if (Error Err = CFR->template getFuncName<Endian>(ProfileNames, FuncName))
|
|
|
|
return Err;
|
|
|
|
Records.emplace_back(Version, FuncName, FuncHash, Mapping, FilenamesBegin,
|
|
|
|
Filenames.size() - FilenamesBegin);
|
|
|
|
return Error::success();
|
|
|
|
}
|
|
|
|
// Update the existing record if it's a dummy and the new record is real.
|
|
|
|
size_t OldRecordIndex = InsertResult.first->second;
|
|
|
|
BinaryCoverageReader::ProfileMappingRecord &OldRecord =
|
|
|
|
Records[OldRecordIndex];
|
|
|
|
Expected<bool> OldIsDummyExpected = isCoverageMappingDummy(
|
|
|
|
OldRecord.FunctionHash, OldRecord.CoverageMapping);
|
|
|
|
if (Error Err = OldIsDummyExpected.takeError())
|
|
|
|
return Err;
|
|
|
|
if (!*OldIsDummyExpected)
|
|
|
|
return Error::success();
|
|
|
|
Expected<bool> NewIsDummyExpected =
|
|
|
|
isCoverageMappingDummy(FuncHash, Mapping);
|
|
|
|
if (Error Err = NewIsDummyExpected.takeError())
|
|
|
|
return Err;
|
|
|
|
if (*NewIsDummyExpected)
|
|
|
|
return Error::success();
|
|
|
|
OldRecord.FunctionHash = FuncHash;
|
|
|
|
OldRecord.CoverageMapping = Mapping;
|
|
|
|
OldRecord.FilenamesBegin = FilenamesBegin;
|
|
|
|
OldRecord.FilenamesSize = Filenames.size() - FilenamesBegin;
|
|
|
|
return Error::success();
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
|
|
|
VersionedCovMapFuncRecordReader(
|
|
|
|
InstrProfSymtab &P,
|
|
|
|
std::vector<BinaryCoverageReader::ProfileMappingRecord> &R,
|
|
|
|
std::vector<StringRef> &F)
|
|
|
|
: ProfileNames(P), Filenames(F), Records(R) {}
|
|
|
|
~VersionedCovMapFuncRecordReader() override {}
|
|
|
|
|
|
|
|
Expected<const char *> readFunctionRecords(const char *Buf,
|
|
|
|
const char *End) override {
|
|
|
|
using namespace support;
|
2016-01-06 20:01:02 +00:00
|
|
|
if (Buf + sizeof(CovMapHeader) > End)
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::malformed);
|
2016-01-06 20:01:02 +00:00
|
|
|
auto CovHeader = reinterpret_cast<const coverage::CovMapHeader *>(Buf);
|
2016-01-13 19:58:01 +00:00
|
|
|
uint32_t NRecords = CovHeader->getNRecords<Endian>();
|
|
|
|
uint32_t FilenamesSize = CovHeader->getFilenamesSize<Endian>();
|
|
|
|
uint32_t CoverageSize = CovHeader->getCoverageSize<Endian>();
|
2016-07-23 20:41:05 +00:00
|
|
|
assert((CovMapVersion)CovHeader->getVersion<Endian>() == Version);
|
|
|
|
Buf = reinterpret_cast<const char *>(CovHeader + 1);
|
2015-01-18 16:17:27 +00:00
|
|
|
|
2015-05-27 18:44:32 +00:00
|
|
|
// Skip past the function records, saving the start and end for later.
|
|
|
|
const char *FunBuf = Buf;
|
2016-07-23 20:41:05 +00:00
|
|
|
Buf += NRecords * sizeof(FuncRecordType);
|
2015-05-27 18:44:32 +00:00
|
|
|
const char *FunEnd = Buf;
|
2015-01-18 16:17:27 +00:00
|
|
|
|
|
|
|
// Get the filenames.
|
2015-05-27 18:44:32 +00:00
|
|
|
if (Buf + FilenamesSize > End)
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::malformed);
|
2015-01-18 16:17:27 +00:00
|
|
|
size_t FilenamesBegin = Filenames.size();
|
2015-05-27 18:44:32 +00:00
|
|
|
RawCoverageFilenamesReader Reader(StringRef(Buf, FilenamesSize), Filenames);
|
2015-01-18 16:17:27 +00:00
|
|
|
if (auto Err = Reader.read())
|
2016-07-23 20:41:05 +00:00
|
|
|
return std::move(Err);
|
2015-05-27 18:44:32 +00:00
|
|
|
Buf += FilenamesSize;
|
|
|
|
|
|
|
|
// We'll read the coverage mapping records in the loop below.
|
|
|
|
const char *CovBuf = Buf;
|
|
|
|
Buf += CoverageSize;
|
|
|
|
const char *CovEnd = Buf;
|
2015-06-09 19:06:30 +00:00
|
|
|
|
2015-05-27 18:44:32 +00:00
|
|
|
if (Buf > End)
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::malformed);
|
2015-06-09 19:06:30 +00:00
|
|
|
// Each coverage map has an alignment of 8, so we need to adjust alignment
|
|
|
|
// before reading the next map.
|
|
|
|
Buf += alignmentAdjustment(Buf, 8);
|
2015-05-27 18:44:32 +00:00
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
auto CFR = reinterpret_cast<const FuncRecordType *>(FunBuf);
|
2015-12-30 11:46:15 +00:00
|
|
|
while ((const char *)CFR < FunEnd) {
|
2015-05-27 18:44:32 +00:00
|
|
|
// Read the function information
|
2016-01-13 19:58:01 +00:00
|
|
|
uint32_t DataSize = CFR->template getDataSize<Endian>();
|
2015-05-27 18:44:32 +00:00
|
|
|
|
|
|
|
// Now use that to read the coverage data.
|
|
|
|
if (CovBuf + DataSize > CovEnd)
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::malformed);
|
2015-05-27 18:44:32 +00:00
|
|
|
auto Mapping = StringRef(CovBuf, DataSize);
|
|
|
|
CovBuf += DataSize;
|
2015-01-18 16:17:27 +00:00
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
if (Error Err =
|
|
|
|
insertFunctionRecordIfNeeded(CFR, Mapping, FilenamesBegin))
|
|
|
|
return std::move(Err);
|
2016-01-13 19:58:01 +00:00
|
|
|
CFR++;
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
2016-07-23 20:41:05 +00:00
|
|
|
return Buf;
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
2016-07-23 20:41:05 +00:00
|
|
|
};
|
|
|
|
} // end anonymous namespace
|
|
|
|
|
|
|
|
template <class IntPtrT, support::endianness Endian>
|
|
|
|
Expected<std::unique_ptr<CovMapFuncRecordReader>> CovMapFuncRecordReader::get(
|
|
|
|
coverage::CovMapVersion Version, InstrProfSymtab &P,
|
|
|
|
std::vector<BinaryCoverageReader::ProfileMappingRecord> &R,
|
|
|
|
std::vector<StringRef> &F) {
|
|
|
|
using namespace coverage;
|
|
|
|
switch (Version) {
|
|
|
|
case CovMapVersion::Version1:
|
|
|
|
return llvm::make_unique<VersionedCovMapFuncRecordReader<
|
|
|
|
CovMapVersion::Version1, IntPtrT, Endian>>(P, R, F);
|
|
|
|
case CovMapVersion::Version2:
|
|
|
|
// Decompress the name data.
|
|
|
|
if (Error E = P.create(P.getNameData()))
|
|
|
|
return std::move(E);
|
|
|
|
return llvm::make_unique<VersionedCovMapFuncRecordReader<
|
|
|
|
CovMapVersion::Version2, IntPtrT, Endian>>(P, R, F);
|
|
|
|
}
|
|
|
|
llvm_unreachable("Unsupported version");
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
template <typename T, support::endianness Endian>
|
|
|
|
static Error readCoverageMappingData(
|
|
|
|
InstrProfSymtab &ProfileNames, StringRef Data,
|
|
|
|
std::vector<BinaryCoverageReader::ProfileMappingRecord> &Records,
|
|
|
|
std::vector<StringRef> &Filenames) {
|
|
|
|
using namespace coverage;
|
|
|
|
// Read the records in the coverage data section.
|
|
|
|
auto CovHeader =
|
|
|
|
reinterpret_cast<const coverage::CovMapHeader *>(Data.data());
|
|
|
|
CovMapVersion Version = (CovMapVersion)CovHeader->getVersion<Endian>();
|
|
|
|
if (Version > coverage::CovMapVersion::CurrentVersion)
|
|
|
|
return make_error<CoverageMapError>(coveragemap_error::unsupported_version);
|
|
|
|
Expected<std::unique_ptr<CovMapFuncRecordReader>> ReaderExpected =
|
|
|
|
CovMapFuncRecordReader::get<T, Endian>(Version, ProfileNames, Records,
|
|
|
|
Filenames);
|
|
|
|
if (Error E = ReaderExpected.takeError())
|
|
|
|
return E;
|
|
|
|
auto Reader = std::move(ReaderExpected.get());
|
|
|
|
for (const char *Buf = Data.data(), *End = Buf + Data.size(); Buf < End;) {
|
|
|
|
auto NextHeaderOrErr = Reader->readFunctionRecords(Buf, End);
|
|
|
|
if (auto E = NextHeaderOrErr.takeError())
|
|
|
|
return E;
|
|
|
|
Buf = NextHeaderOrErr.get();
|
|
|
|
}
|
|
|
|
return Error::success();
|
|
|
|
}
|
2015-01-18 16:17:27 +00:00
|
|
|
static const char *TestingFormatMagic = "llvmcovmtestdata";
|
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
static Error loadTestingFormat(StringRef Data, InstrProfSymtab &ProfileNames,
|
|
|
|
StringRef &CoverageMapping,
|
|
|
|
uint8_t &BytesInAddress,
|
|
|
|
support::endianness &Endian) {
|
2015-05-27 18:44:32 +00:00
|
|
|
BytesInAddress = 8;
|
|
|
|
Endian = support::endianness::little;
|
|
|
|
|
2015-01-18 16:17:27 +00:00
|
|
|
Data = Data.substr(StringRef(TestingFormatMagic).size());
|
|
|
|
if (Data.size() < 1)
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::truncated);
|
2015-01-18 16:17:27 +00:00
|
|
|
unsigned N = 0;
|
|
|
|
auto ProfileNamesSize =
|
|
|
|
decodeULEB128(reinterpret_cast<const uint8_t *>(Data.data()), &N);
|
|
|
|
if (N > Data.size())
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::malformed);
|
2015-01-18 16:17:27 +00:00
|
|
|
Data = Data.substr(N);
|
|
|
|
if (Data.size() < 1)
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::truncated);
|
2015-01-18 16:17:27 +00:00
|
|
|
N = 0;
|
2015-12-30 11:46:15 +00:00
|
|
|
uint64_t Address =
|
2015-01-18 16:17:27 +00:00
|
|
|
decodeULEB128(reinterpret_cast<const uint8_t *>(Data.data()), &N);
|
|
|
|
if (N > Data.size())
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::malformed);
|
2015-01-18 16:17:27 +00:00
|
|
|
Data = Data.substr(N);
|
|
|
|
if (Data.size() < ProfileNamesSize)
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::malformed);
|
|
|
|
if (Error E = ProfileNames.create(Data.substr(0, ProfileNamesSize), Address))
|
|
|
|
return E;
|
2015-01-18 16:17:27 +00:00
|
|
|
CoverageMapping = Data.substr(ProfileNamesSize);
|
2016-07-23 20:41:05 +00:00
|
|
|
// Skip the padding bytes because coverage map data has an alignment of 8.
|
|
|
|
if (CoverageMapping.size() < 1)
|
|
|
|
return make_error<CoverageMapError>(coveragemap_error::truncated);
|
|
|
|
size_t Pad = alignmentAdjustment(CoverageMapping.data(), 8);
|
|
|
|
if (CoverageMapping.size() < Pad)
|
|
|
|
return make_error<CoverageMapError>(coveragemap_error::malformed);
|
|
|
|
CoverageMapping = CoverageMapping.substr(Pad);
|
|
|
|
return Error::success();
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
static Expected<SectionRef> lookupSection(ObjectFile &OF, StringRef Name) {
|
2015-05-27 18:44:32 +00:00
|
|
|
StringRef FoundName;
|
|
|
|
for (const auto &Section : OF.sections()) {
|
|
|
|
if (auto EC = Section.getName(FoundName))
|
2016-07-23 20:41:05 +00:00
|
|
|
return errorCodeToError(EC);
|
2015-05-27 18:44:32 +00:00
|
|
|
if (FoundName == Name)
|
|
|
|
return Section;
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::no_data_found);
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
static Error loadBinaryFormat(MemoryBufferRef ObjectBuffer,
|
|
|
|
InstrProfSymtab &ProfileNames,
|
|
|
|
StringRef &CoverageMapping,
|
|
|
|
uint8_t &BytesInAddress,
|
|
|
|
support::endianness &Endian, StringRef Arch) {
|
2015-05-27 18:44:32 +00:00
|
|
|
auto BinOrErr = object::createBinary(ObjectBuffer);
|
2016-07-23 20:41:05 +00:00
|
|
|
if (!BinOrErr)
|
|
|
|
return BinOrErr.takeError();
|
2015-05-27 18:44:32 +00:00
|
|
|
auto Bin = std::move(BinOrErr.get());
|
|
|
|
std::unique_ptr<ObjectFile> OF;
|
|
|
|
if (auto *Universal = dyn_cast<object::MachOUniversalBinary>(Bin.get())) {
|
|
|
|
// If we have a universal binary, try to look up the object for the
|
|
|
|
// appropriate architecture.
|
|
|
|
auto ObjectFileOrErr = Universal->getObjectForArch(Arch);
|
2016-07-23 20:41:05 +00:00
|
|
|
if (!ObjectFileOrErr)
|
|
|
|
return ObjectFileOrErr.takeError();
|
2015-05-27 18:44:32 +00:00
|
|
|
OF = std::move(ObjectFileOrErr.get());
|
|
|
|
} else if (isa<object::ObjectFile>(Bin.get())) {
|
|
|
|
// For any other object file, upcast and take ownership.
|
|
|
|
OF.reset(cast<object::ObjectFile>(Bin.release()));
|
|
|
|
// If we've asked for a particular arch, make sure they match.
|
2015-07-05 14:21:36 +00:00
|
|
|
if (!Arch.empty() && OF->getArch() != Triple(Arch).getArch())
|
2016-07-23 20:41:05 +00:00
|
|
|
return errorCodeToError(object_error::arch_not_found);
|
2015-05-27 18:44:32 +00:00
|
|
|
} else
|
|
|
|
// We can only handle object files.
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::malformed);
|
2015-05-27 18:44:32 +00:00
|
|
|
|
|
|
|
// The coverage uses native pointer sizes for the object it's written in.
|
|
|
|
BytesInAddress = OF->getBytesInAddress();
|
|
|
|
Endian = OF->isLittleEndian() ? support::endianness::little
|
|
|
|
: support::endianness::big;
|
2015-01-18 16:17:27 +00:00
|
|
|
|
|
|
|
// Look for the sections that we are interested in.
|
2015-12-30 11:46:15 +00:00
|
|
|
auto NamesSection = lookupSection(*OF, getInstrProfNameSectionName(false));
|
2016-07-23 20:41:05 +00:00
|
|
|
if (auto E = NamesSection.takeError())
|
|
|
|
return E;
|
2015-12-30 11:46:15 +00:00
|
|
|
auto CoverageSection =
|
|
|
|
lookupSection(*OF, getInstrProfCoverageSectionName(false));
|
2016-07-23 20:41:05 +00:00
|
|
|
if (auto E = CoverageSection.takeError())
|
|
|
|
return E;
|
2015-01-18 16:17:27 +00:00
|
|
|
|
|
|
|
// Get the contents of the given sections.
|
2016-07-23 20:41:05 +00:00
|
|
|
if (auto EC = CoverageSection->getContents(CoverageMapping))
|
|
|
|
return errorCodeToError(EC);
|
|
|
|
if (Error E = ProfileNames.create(*NamesSection))
|
|
|
|
return E;
|
2015-01-18 16:17:27 +00:00
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
return Error::success();
|
2015-05-27 18:44:32 +00:00
|
|
|
}
|
2015-01-18 16:17:27 +00:00
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
Expected<std::unique_ptr<BinaryCoverageReader>>
|
2015-05-27 18:44:32 +00:00
|
|
|
BinaryCoverageReader::create(std::unique_ptr<MemoryBuffer> &ObjectBuffer,
|
2015-07-05 14:21:36 +00:00
|
|
|
StringRef Arch) {
|
2015-05-27 18:44:32 +00:00
|
|
|
std::unique_ptr<BinaryCoverageReader> Reader(new BinaryCoverageReader());
|
|
|
|
|
|
|
|
StringRef Coverage;
|
|
|
|
uint8_t BytesInAddress;
|
|
|
|
support::endianness Endian;
|
2017-01-02 19:17:04 +00:00
|
|
|
Error E = Error::success();
|
2016-07-23 20:41:05 +00:00
|
|
|
consumeError(std::move(E));
|
2015-05-27 18:44:32 +00:00
|
|
|
if (ObjectBuffer->getBuffer().startswith(TestingFormatMagic))
|
|
|
|
// This is a special format used for testing.
|
2016-07-23 20:41:05 +00:00
|
|
|
E = loadTestingFormat(ObjectBuffer->getBuffer(), Reader->ProfileNames,
|
|
|
|
Coverage, BytesInAddress, Endian);
|
2015-05-27 18:44:32 +00:00
|
|
|
else
|
2016-07-23 20:41:05 +00:00
|
|
|
E = loadBinaryFormat(ObjectBuffer->getMemBufferRef(), Reader->ProfileNames,
|
|
|
|
Coverage, BytesInAddress, Endian, Arch);
|
|
|
|
if (E)
|
|
|
|
return std::move(E);
|
2015-05-27 18:44:32 +00:00
|
|
|
|
|
|
|
if (BytesInAddress == 4 && Endian == support::endianness::little)
|
2016-07-23 20:41:05 +00:00
|
|
|
E = readCoverageMappingData<uint32_t, support::endianness::little>(
|
|
|
|
Reader->ProfileNames, Coverage, Reader->MappingRecords,
|
|
|
|
Reader->Filenames);
|
2015-05-27 18:44:32 +00:00
|
|
|
else if (BytesInAddress == 4 && Endian == support::endianness::big)
|
2016-07-23 20:41:05 +00:00
|
|
|
E = readCoverageMappingData<uint32_t, support::endianness::big>(
|
|
|
|
Reader->ProfileNames, Coverage, Reader->MappingRecords,
|
|
|
|
Reader->Filenames);
|
2015-05-27 18:44:32 +00:00
|
|
|
else if (BytesInAddress == 8 && Endian == support::endianness::little)
|
2016-07-23 20:41:05 +00:00
|
|
|
E = readCoverageMappingData<uint64_t, support::endianness::little>(
|
|
|
|
Reader->ProfileNames, Coverage, Reader->MappingRecords,
|
|
|
|
Reader->Filenames);
|
2015-05-27 18:44:32 +00:00
|
|
|
else if (BytesInAddress == 8 && Endian == support::endianness::big)
|
2016-07-23 20:41:05 +00:00
|
|
|
E = readCoverageMappingData<uint64_t, support::endianness::big>(
|
|
|
|
Reader->ProfileNames, Coverage, Reader->MappingRecords,
|
|
|
|
Reader->Filenames);
|
2015-05-27 18:44:32 +00:00
|
|
|
else
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::malformed);
|
|
|
|
if (E)
|
|
|
|
return std::move(E);
|
2015-05-27 18:44:32 +00:00
|
|
|
return std::move(Reader);
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|
|
|
|
|
2016-07-23 20:41:05 +00:00
|
|
|
Error BinaryCoverageReader::readNextRecord(CoverageMappingRecord &Record) {
|
2015-01-18 16:17:27 +00:00
|
|
|
if (CurrentRecord >= MappingRecords.size())
|
2016-07-23 20:41:05 +00:00
|
|
|
return make_error<CoverageMapError>(coveragemap_error::eof);
|
2015-01-18 16:17:27 +00:00
|
|
|
|
|
|
|
FunctionsFilenames.clear();
|
|
|
|
Expressions.clear();
|
|
|
|
MappingRegions.clear();
|
|
|
|
auto &R = MappingRecords[CurrentRecord];
|
|
|
|
RawCoverageMappingReader Reader(
|
2015-05-27 18:44:32 +00:00
|
|
|
R.CoverageMapping,
|
|
|
|
makeArrayRef(Filenames).slice(R.FilenamesBegin, R.FilenamesSize),
|
2015-01-18 16:17:27 +00:00
|
|
|
FunctionsFilenames, Expressions, MappingRegions);
|
2015-05-27 18:44:32 +00:00
|
|
|
if (auto Err = Reader.read())
|
2015-01-18 16:17:27 +00:00
|
|
|
return Err;
|
2015-05-27 18:44:32 +00:00
|
|
|
|
|
|
|
Record.FunctionName = R.FunctionName;
|
2015-01-18 16:17:27 +00:00
|
|
|
Record.FunctionHash = R.FunctionHash;
|
2015-05-27 18:44:32 +00:00
|
|
|
Record.Filenames = FunctionsFilenames;
|
|
|
|
Record.Expressions = Expressions;
|
|
|
|
Record.MappingRegions = MappingRegions;
|
|
|
|
|
2015-01-18 16:17:27 +00:00
|
|
|
++CurrentRecord;
|
2016-07-23 20:41:05 +00:00
|
|
|
return Error::success();
|
2015-01-18 16:17:27 +00:00
|
|
|
}
|