[llvm] r252276 - Code style fix (caused by wrongly default clang-format style) (NFC)
Xinliang David Li via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 5 23:54:21 PST 2015
Author: davidxl
Date: Fri Nov 6 01:54:21 2015
New Revision: 252276
URL: http://llvm.org/viewvc/llvm-project?rev=252276&view=rev
Log:
Code style fix (caused by wrongly default clang-format style) (NFC)
Modified:
llvm/trunk/include/llvm/ProfileData/InstrProf.h
llvm/trunk/lib/ProfileData/InstrProfReader.cpp
llvm/trunk/lib/ProfileData/InstrProfWriter.cpp
Modified: llvm/trunk/include/llvm/ProfileData/InstrProf.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/InstrProf.h?rev=252276&r1=252275&r2=252276&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ProfileData/InstrProf.h (original)
+++ llvm/trunk/include/llvm/ProfileData/InstrProf.h Fri Nov 6 01:54:21 2015
@@ -191,7 +191,8 @@ struct InstrProfValueSiteRecord {
auto IE = ValueData.end();
for (auto J = Input.ValueData.begin(), JE = Input.ValueData.end(); J != JE;
++J) {
- while (I != IE && I->Value < J->Value) ++I;
+ while (I != IE && I->Value < J->Value)
+ ++I;
if (I != IE && I->Value == J->Value) {
I->Count += J->Count;
++I;
@@ -224,8 +225,8 @@ struct InstrProfRecord {
/// site: Site.
inline uint32_t getNumValueDataForSite(uint32_t ValueKind,
uint32_t Site) const;
- inline std::unique_ptr<InstrProfValueData[]> getValueForSite(
- uint32_t ValueKind, uint32_t Site) const;
+ inline std::unique_ptr<InstrProfValueData[]>
+ getValueForSite(uint32_t ValueKind, uint32_t Site) const;
/// Reserve space for NumValueSites sites.
inline void reserveSites(uint32_t ValueKind, uint32_t NumValueSites);
/// Add ValueData for ValueKind at value Site.
@@ -240,7 +241,7 @@ struct InstrProfRecord {
/// the writer instance.
inline void updateStrings(InstrProfStringTable *StrTab);
- private:
+private:
std::vector<InstrProfValueSiteRecord> IndirectCallSites;
const std::vector<InstrProfValueSiteRecord> &
getValueSitesForKind(uint32_t ValueKind) const {
@@ -262,18 +263,19 @@ struct InstrProfRecord {
// Map indirect call target name hash to name string.
uint64_t remapValue(uint64_t Value, uint32_t ValueKind,
ValueMapType *HashKeys) {
- if (!HashKeys) return Value;
+ if (!HashKeys)
+ return Value;
switch (ValueKind) {
- case IPVK_IndirectCallTarget: {
- auto Result =
- std::lower_bound(HashKeys->begin(), HashKeys->end(), Value,
- [](const std::pair<uint64_t, const char *> &LHS,
- uint64_t RHS) { return LHS.first < RHS; });
- assert(Result != HashKeys->end() &&
- "Hash does not match any known keys\n");
- Value = (uint64_t)Result->second;
- break;
- }
+ case IPVK_IndirectCallTarget: {
+ auto Result =
+ std::lower_bound(HashKeys->begin(), HashKeys->end(), Value,
+ [](const std::pair<uint64_t, const char *> &LHS,
+ uint64_t RHS) { return LHS.first < RHS; });
+ assert(Result != HashKeys->end() &&
+ "Hash does not match any known keys\n");
+ Value = (uint64_t)Result->second;
+ break;
+ }
}
return Value;
}
@@ -295,10 +297,11 @@ uint32_t InstrProfRecord::getNumValueDat
return getValueSitesForKind(ValueKind)[Site].ValueData.size();
}
-std::unique_ptr<InstrProfValueData[]> InstrProfRecord::getValueForSite(
- uint32_t ValueKind, uint32_t Site) const {
+std::unique_ptr<InstrProfValueData[]>
+InstrProfRecord::getValueForSite(uint32_t ValueKind, uint32_t Site) const {
uint32_t N = getNumValueDataForSite(ValueKind, Site);
- if (N == 0) return std::unique_ptr<InstrProfValueData[]>(nullptr);
+ if (N == 0)
+ return std::unique_ptr<InstrProfValueData[]>(nullptr);
std::unique_ptr<InstrProfValueData[]> VD(new InstrProfValueData[N]);
uint32_t I = 0;
@@ -347,7 +350,8 @@ instrprof_error InstrProfRecord::mergeVa
}
void InstrProfRecord::updateStrings(InstrProfStringTable *StrTab) {
- if (!StrTab) return;
+ if (!StrTab)
+ return;
Name = StrTab->insertString(Name);
for (auto &VSite : IndirectCallSites)
@@ -429,8 +433,7 @@ inline uint64_t getMagic<uint32_t>() {
// It should also match the synthesized type in
// Transforms/Instrumentation/InstrProfiling.cpp:getOrCreateRegionCounters.
-template <class IntPtrT>
-struct ProfileData {
+template <class IntPtrT> struct ProfileData {
#define INSTR_PROF_DATA(Type, LLVMType, Name, Init) Type Name;
#include "llvm/ProfileData/InstrProfData.inc"
};
@@ -454,8 +457,7 @@ struct Header {
namespace coverage {
LLVM_PACKED_START
-template <class IntPtrT>
-struct CovMapFunctionRecord {
+template <class IntPtrT> struct CovMapFunctionRecord {
#define COVMAP_FUNC_RECORD(Type, LLVMType, Name, Init) Type Name;
#include "llvm/ProfileData/InstrProfData.inc"
};
Modified: llvm/trunk/lib/ProfileData/InstrProfReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProfReader.cpp?rev=252276&r1=252275&r2=252276&view=diff
==============================================================================
--- llvm/trunk/lib/ProfileData/InstrProfReader.cpp (original)
+++ llvm/trunk/lib/ProfileData/InstrProfReader.cpp Fri Nov 6 01:54:21 2015
@@ -483,8 +483,9 @@ std::error_code IndexedInstrProfReader::
return success();
}
-ErrorOr<InstrProfRecord> IndexedInstrProfReader::getInstrProfRecord(
- StringRef FuncName, uint64_t FuncHash) {
+ErrorOr<InstrProfRecord>
+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;
@@ -498,10 +499,12 @@ ErrorOr<InstrProfRecord> IndexedInstrPro
return error(instrprof_error::hash_mismatch);
}
-std::error_code IndexedInstrProfReader::getFunctionCounts(
- StringRef FuncName, uint64_t FuncHash, std::vector<uint64_t> &Counts) {
+std::error_code
+IndexedInstrProfReader::getFunctionCounts(StringRef FuncName, uint64_t FuncHash,
+ std::vector<uint64_t> &Counts) {
ErrorOr<InstrProfRecord> Record = getInstrProfRecord(FuncName, FuncHash);
- if (std::error_code EC = Record.getError()) return EC;
+ if (std::error_code EC = Record.getError())
+ return EC;
Counts = Record.get().Counts;
return success();
Modified: llvm/trunk/lib/ProfileData/InstrProfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProfWriter.cpp?rev=252276&r1=252275&r2=252276&view=diff
==============================================================================
--- llvm/trunk/lib/ProfileData/InstrProfWriter.cpp (original)
+++ llvm/trunk/lib/ProfileData/InstrProfWriter.cpp Fri Nov 6 01:54:21 2015
@@ -54,14 +54,15 @@ public:
M += sizeof(uint64_t); // Number of value kinds with value sites.
for (uint32_t Kind = IPVK_First; Kind <= IPVK_Last; ++Kind) {
uint32_t NumValueSites = ProfRecord.getNumValueSites(Kind);
- if (NumValueSites == 0) continue;
+ if (NumValueSites == 0)
+ continue;
M += sizeof(uint64_t); // Value kind
M += sizeof(uint64_t); // The number of value sites for given value kind
for (uint32_t I = 0; I < NumValueSites; I++) {
M += sizeof(uint64_t); // Number of value data pairs at a value site
uint64_t NumValueDataForSite =
ProfRecord.getNumValueDataForSite(Kind, I);
- M += 2 * sizeof(uint64_t) * NumValueDataForSite; // Value data pairs
+ M += 2 * sizeof(uint64_t) * NumValueDataForSite; // Value data pairs
}
}
}
@@ -83,7 +84,8 @@ public:
LE.write<uint64_t>(ProfileData.first); // Function hash
LE.write<uint64_t>(ProfRecord.Counts.size());
- for (uint64_t I : ProfRecord.Counts) LE.write<uint64_t>(I);
+ for (uint64_t I : ProfRecord.Counts)
+ LE.write<uint64_t>(I);
// Compute the number of value kinds with value sites.
uint64_t NumValueKinds = ProfRecord.getNumValueKinds();
@@ -92,7 +94,8 @@ public:
// Write value data
for (uint32_t Kind = IPVK_First; Kind <= IPVK_Last; ++Kind) {
uint32_t NumValueSites = ProfRecord.getNumValueSites(Kind);
- if (NumValueSites == 0) continue;
+ if (NumValueSites == 0)
+ continue;
LE.write<uint64_t>(Kind); // Write value kind
// Write number of value sites for current value kind
LE.write<uint64_t>(NumValueSites);
@@ -134,7 +137,8 @@ static std::error_code combineInstrProfR
}
for (uint32_t Kind = IPVK_First; Kind <= IPVK_Last; ++Kind) {
- if (std::error_code EC = Dest.mergeValueProfData(Kind, Source)) return EC;
+ if (std::error_code EC = Dest.mergeValueProfData(Kind, Source))
+ return EC;
}
// We keep track of the max function count as we go for simplicity.
More information about the llvm-commits
mailing list