Skip to content

Commit d3ce321

Browse files
committed
[llvm] clang-format changes to ProfileData library
1 parent fa71ef6 commit d3ce321

26 files changed

+165
-128
lines changed

llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,8 @@ class TVIdxBuilder {
665665
/// \param NextIDs The list of {FalseID, TrueID} indexed by ID
666666
/// The first element [0] should be the root node.
667667
/// \param Offset Offset of index to final decisions.
668-
LLVM_ABI TVIdxBuilder(const SmallVectorImpl<ConditionIDs> &NextIDs, int Offset = 0);
668+
LLVM_ABI TVIdxBuilder(const SmallVectorImpl<ConditionIDs> &NextIDs,
669+
int Offset = 0);
669670
};
670671
} // namespace mcdc
671672

@@ -1055,10 +1056,12 @@ class CoverageMapping {
10551056
LLVM_ABI CoverageData getCoverageForFile(StringRef Filename) const;
10561057

10571058
/// Get the coverage for a particular function.
1058-
LLVM_ABI CoverageData getCoverageForFunction(const FunctionRecord &Function) const;
1059+
LLVM_ABI CoverageData
1060+
getCoverageForFunction(const FunctionRecord &Function) const;
10591061

10601062
/// Get the coverage for an expansion within a coverage set.
1061-
LLVM_ABI CoverageData getCoverageForExpansion(const ExpansionRecord &Expansion) const;
1063+
LLVM_ABI CoverageData
1064+
getCoverageForExpansion(const ExpansionRecord &Expansion) const;
10621065

10631066
/// Gets all of the functions covered by this profile.
10641067
iterator_range<FunctionRecordIterator> getCoveredFunctions() const {
@@ -1097,7 +1100,8 @@ class LineCoverageStats {
10971100

10981101
public:
10991102
LLVM_ABI LineCoverageStats(ArrayRef<const CoverageSegment *> LineSegments,
1100-
const CoverageSegment *WrappedSegment, unsigned Line);
1103+
const CoverageSegment *WrappedSegment,
1104+
unsigned Line);
11011105

11021106
uint64_t getExecutionCount() const { return ExecutionCount; }
11031107

llvm/include/llvm/ProfileData/Coverage/CoverageMappingReader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
#ifndef LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPINGREADER_H
1515
#define LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPINGREADER_H
1616

17-
#include "llvm/Support/Compiler.h"
1817
#include "llvm/ADT/ArrayRef.h"
1918
#include "llvm/ADT/StringRef.h"
2019
#include "llvm/ProfileData/Coverage/CoverageMapping.h"
2120
#include "llvm/ProfileData/InstrProf.h"
21+
#include "llvm/Support/Compiler.h"
2222
#include "llvm/Support/Error.h"
2323
#include "llvm/Support/MemoryBuffer.h"
2424
#include <cstddef>

llvm/include/llvm/ProfileData/Coverage/CoverageMappingWriter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
#ifndef LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPINGWRITER_H
1515
#define LLVM_PROFILEDATA_COVERAGE_COVERAGEMAPPINGWRITER_H
1616

17-
#include "llvm/Support/Compiler.h"
1817
#include "llvm/ADT/ArrayRef.h"
1918
#include "llvm/ADT/StringRef.h"
2019
#include "llvm/ProfileData/Coverage/CoverageMapping.h"
20+
#include "llvm/Support/Compiler.h"
2121

2222
namespace llvm {
2323

llvm/include/llvm/ProfileData/DataAccessProf.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
#ifndef LLVM_PROFILEDATA_DATAACCESSPROF_H_
1818
#define LLVM_PROFILEDATA_DATAACCESSPROF_H_
1919

20-
#include "llvm/Support/Compiler.h"
2120
#include "llvm/ADT/DenseMapInfoVariant.h"
2221
#include "llvm/ADT/MapVector.h"
2322
#include "llvm/ADT/SetVector.h"
2423
#include "llvm/ADT/SmallVector.h"
2524
#include "llvm/ADT/StringRef.h"
2625
#include "llvm/ProfileData/InstrProf.h"
2726
#include "llvm/Support/Allocator.h"
27+
#include "llvm/Support/Compiler.h"
2828
#include "llvm/Support/Error.h"
2929
#include "llvm/Support/StringSaver.h"
3030

@@ -157,13 +157,15 @@ class DataAccessProfData {
157157
/// duplicated symbol names or content hashes are seen. The user of this
158158
/// class should aggregate counters that correspond to the same symbol name
159159
/// or with the same string literal hash before calling 'set*' methods.
160-
LLVM_ABI Error setDataAccessProfile(SymbolHandleRef SymbolID, uint64_t AccessCount);
160+
LLVM_ABI Error setDataAccessProfile(SymbolHandleRef SymbolID,
161+
uint64_t AccessCount);
161162
/// Similar to the method above, for records with \p Locations representing
162163
/// the `filename:line` where this symbol shows up. Note because of linker's
163164
/// merge of identical symbols (e.g., unnamed_addr string literals), one
164165
/// symbol is likely to have multiple locations.
165-
LLVM_ABI Error setDataAccessProfile(SymbolHandleRef SymbolID, uint64_t AccessCount,
166-
ArrayRef<SourceLocation> Locations);
166+
LLVM_ABI Error setDataAccessProfile(SymbolHandleRef SymbolID,
167+
uint64_t AccessCount,
168+
ArrayRef<SourceLocation> Locations);
167169
/// Add a symbol that's seen in the profiled binary without samples.
168170
LLVM_ABI Error addKnownSymbolWithoutSamples(SymbolHandleRef SymbolID);
169171

llvm/include/llvm/ProfileData/GCOV.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
#ifndef LLVM_PROFILEDATA_GCOV_H
1515
#define LLVM_PROFILEDATA_GCOV_H
1616

17-
#include "llvm/Support/Compiler.h"
1817
#include "llvm/ADT/DenseSet.h"
1918
#include "llvm/ADT/SmallString.h"
2019
#include "llvm/ADT/SmallVector.h"
2120
#include "llvm/ADT/StringMap.h"
2221
#include "llvm/ADT/StringRef.h"
2322
#include "llvm/ADT/iterator.h"
2423
#include "llvm/ADT/iterator_range.h"
24+
#include "llvm/Support/Compiler.h"
2525
#include "llvm/Support/DataExtractor.h"
2626
#include "llvm/Support/MemoryBuffer.h"
2727
#include "llvm/Support/raw_ostream.h"
@@ -317,7 +317,7 @@ class GCOVBlock {
317317
};
318318

319319
LLVM_ABI void gcovOneInput(const GCOV::Options &options, StringRef filename,
320-
StringRef gcno, StringRef gcda, GCOVFile &file);
320+
StringRef gcno, StringRef gcda, GCOVFile &file);
321321

322322
} // end namespace llvm
323323

llvm/include/llvm/ProfileData/IndexedMemProfData.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
#ifndef LLVM_PROFILEDATA_INDEXEDMEMPROFDATA_H
1616
#define LLVM_PROFILEDATA_INDEXEDMEMPROFDATA_H
1717

18-
#include "llvm/Support/Compiler.h"
1918
#include "llvm/ProfileData/DataAccessProf.h"
2019
#include "llvm/ProfileData/InstrProf.h"
2120
#include "llvm/ProfileData/MemProf.h"
21+
#include "llvm/Support/Compiler.h"
2222

2323
#include <functional>
2424
#include <optional>

llvm/include/llvm/ProfileData/InstrProf.h

Lines changed: 52 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ inline uint64_t getInstrMaxCountValue() {
105105
/// \p AddSegmentInfo is true, a segment prefix and additional linker hints may
106106
/// be added to the section name (this is the default).
107107
LLVM_ABI std::string getInstrProfSectionName(InstrProfSectKind IPSK,
108-
Triple::ObjectFormatType OF,
109-
bool AddSegmentInfo = true);
108+
Triple::ObjectFormatType OF,
109+
bool AddSegmentInfo = true);
110110

111111
/// Return the name profile runtime entry point to do value profiling
112112
/// for a given site.
@@ -222,17 +222,17 @@ LLVM_ABI bool isGPUProfTarget(const Module &M);
222222
/// Return the modified name for function \c F suitable to be
223223
/// used the key for profile lookup. Variable \c InLTO indicates if this
224224
/// is called in LTO optimization passes.
225-
LLVM_ABI std::string getPGOFuncName(const Function &F, bool InLTO = false,
226-
uint64_t Version = INSTR_PROF_INDEX_VERSION);
225+
LLVM_ABI std::string
226+
getPGOFuncName(const Function &F, bool InLTO = false,
227+
uint64_t Version = INSTR_PROF_INDEX_VERSION);
227228

228229
/// Return the modified name for a function suitable to be
229230
/// used the key for profile lookup. The function's original
230231
/// name is \c RawFuncName and has linkage of type \c Linkage.
231232
/// The function is defined in module \c FileName.
232-
LLVM_ABI std::string getPGOFuncName(StringRef RawFuncName,
233-
GlobalValue::LinkageTypes Linkage,
234-
StringRef FileName,
235-
uint64_t Version = INSTR_PROF_INDEX_VERSION);
233+
LLVM_ABI std::string
234+
getPGOFuncName(StringRef RawFuncName, GlobalValue::LinkageTypes Linkage,
235+
StringRef FileName, uint64_t Version = INSTR_PROF_INDEX_VERSION);
236236

237237
/// \return the modified name for function \c F suitable to be
238238
/// used as the key for IRPGO profile lookup. \c InLTO indicates if this is
@@ -241,36 +241,38 @@ LLVM_ABI std::string getIRPGOFuncName(const Function &F, bool InLTO = false);
241241

242242
/// \return the filename and the function name parsed from the output of
243243
/// \c getIRPGOFuncName()
244-
LLVM_ABI std::pair<StringRef, StringRef> getParsedIRPGOName(StringRef IRPGOName);
244+
LLVM_ABI std::pair<StringRef, StringRef>
245+
getParsedIRPGOName(StringRef IRPGOName);
245246

246247
/// Return the name of the global variable used to store a function
247248
/// name in PGO instrumentation. \c FuncName is the IRPGO function name
248249
/// (returned by \c getIRPGOFuncName) for LLVM IR instrumentation and PGO
249250
/// function name (returned by \c getPGOFuncName) for front-end instrumentation.
250251
LLVM_ABI std::string getPGOFuncNameVarName(StringRef FuncName,
251-
GlobalValue::LinkageTypes Linkage);
252+
GlobalValue::LinkageTypes Linkage);
252253

253254
/// Create and return the global variable for function name used in PGO
254255
/// instrumentation. \c FuncName is the IRPGO function name (returned by
255256
/// \c getIRPGOFuncName) for LLVM IR instrumentation and PGO function name
256257
/// (returned by \c getPGOFuncName) for front-end instrumentation.
257-
LLVM_ABI GlobalVariable *createPGOFuncNameVar(Function &F, StringRef PGOFuncName);
258+
LLVM_ABI GlobalVariable *createPGOFuncNameVar(Function &F,
259+
StringRef PGOFuncName);
258260

259261
/// Create and return the global variable for function name used in PGO
260262
/// instrumentation. \c FuncName is the IRPGO function name (returned by
261263
/// \c getIRPGOFuncName) for LLVM IR instrumentation and PGO function name
262264
/// (returned by \c getPGOFuncName) for front-end instrumentation.
263265
LLVM_ABI GlobalVariable *createPGOFuncNameVar(Module &M,
264-
GlobalValue::LinkageTypes Linkage,
265-
StringRef PGOFuncName);
266+
GlobalValue::LinkageTypes Linkage,
267+
StringRef PGOFuncName);
266268

267269
/// Return the initializer in string of the PGO name var \c NameVar.
268270
LLVM_ABI StringRef getPGOFuncNameVarInitializer(GlobalVariable *NameVar);
269271

270272
/// Given a PGO function name, remove the filename prefix and return
271273
/// the original (static) function name.
272274
LLVM_ABI StringRef getFuncNameWithoutPrefix(StringRef PGOFuncName,
273-
StringRef FileName = "<unknown>");
275+
StringRef FileName = "<unknown>");
274276

275277
/// Given a vector of strings (names of global objects like functions or,
276278
/// virtual tables) \c NameStrs, the method generates a combined string \c
@@ -282,18 +284,20 @@ LLVM_ABI StringRef getFuncNameWithoutPrefix(StringRef PGOFuncName,
282284
/// compressed string. When the string compression is off, the
283285
/// second field will have value zero.
284286
LLVM_ABI Error collectGlobalObjectNameStrings(ArrayRef<std::string> NameStrs,
285-
bool doCompression, std::string &Result);
287+
bool doCompression,
288+
std::string &Result);
286289

287290
/// Produce \c Result string with the same format described above. The input
288291
/// is vector of PGO function name variables that are referenced.
289292
/// The global variable element in 'NameVars' is a string containing the pgo
290293
/// name of a function. See `createPGOFuncNameVar` that creates these global
291294
/// variables.
292295
LLVM_ABI Error collectPGOFuncNameStrings(ArrayRef<GlobalVariable *> NameVars,
293-
std::string &Result, bool doCompression = true);
296+
std::string &Result,
297+
bool doCompression = true);
294298

295299
LLVM_ABI Error collectVTableStrings(ArrayRef<GlobalVariable *> VTables,
296-
std::string &Result, bool doCompression);
300+
std::string &Result, bool doCompression);
297301

298302
/// Check if INSTR_PROF_RAW_VERSION_VAR is defined. This global is only being
299303
/// set in IR PGO compilation.
@@ -302,7 +306,8 @@ LLVM_ABI bool isIRPGOFlagSet(const Module *M);
302306
/// Check if we can safely rename this Comdat function. Instances of the same
303307
/// comdat function may have different control flows thus can not share the
304308
/// same counter variable.
305-
LLVM_ABI bool canRenameComdatFunc(const Function &F, bool CheckAddressTaken = false);
309+
LLVM_ABI bool canRenameComdatFunc(const Function &F,
310+
bool CheckAddressTaken = false);
306311

307312
enum InstrProfValueKind : uint32_t {
308313
#define VALUE_PROF_KIND(Enumerator, Value, Descr) Enumerator = Value,
@@ -313,16 +318,17 @@ enum InstrProfValueKind : uint32_t {
313318
/// and annotate the instruction \p Inst with the value profile meta data.
314319
/// Annotate up to \p MaxMDCount (default 3) number of records per value site.
315320
LLVM_ABI void annotateValueSite(Module &M, Instruction &Inst,
316-
const InstrProfRecord &InstrProfR,
317-
InstrProfValueKind ValueKind, uint32_t SiteIndx,
318-
uint32_t MaxMDCount = 3);
321+
const InstrProfRecord &InstrProfR,
322+
InstrProfValueKind ValueKind, uint32_t SiteIndx,
323+
uint32_t MaxMDCount = 3);
319324

320325
/// Same as the above interface but using an ArrayRef, as well as \p Sum.
321326
/// This function will not annotate !prof metadata on the instruction if the
322327
/// referenced array is empty.
323328
LLVM_ABI void annotateValueSite(Module &M, Instruction &Inst,
324-
ArrayRef<InstrProfValueData> VDs, uint64_t Sum,
325-
InstrProfValueKind ValueKind, uint32_t MaxMDCount);
329+
ArrayRef<InstrProfValueData> VDs, uint64_t Sum,
330+
InstrProfValueKind ValueKind,
331+
uint32_t MaxMDCount);
326332

327333
// TODO: Unify metadata name 'PGOFuncName' and 'PGOName', by supporting read
328334
// of this metadata for backward compatibility and generating 'PGOName' only.
@@ -361,8 +367,8 @@ LLVM_ABI bool needsComdatForCounter(const GlobalObject &GV, const Module &M);
361367
/// sub-strings. The substrings are separated by `\01` (returned by
362368
/// InstrProf.h:getInstrProfNameSeparator). This method decodes the string and
363369
/// calls `NameCallback` for each substring.
364-
LLVM_ABI Error readAndDecodeStrings(StringRef NameStrings,
365-
std::function<Error(StringRef)> NameCallback);
370+
LLVM_ABI Error readAndDecodeStrings(
371+
StringRef NameStrings, std::function<Error(StringRef)> NameCallback);
366372

367373
/// An enum describing the attributes of an instrumented profile.
368374
enum class InstrProfKind {
@@ -431,9 +437,10 @@ struct TemporalProfTraceTy {
431437
/// Use a set of temporal profile traces to create a list of balanced
432438
/// partitioning function nodes used by BalancedPartitioning to generate a
433439
/// function order that reduces page faults during startup
434-
LLVM_ABI static void createBPFunctionNodes(ArrayRef<TemporalProfTraceTy> Traces,
435-
std::vector<BPFunctionNode> &Nodes,
436-
bool RemoveOutlierUNs = true);
440+
LLVM_ABI static void
441+
createBPFunctionNodes(ArrayRef<TemporalProfTraceTy> Traces,
442+
std::vector<BPFunctionNode> &Nodes,
443+
bool RemoveOutlierUNs = true);
437444
};
438445

439446
inline std::error_code make_error_code(instrprof_error E) {
@@ -592,7 +599,8 @@ class InstrProfSymtab {
592599

593600
/// Initialize 'this' with the set of vtable names encoded in
594601
/// \c CompressedVTableNames.
595-
LLVM_ABI Error initVTableNamesFromCompressedStrings(StringRef CompressedVTableNames);
602+
LLVM_ABI Error
603+
initVTableNamesFromCompressedStrings(StringRef CompressedVTableNames);
596604

597605
/// This interface is used by reader of CoverageMapping test
598606
/// format.
@@ -604,7 +612,8 @@ class InstrProfSymtab {
604612
/// indicates if this is called from LTO optimization passes.
605613
/// A canonical name, removing non-__uniq suffixes, is added if
606614
/// \c AddCanonical is true.
607-
LLVM_ABI Error create(Module &M, bool InLTO = false, bool AddCanonical = true);
615+
LLVM_ABI Error create(Module &M, bool InLTO = false,
616+
bool AddCanonical = true);
608617

609618
/// Create InstrProfSymtab from a set of names iteratable from
610619
/// \p IterRange. This interface is used by IndexedProfReader.
@@ -822,7 +831,7 @@ struct OverlapStats {
822831
}
823832

824833
LLVM_ABI Error accumulateCounts(const std::string &BaseFilename,
825-
const std::string &TestFilename, bool IsCS);
834+
const std::string &TestFilename, bool IsCS);
826835
LLVM_ABI void addOneMismatch(const CountSumOrPercent &MismatchFunc);
827836
LLVM_ABI void addOneUnique(const CountSumOrPercent &UniqueFunc);
828837

@@ -862,13 +871,14 @@ struct InstrProfValueSiteRecord {
862871
/// Merge data from another InstrProfValueSiteRecord
863872
/// Optionally scale merged counts by \p Weight.
864873
LLVM_ABI void merge(InstrProfValueSiteRecord &Input, uint64_t Weight,
865-
function_ref<void(instrprof_error)> Warn);
874+
function_ref<void(instrprof_error)> Warn);
866875
/// Scale up value profile data counts by N (Numerator) / D (Denominator).
867-
LLVM_ABI void scale(uint64_t N, uint64_t D, function_ref<void(instrprof_error)> Warn);
876+
LLVM_ABI void scale(uint64_t N, uint64_t D,
877+
function_ref<void(instrprof_error)> Warn);
868878

869879
/// Compute the overlap b/w this record and Input record.
870880
LLVM_ABI void overlap(InstrProfValueSiteRecord &Input, uint32_t ValueKind,
871-
OverlapStats &Overlap, OverlapStats &FuncLevelOverlap);
881+
OverlapStats &Overlap, OverlapStats &FuncLevelOverlap);
872882
};
873883

874884
/// Profiling information for a single function.
@@ -921,17 +931,18 @@ struct InstrProfRecord {
921931
/// Add ValueData for ValueKind at value Site. We do not support adding sites
922932
/// out of order. Site must go up from 0 one by one.
923933
LLVM_ABI void addValueData(uint32_t ValueKind, uint32_t Site,
924-
ArrayRef<InstrProfValueData> VData,
925-
InstrProfSymtab *SymTab);
934+
ArrayRef<InstrProfValueData> VData,
935+
InstrProfSymtab *SymTab);
926936

927937
/// Merge the counts in \p Other into this one.
928938
/// Optionally scale merged counts by \p Weight.
929939
LLVM_ABI void merge(InstrProfRecord &Other, uint64_t Weight,
930-
function_ref<void(instrprof_error)> Warn);
940+
function_ref<void(instrprof_error)> Warn);
931941

932942
/// Scale up profile counts (including value profile data) by
933943
/// a factor of (N / D).
934-
LLVM_ABI void scale(uint64_t N, uint64_t D, function_ref<void(instrprof_error)> Warn);
944+
LLVM_ABI void scale(uint64_t N, uint64_t D,
945+
function_ref<void(instrprof_error)> Warn);
935946

936947
/// Sort value profile data (per site) by count.
937948
void sortValueData() {
@@ -954,12 +965,12 @@ struct InstrProfRecord {
954965

955966
/// Compute the overlap b/w this IntrprofRecord and Other.
956967
LLVM_ABI void overlap(InstrProfRecord &Other, OverlapStats &Overlap,
957-
OverlapStats &FuncLevelOverlap, uint64_t ValueCutoff);
968+
OverlapStats &FuncLevelOverlap, uint64_t ValueCutoff);
958969

959970
/// Compute the overlap of value profile counts.
960971
LLVM_ABI void overlapValueProfData(uint32_t ValueKind, InstrProfRecord &Src,
961-
OverlapStats &Overlap,
962-
OverlapStats &FuncLevelOverlap);
972+
OverlapStats &Overlap,
973+
OverlapStats &FuncLevelOverlap);
963974

964975
enum CountPseudoKind {
965976
NotPseudo = 0,

llvm/include/llvm/ProfileData/InstrProfCorrelator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
#ifndef LLVM_PROFILEDATA_INSTRPROFCORRELATOR_H
1313
#define LLVM_PROFILEDATA_INSTRPROFCORRELATOR_H
1414

15-
#include "llvm/Support/Compiler.h"
1615
#include "llvm/ADT/DenseSet.h"
1716
#include "llvm/Debuginfod/BuildIDFetcher.h"
1817
#include "llvm/Object/BuildID.h"
1918
#include "llvm/ProfileData/InstrProf.h"
19+
#include "llvm/Support/Compiler.h"
2020
#include "llvm/Support/Error.h"
2121
#include "llvm/Support/MemoryBuffer.h"
2222
#include "llvm/Support/YAMLTraits.h"

0 commit comments

Comments
 (0)