aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData/InstrProfReader.cpp
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2015-11-12 00:32:17 +0000
committerXinliang David Li <davidxl@google.com>2015-11-12 00:32:17 +0000
commit4c3ab815eaead7abaaf3b1895ecef383f4982a99 (patch)
tree94829a5063f36664921bf49a44ab95767e8767be /llvm/lib/ProfileData/InstrProfReader.cpp
parent5eeeab7dcf1b338061e59d064b2fc65105a83a0d (diff)
downloadllvm-4c3ab815eaead7abaaf3b1895ecef383f4982a99.zip
llvm-4c3ab815eaead7abaaf3b1895ecef383f4982a99.tar.gz
llvm-4c3ab815eaead7abaaf3b1895ecef383f4982a99.tar.bz2
Fix problems in coding style
llvm-svn: 252829
Diffstat (limited to 'llvm/lib/ProfileData/InstrProfReader.cpp')
-rw-r--r--llvm/lib/ProfileData/InstrProfReader.cpp36
1 files changed, 23 insertions, 13 deletions
diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp
index b968e6b..bf10b44 100644
--- a/llvm/lib/ProfileData/InstrProfReader.cpp
+++ b/llvm/lib/ProfileData/InstrProfReader.cpp
@@ -264,19 +264,23 @@ std::error_code RawInstrProfReader<IntPtrT>::readRawCounts(
}
template <class IntPtrT>
-std::error_code RawInstrProfReader<IntPtrT>::readNextRecord(
- InstrProfRecord &Record) {
+std::error_code
+RawInstrProfReader<IntPtrT>::readNextRecord(InstrProfRecord &Record) {
if (atEnd())
- if (std::error_code EC = readNextHeader(ProfileEnd)) return EC;
+ if (std::error_code EC = readNextHeader(ProfileEnd))
+ return EC;
// Read name ad set it in Record.
- if (std::error_code EC = readName(Record)) return EC;
+ if (std::error_code EC = readName(Record))
+ return EC;
// Read FuncHash and set it in Record.
- if (std::error_code EC = readFuncHash(Record)) return EC;
+ if (std::error_code EC = readFuncHash(Record))
+ return EC;
// Read raw counts and set Record.
- if (std::error_code EC = readRawCounts(Record)) return EC;
+ if (std::error_code EC = readRawCounts(Record))
+ return EC;
// Iterate.
advanceData();
@@ -356,13 +360,16 @@ data_type InstrProfLookupTrait::ReadData(StringRef K, const unsigned char *D,
return DataBuffer;
}
-std::error_code InstrProfReaderIndex::getRecords(
- StringRef FuncName, ArrayRef<InstrProfRecord> &Data) {
+std::error_code
+InstrProfReaderIndex::getRecords(StringRef FuncName,
+ ArrayRef<InstrProfRecord> &Data) {
auto Iter = Index->find(FuncName);
- if (Iter == Index->end()) return instrprof_error::unknown_function;
+ if (Iter == Index->end())
+ return instrprof_error::unknown_function;
Data = (*Iter);
- if (Data.empty()) return instrprof_error::malformed;
+ if (Data.empty())
+ return instrprof_error::malformed;
return instrprof_error::success;
}
@@ -400,7 +407,8 @@ void InstrProfReaderIndex::Init(const unsigned char *Buckets,
}
bool IndexedInstrProfReader::hasFormat(const MemoryBuffer &DataBuffer) {
- if (DataBuffer.getBufferSize() < 8) return false;
+ if (DataBuffer.getBufferSize() < 8)
+ return false;
using namespace support;
uint64_t Magic =
endian::read<uint64_t, little, aligned>(DataBuffer.getBufferStart());
@@ -453,7 +461,8 @@ IndexedInstrProfReader::getInstrProfRecord(StringRef FuncName,
uint64_t FuncHash) {
ArrayRef<InstrProfRecord> Data;
std::error_code EC = Index.getRecords(FuncName, Data);
- if (EC != instrprof_error::success) return EC;
+ if (EC != instrprof_error::success)
+ return EC;
// Found it. Look for counters with the right hash.
for (unsigned I = 0, E = Data.size(); I < E; ++I) {
// Check for a match and fill the vector if there is one.
@@ -482,7 +491,8 @@ std::error_code IndexedInstrProfReader::readNextRecord(
ArrayRef<InstrProfRecord> Data;
std::error_code EC = Index.getRecords(Data);
- if (EC != instrprof_error::success) return error(EC);
+ if (EC != instrprof_error::success)
+ return error(EC);
Record = Data[RecordIndex++];
if (RecordIndex >= Data.size()) {