[llvm] r252829 - Fix problems in coding style
Xinliang David Li via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 11 16:32:18 PST 2015
Author: davidxl
Date: Wed Nov 11 18:32:17 2015
New Revision: 252829
URL: http://llvm.org/viewvc/llvm-project?rev=252829&view=rev
Log:
Fix problems in coding style
Modified:
llvm/trunk/lib/ProfileData/InstrProfReader.cpp
Modified: llvm/trunk/lib/ProfileData/InstrProfReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProfReader.cpp?rev=252829&r1=252828&r2=252829&view=diff
==============================================================================
--- llvm/trunk/lib/ProfileData/InstrProfReader.cpp (original)
+++ llvm/trunk/lib/ProfileData/InstrProfReader.cpp Wed Nov 11 18:32:17 2015
@@ -264,19 +264,23 @@ std::error_code RawInstrProfReader<IntPt
}
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
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 un
}
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::getInstrProfReco
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::
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()) {
More information about the llvm-commits
mailing list