Skip to content

Commit 81256fc

Browse files
committed
[llvm] clang-format changes to CGData and CodeGen libraries
1 parent c55fff9 commit 81256fc

File tree

95 files changed

+1563
-1287
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+1563
-1287
lines changed

llvm/include/llvm/CGData/CodeGenData.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#ifndef LLVM_CGDATA_CODEGENDATA_H
1515
#define LLVM_CGDATA_CODEGENDATA_H
1616

17-
#include "llvm/Support/Compiler.h"
1817
#include "llvm/ADT/BitmaskEnum.h"
1918
#include "llvm/ADT/StableHashing.h"
2019
#include "llvm/Bitcode/BitcodeReader.h"
@@ -24,6 +23,7 @@
2423
#include "llvm/IR/Module.h"
2524
#include "llvm/Object/ObjectFile.h"
2625
#include "llvm/Support/Caching.h"
26+
#include "llvm/Support/Compiler.h"
2727
#include "llvm/Support/ErrorHandling.h"
2828
#include "llvm/TargetParser/Triple.h"
2929
#include <mutex>
@@ -36,8 +36,8 @@ enum CGDataSectKind {
3636
};
3737

3838
LLVM_ABI std::string getCodeGenDataSectionName(CGDataSectKind CGSK,
39-
Triple::ObjectFormatType OF,
40-
bool AddSegmentInfo = true);
39+
Triple::ObjectFormatType OF,
40+
bool AddSegmentInfo = true);
4141

4242
enum class CGDataKind {
4343
Unknown = 0x0,
@@ -247,23 +247,23 @@ struct StreamCacheData {
247247
/// process. \p AddStream is the callback used to add the serialized module to
248248
/// the stream.
249249
LLVM_ABI void saveModuleForTwoRounds(const Module &TheModule, unsigned Task,
250-
AddStreamFn AddStream);
250+
AddStreamFn AddStream);
251251

252252
/// Load the optimized bitcode module for the second codegen round.
253253
/// \p OrigModule is the original bitcode module.
254254
/// \p Task identifies the partition number in the parallel code generation
255255
/// process. \p Context provides the environment settings for module operations.
256256
/// \p IRFiles contains optimized bitcode module files needed for loading.
257257
/// \return A unique_ptr to the loaded Module, or nullptr if loading fails.
258-
LLVM_ABI std::unique_ptr<Module> loadModuleForTwoRounds(BitcodeModule &OrigModule,
259-
unsigned Task,
260-
LLVMContext &Context,
261-
ArrayRef<StringRef> IRFiles);
258+
LLVM_ABI std::unique_ptr<Module>
259+
loadModuleForTwoRounds(BitcodeModule &OrigModule, unsigned Task,
260+
LLVMContext &Context, ArrayRef<StringRef> IRFiles);
262261

263262
/// Merge the codegen data from the scratch objects \p ObjectFiles from the
264263
/// first codegen round.
265264
/// \return the combined hash of the merged codegen data.
266-
LLVM_ABI Expected<stable_hash> mergeCodeGenData(ArrayRef<StringRef> ObjectFiles);
265+
LLVM_ABI Expected<stable_hash>
266+
mergeCodeGenData(ArrayRef<StringRef> ObjectFiles);
267267

268268
LLVM_ABI void warn(Error E, StringRef Whence = "");
269269
LLVM_ABI void warn(Twine Message, StringRef Whence = "", StringRef Hint = "");

llvm/include/llvm/CGData/CodeGenDataReader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
#ifndef LLVM_CGDATA_CODEGENDATAREADER_H
1414
#define LLVM_CGDATA_CODEGENDATAREADER_H
1515

16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm/CGData/CodeGenData.h"
1817
#include "llvm/CGData/OutlinedHashTreeRecord.h"
1918
#include "llvm/CGData/StableFunctionMapRecord.h"
19+
#include "llvm/Support/Compiler.h"
2020
#include "llvm/Support/LineIterator.h"
2121
#include "llvm/Support/VirtualFileSystem.h"
2222

llvm/include/llvm/CGData/CodeGenDataWriter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
#ifndef LLVM_CGDATA_CODEGENDATAWRITER_H
1414
#define LLVM_CGDATA_CODEGENDATAWRITER_H
1515

16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm/CGData/CodeGenData.h"
1817
#include "llvm/CGData/OutlinedHashTreeRecord.h"
1918
#include "llvm/CGData/StableFunctionMapRecord.h"
19+
#include "llvm/Support/Compiler.h"
2020
#include "llvm/Support/EndianStream.h"
2121
#include "llvm/Support/Error.h"
2222

llvm/include/llvm/CGData/OutlinedHashTree.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
#ifndef LLVM_CGDATA_OUTLINEDHASHTREE_H
1616
#define LLVM_CGDATA_OUTLINEDHASHTREE_H
1717

18-
#include "llvm/Support/Compiler.h"
1918
#include "llvm/ADT/DenseMap.h"
2019
#include "llvm/ADT/StableHashing.h"
2120
#include "llvm/ObjectYAML/YAML.h"
21+
#include "llvm/Support/Compiler.h"
2222
#include "llvm/Support/raw_ostream.h"
2323

2424
#include <unordered_map>
@@ -56,8 +56,8 @@ class OutlinedHashTree {
5656
/// callbacks can be used to traverse a OutlinedHashTree for the purpose of
5757
/// print debugging or serializing it.
5858
LLVM_ABI void walkGraph(NodeCallbackFn CallbackNode,
59-
EdgeCallbackFn CallbackEdge = nullptr,
60-
bool SortedWalk = false) const;
59+
EdgeCallbackFn CallbackEdge = nullptr,
60+
bool SortedWalk = false) const;
6161

6262
/// Release all hash nodes except the root hash node.
6363
void clear() {

llvm/include/llvm/CGData/OutlinedHashTreeRecord.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#ifndef LLVM_CGDATA_OUTLINEDHASHTREERECORD_H
1717
#define LLVM_CGDATA_OUTLINEDHASHTREERECORD_H
1818

19-
#include "llvm/Support/Compiler.h"
2019
#include "llvm/CGData/OutlinedHashTree.h"
20+
#include "llvm/Support/Compiler.h"
2121

2222
namespace llvm {
2323

llvm/include/llvm/CGData/StableFunctionMap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
#ifndef LLVM_CGDATA_STABLEFUNCTIONMAP_H
1717
#define LLVM_CGDATA_STABLEFUNCTIONMAP_H
1818

19-
#include "llvm/Support/Compiler.h"
2019
#include "llvm/ADT/DenseMap.h"
2120
#include "llvm/ADT/StringMap.h"
2221
#include "llvm/IR/StructuralHash.h"
22+
#include "llvm/Support/Compiler.h"
2323

2424
namespace llvm {
2525

llvm/include/llvm/CGData/StableFunctionMapRecord.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
#ifndef LLVM_CGDATA_STABLEFUNCTIONMAPRECORD_H
1717
#define LLVM_CGDATA_STABLEFUNCTIONMAPRECORD_H
1818

19-
#include "llvm/Support/Compiler.h"
2019
#include "llvm/CGData/StableFunctionMap.h"
2120
#include "llvm/ObjectYAML/YAML.h"
21+
#include "llvm/Support/Compiler.h"
2222
#include "llvm/Support/raw_ostream.h"
2323

2424
namespace llvm {
@@ -35,7 +35,8 @@ struct StableFunctionMapRecord {
3535

3636
/// A static helper function to serialize the stable function map without
3737
/// owning the stable function map.
38-
LLVM_ABI static void serialize(raw_ostream &OS, const StableFunctionMap *FunctionMap);
38+
LLVM_ABI static void serialize(raw_ostream &OS,
39+
const StableFunctionMap *FunctionMap);
3940

4041
/// Serialize the stable function map to a raw_ostream.
4142
LLVM_ABI void serialize(raw_ostream &OS) const;

llvm/include/llvm/CodeGen/AccelTable.h

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#ifndef LLVM_CODEGEN_ACCELTABLE_H
1414
#define LLVM_CODEGEN_ACCELTABLE_H
1515

16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm/ADT/ArrayRef.h"
1817
#include "llvm/ADT/MapVector.h"
1918
#include "llvm/ADT/STLFunctionalExtras.h"
@@ -22,6 +21,7 @@
2221
#include "llvm/CodeGen/DIE.h"
2322
#include "llvm/CodeGen/DwarfStringPoolEntry.h"
2423
#include "llvm/Support/Allocator.h"
24+
#include "llvm/Support/Compiler.h"
2525
#include "llvm/Support/DJB.h"
2626
#include "llvm/Support/Debug.h"
2727
#include <cstdint>
@@ -294,7 +294,8 @@ class DWARF5AccelTableData : public AccelTableData {
294294
public:
295295
static uint32_t hash(StringRef Name) { return caseFoldingDjbHash(Name); }
296296

297-
LLVM_ABI DWARF5AccelTableData(const DIE &Die, const uint32_t UnitID, const bool IsTU);
297+
LLVM_ABI DWARF5AccelTableData(const DIE &Die, const uint32_t UnitID,
298+
const bool IsTU);
298299
DWARF5AccelTableData(const uint64_t DieOffset,
299300
const std::optional<uint64_t> DefiningParentOffset,
300301
const unsigned DieTag, const unsigned UnitID,
@@ -349,7 +350,8 @@ class DWARF5AccelTableData : public AccelTableData {
349350

350351
/// If `Die` has a non-null parent and the parent is not a declaration,
351352
/// return its offset.
352-
LLVM_ABI static std::optional<uint64_t> getDefiningParentDieOffset(const DIE &Die);
353+
LLVM_ABI static std::optional<uint64_t>
354+
getDefiningParentDieOffset(const DIE &Die);
353355

354356
protected:
355357
std::variant<const DIE *, uint64_t> OffsetVal;
@@ -438,9 +440,10 @@ class DWARF5AccelTable : public AccelTable<DWARF5AccelTableData> {
438440
}
439441
};
440442

441-
LLVM_ABI void emitAppleAccelTableImpl(AsmPrinter *Asm, AccelTableBase &Contents,
442-
StringRef Prefix, const MCSymbol *SecBegin,
443-
ArrayRef<AppleAccelTableData::Atom> Atoms);
443+
LLVM_ABI void
444+
emitAppleAccelTableImpl(AsmPrinter *Asm, AccelTableBase &Contents,
445+
StringRef Prefix, const MCSymbol *SecBegin,
446+
ArrayRef<AppleAccelTableData::Atom> Atoms);
444447

445448
/// Emit an Apple Accelerator Table consisting of entries in the specified
446449
/// AccelTable. The DataT template parameter should be derived from
@@ -452,9 +455,10 @@ void emitAppleAccelTable(AsmPrinter *Asm, AccelTable<DataT> &Contents,
452455
emitAppleAccelTableImpl(Asm, Contents, Prefix, SecBegin, DataT::Atoms);
453456
}
454457

455-
LLVM_ABI void emitDWARF5AccelTable(AsmPrinter *Asm, DWARF5AccelTable &Contents,
456-
const DwarfDebug &DD,
457-
ArrayRef<std::unique_ptr<DwarfCompileUnit>> CUs);
458+
LLVM_ABI void
459+
emitDWARF5AccelTable(AsmPrinter *Asm, DWARF5AccelTable &Contents,
460+
const DwarfDebug &DD,
461+
ArrayRef<std::unique_ptr<DwarfCompileUnit>> CUs);
458462

459463
/// Emit a DWARFv5 Accelerator Table consisting of entries in the specified
460464
/// AccelTable. The \p CUs contains either symbols keeping offsets to the
@@ -526,7 +530,8 @@ class LLVM_ABI AppleAccelTableStaticOffsetData : public AppleAccelTableData {
526530

527531
/// Accelerator table data implementation for type accelerator tables with
528532
/// a DIE offset but no actual DIE pointer.
529-
class LLVM_ABI AppleAccelTableStaticTypeData : public AppleAccelTableStaticOffsetData {
533+
class LLVM_ABI AppleAccelTableStaticTypeData
534+
: public AppleAccelTableStaticOffsetData {
530535
public:
531536
AppleAccelTableStaticTypeData(uint32_t Offset, uint16_t Tag,
532537
bool ObjCClassIsImplementation,

llvm/include/llvm/CodeGen/AsmPrinter.h

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

18-
#include "llvm/Support/Compiler.h"
1918
#include "llvm/ADT/DenseMap.h"
2019
#include "llvm/ADT/MapVector.h"
2120
#include "llvm/ADT/SmallVector.h"
@@ -27,6 +26,7 @@
2726
#include "llvm/CodeGen/StackMaps.h"
2827
#include "llvm/DebugInfo/CodeView/CodeView.h"
2928
#include "llvm/IR/InlineAsm.h"
29+
#include "llvm/Support/Compiler.h"
3030
#include "llvm/Support/ErrorHandling.h"
3131
#include <cstdint>
3232
#include <memory>

llvm/include/llvm/CodeGen/CallingConvLower.h

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
#ifndef LLVM_CODEGEN_CALLINGCONVLOWER_H
1515
#define LLVM_CODEGEN_CALLINGCONVLOWER_H
1616

17-
#include "llvm/Support/Compiler.h"
1817
#include "llvm/ADT/ArrayRef.h"
1918
#include "llvm/ADT/SmallVector.h"
2019
#include "llvm/CodeGen/Register.h"
2120
#include "llvm/CodeGen/TargetCallingConv.h"
2221
#include "llvm/IR/CallingConv.h"
2322
#include "llvm/Support/Alignment.h"
23+
#include "llvm/Support/Compiler.h"
2424
#include <variant>
2525

2626
namespace llvm {
@@ -230,8 +230,8 @@ class CCState {
230230

231231
public:
232232
LLVM_ABI CCState(CallingConv::ID CC, bool IsVarArg, MachineFunction &MF,
233-
SmallVectorImpl<CCValAssign> &Locs, LLVMContext &Context,
234-
bool NegativeOffsets = false);
233+
SmallVectorImpl<CCValAssign> &Locs, LLVMContext &Context,
234+
bool NegativeOffsets = false);
235235

236236
void addLoc(const CCValAssign &V) {
237237
Locs.push_back(V);
@@ -260,8 +260,9 @@ class CCState {
260260

261261
/// AnalyzeFormalArguments - Analyze an array of argument values,
262262
/// incorporating info about the formals into this state.
263-
LLVM_ABI void AnalyzeFormalArguments(const SmallVectorImpl<ISD::InputArg> &Ins,
264-
CCAssignFn Fn);
263+
LLVM_ABI void
264+
AnalyzeFormalArguments(const SmallVectorImpl<ISD::InputArg> &Ins,
265+
CCAssignFn Fn);
265266

266267
/// The function will invoke AnalyzeFormalArguments.
267268
void AnalyzeArguments(const SmallVectorImpl<ISD::InputArg> &Ins,
@@ -272,24 +273,24 @@ class CCState {
272273
/// AnalyzeReturn - Analyze the returned values of a return,
273274
/// incorporating info about the result values into this state.
274275
LLVM_ABI void AnalyzeReturn(const SmallVectorImpl<ISD::OutputArg> &Outs,
275-
CCAssignFn Fn);
276+
CCAssignFn Fn);
276277

277278
/// CheckReturn - Analyze the return values of a function, returning
278279
/// true if the return can be performed without sret-demotion, and
279280
/// false otherwise.
280281
LLVM_ABI bool CheckReturn(const SmallVectorImpl<ISD::OutputArg> &Outs,
281-
CCAssignFn Fn);
282+
CCAssignFn Fn);
282283

283284
/// AnalyzeCallOperands - Analyze the outgoing arguments to a call,
284285
/// incorporating info about the passed values into this state.
285286
LLVM_ABI void AnalyzeCallOperands(const SmallVectorImpl<ISD::OutputArg> &Outs,
286-
CCAssignFn Fn);
287+
CCAssignFn Fn);
287288

288289
/// AnalyzeCallOperands - Same as above except it takes vectors of types
289290
/// and argument flags.
290291
LLVM_ABI void AnalyzeCallOperands(SmallVectorImpl<MVT> &ArgVTs,
291-
SmallVectorImpl<ISD::ArgFlagsTy> &Flags,
292-
CCAssignFn Fn);
292+
SmallVectorImpl<ISD::ArgFlagsTy> &Flags,
293+
CCAssignFn Fn);
293294

294295
/// The function will invoke AnalyzeCallOperands.
295296
void AnalyzeArguments(const SmallVectorImpl<ISD::OutputArg> &Outs,
@@ -300,7 +301,7 @@ class CCState {
300301
/// AnalyzeCallResult - Analyze the return values of a call,
301302
/// incorporating info about the passed values into this state.
302303
LLVM_ABI void AnalyzeCallResult(const SmallVectorImpl<ISD::InputArg> &Ins,
303-
CCAssignFn Fn);
304+
CCAssignFn Fn);
304305

305306
/// A shadow allocated register is a register that was allocated
306307
/// but wasn't added to the location list (Locs).
@@ -432,8 +433,8 @@ class CCState {
432433
// value. The size and alignment information of the argument is encoded in its
433434
// parameter attribute.
434435
LLVM_ABI void HandleByVal(unsigned ValNo, MVT ValVT, MVT LocVT,
435-
CCValAssign::LocInfo LocInfo, int MinSize, Align MinAlign,
436-
ISD::ArgFlagsTy ArgFlags);
436+
CCValAssign::LocInfo LocInfo, int MinSize,
437+
Align MinAlign, ISD::ArgFlagsTy ArgFlags);
437438

438439
// Returns count of byval arguments that are to be stored (even partly)
439440
// in registers.
@@ -494,8 +495,8 @@ class CCState {
494495
/// the given value type. This is useful when varargs are passed in the
495496
/// registers that normal prototyped parameters would be passed in, or for
496497
/// implementing perfect forwarding.
497-
LLVM_ABI void getRemainingRegParmsForType(SmallVectorImpl<MCRegister> &Regs, MVT VT,
498-
CCAssignFn Fn);
498+
LLVM_ABI void getRemainingRegParmsForType(SmallVectorImpl<MCRegister> &Regs,
499+
MVT VT, CCAssignFn Fn);
499500

500501
/// Compute the set of registers that need to be preserved and forwarded to
501502
/// any musttail calls.
@@ -505,11 +506,11 @@ class CCState {
505506

506507
/// Returns true if the results of the two calling conventions are compatible.
507508
/// This is usually part of the check for tailcall eligibility.
508-
LLVM_ABI static bool resultsCompatible(CallingConv::ID CalleeCC,
509-
CallingConv::ID CallerCC, MachineFunction &MF,
510-
LLVMContext &C,
511-
const SmallVectorImpl<ISD::InputArg> &Ins,
512-
CCAssignFn CalleeFn, CCAssignFn CallerFn);
509+
LLVM_ABI static bool
510+
resultsCompatible(CallingConv::ID CalleeCC, CallingConv::ID CallerCC,
511+
MachineFunction &MF, LLVMContext &C,
512+
const SmallVectorImpl<ISD::InputArg> &Ins,
513+
CCAssignFn CalleeFn, CCAssignFn CallerFn);
513514

514515
/// The function runs an additional analysis pass over function arguments.
515516
/// It will mark each argument with the attribute flag SecArgPass.

llvm/include/llvm/CodeGen/CommandFlags.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
#ifndef LLVM_CODEGEN_COMMANDFLAGS_H
1616
#define LLVM_CODEGEN_COMMANDFLAGS_H
1717

18-
#include "llvm/Support/Compiler.h"
1918
#include "llvm/ADT/FloatingPointMode.h"
2019
#include "llvm/Support/CodeGen.h"
20+
#include "llvm/Support/Compiler.h"
2121
#include "llvm/Target/TargetOptions.h"
2222
#include <optional>
2323
#include <string>
@@ -164,15 +164,17 @@ struct RegisterCodeGenFlags {
164164

165165
LLVM_ABI bool getEnableBBAddrMap();
166166

167-
LLVM_ABI llvm::BasicBlockSection getBBSectionsMode(llvm::TargetOptions &Options);
167+
LLVM_ABI llvm::BasicBlockSection
168+
getBBSectionsMode(llvm::TargetOptions &Options);
168169

169170
/// Common utility function tightly tied to the options listed here. Initializes
170171
/// a TargetOptions object with CodeGen flags and returns it.
171172
/// \p TheTriple is used to determine the default value for options if
172173
/// options are not explicitly specified. If those triple dependant options
173174
/// value do not have effect for your component, a default Triple() could be
174175
/// passed in.
175-
LLVM_ABI TargetOptions InitTargetOptionsFromCodeGenFlags(const llvm::Triple &TheTriple);
176+
LLVM_ABI TargetOptions
177+
InitTargetOptionsFromCodeGenFlags(const llvm::Triple &TheTriple);
176178

177179
LLVM_ABI std::string getCPUStr();
178180

@@ -184,11 +186,13 @@ LLVM_ABI void renderBoolStringAttr(AttrBuilder &B, StringRef Name, bool Val);
184186

185187
/// Set function attributes of function \p F based on CPU, Features, and command
186188
/// line flags.
187-
LLVM_ABI void setFunctionAttributes(StringRef CPU, StringRef Features, Function &F);
189+
LLVM_ABI void setFunctionAttributes(StringRef CPU, StringRef Features,
190+
Function &F);
188191

189192
/// Set function attributes of functions in Module M based on CPU,
190193
/// Features, and command line flags.
191-
LLVM_ABI void setFunctionAttributes(StringRef CPU, StringRef Features, Module &M);
194+
LLVM_ABI void setFunctionAttributes(StringRef CPU, StringRef Features,
195+
Module &M);
192196

193197
/// Should value-tracking variable locations / instruction referencing be
194198
/// enabled by default for this triple?

0 commit comments

Comments
 (0)