Skip to content

Commit 127f6f6

Browse files
committed
[llvm] clang-format changes to TargetParser library
1 parent 2dcc93d commit 127f6f6

File tree

11 files changed

+80
-61
lines changed

11 files changed

+80
-61
lines changed

llvm/include/llvm/TargetParser/AArch64TargetParser.h

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

17-
#include "llvm/Support/Compiler.h"
1817
#include "llvm/ADT/ArrayRef.h"
1918
#include "llvm/ADT/Bitset.h"
2019
#include "llvm/ADT/StringExtras.h"
2120
#include "llvm/ADT/StringMap.h"
2221
#include "llvm/ADT/StringRef.h"
22+
#include "llvm/Support/Compiler.h"
2323
#include "llvm/Support/VersionTuple.h"
2424
#include "llvm/Support/raw_ostream.h"
2525
#include "llvm/TargetParser/SubtargetFeature.h"
@@ -203,14 +203,16 @@ struct ExtensionSet {
203203
// the form "<name>" to enable a feature or "no<name>" to disable it. This
204204
// will also enable or disable any features as required by the dependencies
205205
// between them.
206-
LLVM_ABI bool parseModifier(StringRef Modifier, const bool AllowNoDashForm = false);
206+
LLVM_ABI bool parseModifier(StringRef Modifier,
207+
const bool AllowNoDashForm = false);
207208

208209
// Constructs a new ExtensionSet by toggling the corresponding bits for every
209210
// feature in the \p Features list without expanding their dependencies. Used
210211
// for reconstructing an ExtensionSet from the output of toLLVMFeatures().
211212
// Features that are not recognized are pushed back to \p NonExtensions.
212-
LLVM_ABI void reconstructFromParsedFeatures(const std::vector<std::string> &Features,
213-
std::vector<std::string> &NonExtensions);
213+
LLVM_ABI void
214+
reconstructFromParsedFeatures(const std::vector<std::string> &Features,
215+
std::vector<std::string> &NonExtensions);
214216

215217
// Convert the set of enabled extension to an LLVM feature list, appending
216218
// them to Features.
@@ -242,9 +244,8 @@ struct Alias {
242244

243245
LLVM_ABI const ExtensionInfo &getExtensionByID(ArchExtKind(ExtID));
244246

245-
LLVM_ABI bool getExtensionFeatures(
246-
const AArch64::ExtensionBitset &Extensions,
247-
std::vector<StringRef> &Features);
247+
LLVM_ABI bool getExtensionFeatures(const AArch64::ExtensionBitset &Extensions,
248+
std::vector<StringRef> &Features);
248249

249250
LLVM_ABI StringRef getArchExtFeature(StringRef ArchExt);
250251
LLVM_ABI StringRef resolveCPUAlias(StringRef CPU);
@@ -256,7 +257,8 @@ LLVM_ABI const ArchInfo *getArchForCpu(StringRef CPU);
256257
LLVM_ABI const ArchInfo *parseArch(StringRef Arch);
257258

258259
// Return the extension which has the given -target-feature name.
259-
LLVM_ABI std::optional<ExtensionInfo> targetFeatureToExtension(StringRef TargetFeature);
260+
LLVM_ABI std::optional<ExtensionInfo>
261+
targetFeatureToExtension(StringRef TargetFeature);
260262

261263
// Parse a name as defined by the Extension class in tablegen.
262264
LLVM_ABI std::optional<ExtensionInfo> parseArchExtension(StringRef Extension);
@@ -285,7 +287,8 @@ LLVM_ABI uint64_t getCpuSupportsMask(ArrayRef<StringRef> Features);
285287

286288
LLVM_ABI void PrintSupportedExtensions();
287289

288-
LLVM_ABI void printEnabledExtensions(const std::set<StringRef> &EnabledFeatureNames);
290+
LLVM_ABI void
291+
printEnabledExtensions(const std::set<StringRef> &EnabledFeatureNames);
289292

290293
} // namespace AArch64
291294
} // namespace llvm

llvm/include/llvm/TargetParser/ARMTargetParser.h

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

17-
#include "llvm/Support/Compiler.h"
1817
#include "llvm/ADT/StringMap.h"
1918
#include "llvm/ADT/StringRef.h"
2019
#include "llvm/Support/ARMBuildAttributes.h"
20+
#include "llvm/Support/Compiler.h"
2121
#include "llvm/TargetParser/ARMTargetParserCommon.h"
2222
#include <vector>
2323

@@ -230,19 +230,21 @@ LLVM_ABI NeonSupportLevel getFPUNeonSupportLevel(FPUKind FPUKind);
230230
LLVM_ABI FPURestriction getFPURestriction(FPUKind FPUKind);
231231

232232
LLVM_ABI bool getFPUFeatures(FPUKind FPUKind, std::vector<StringRef> &Features);
233-
LLVM_ABI bool getHWDivFeatures(uint64_t HWDivKind, std::vector<StringRef> &Features);
233+
LLVM_ABI bool getHWDivFeatures(uint64_t HWDivKind,
234+
std::vector<StringRef> &Features);
234235
LLVM_ABI bool getExtensionFeatures(uint64_t Extensions,
235-
std::vector<StringRef> &Features);
236+
std::vector<StringRef> &Features);
236237

237238
LLVM_ABI StringRef getArchName(ArchKind AK);
238239
LLVM_ABI unsigned getArchAttr(ArchKind AK);
239240
LLVM_ABI StringRef getCPUAttr(ArchKind AK);
240241
LLVM_ABI StringRef getSubArch(ArchKind AK);
241242
LLVM_ABI StringRef getArchExtName(uint64_t ArchExtKind);
242243
LLVM_ABI StringRef getArchExtFeature(StringRef ArchExt);
243-
LLVM_ABI bool appendArchExtFeatures(StringRef CPU, ARM::ArchKind AK, StringRef ArchExt,
244-
std::vector<StringRef> &Features,
245-
FPUKind &ArgFPUKind);
244+
LLVM_ABI bool appendArchExtFeatures(StringRef CPU, ARM::ArchKind AK,
245+
StringRef ArchExt,
246+
std::vector<StringRef> &Features,
247+
FPUKind &ArgFPUKind);
246248
LLVM_ABI ArchKind convertV9toV8(ArchKind AK);
247249

248250
// Information by Name
@@ -267,7 +269,8 @@ LLVM_ABI StringRef computeDefaultTargetABI(const Triple &TT, StringRef CPU);
267269
///
268270
/// \param Arch the architecture name (e.g., "armv7s"). If it is an empty
269271
/// string then the triple's arch name is used.
270-
LLVM_ABI StringRef getARMCPUForArch(const llvm::Triple &Triple, StringRef MArch = {});
272+
LLVM_ABI StringRef getARMCPUForArch(const llvm::Triple &Triple,
273+
StringRef MArch = {});
271274

272275
LLVM_ABI void PrintSupportedExtensions(StringMap<StringRef> DescMap);
273276

llvm/include/llvm/TargetParser/ARMTargetParserCommon.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#ifndef LLVM_TARGETPARSER_ARMTARGETPARSERCOMMON_H
1414
#define LLVM_TARGETPARSER_ARMTARGETPARSERCOMMON_H
1515

16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm/ADT/StringRef.h"
17+
#include "llvm/Support/Compiler.h"
1818

1919
namespace llvm {
2020
namespace ARM {
@@ -47,7 +47,7 @@ struct ParsedBranchProtection {
4747
};
4848

4949
LLVM_ABI bool parseBranchProtection(StringRef Spec, ParsedBranchProtection &PBP,
50-
StringRef &Err, bool EnablePAuthLR = false);
50+
StringRef &Err, bool EnablePAuthLR = false);
5151

5252
} // namespace ARM
5353
} // namespace llvm

llvm/include/llvm/TargetParser/CSKYTargetParser.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,14 @@ LLVM_ABI StringRef getArchExtName(uint64_t ArchExtKind);
183183
LLVM_ABI StringRef getArchExtFeature(StringRef ArchExt);
184184
LLVM_ABI uint64_t getDefaultExtensions(StringRef CPU);
185185
LLVM_ABI bool getExtensionFeatures(uint64_t Extensions,
186-
std::vector<StringRef> &Features);
186+
std::vector<StringRef> &Features);
187187

188188
// Information by ID
189189
LLVM_ABI StringRef getFPUName(unsigned FPUKind);
190190
LLVM_ABI FPUVersion getFPUVersion(unsigned FPUKind);
191191

192-
LLVM_ABI bool getFPUFeatures(CSKYFPUKind Kind, std::vector<StringRef> &Features);
192+
LLVM_ABI bool getFPUFeatures(CSKYFPUKind Kind,
193+
std::vector<StringRef> &Features);
193194

194195
// Parser
195196
LLVM_ABI ArchKind parseArch(StringRef Arch);

llvm/include/llvm/TargetParser/PPCTargetParser.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#ifndef LLVM_TARGETPARSER_PPCTARGETPARSER_H
1515
#define LLVM_TARGETPARSER_PPCTARGETPARSER_H
1616

17-
#include "llvm/Support/Compiler.h"
1817
#include "llvm/ADT/StringRef.h"
18+
#include "llvm/Support/Compiler.h"
1919
#include "llvm/TargetParser/Triple.h"
2020

2121
namespace llvm {
@@ -27,10 +27,12 @@ LLVM_ABI void fillValidTuneCPUList(SmallVectorImpl<StringRef> &Values);
2727
// Get target CPU name.
2828
// If CPUName is empty or generic, return the default CPU name.
2929
// If CPUName is not empty or generic, return the normalized CPU name.
30-
LLVM_ABI StringRef getNormalizedPPCTargetCPU(const Triple &T, StringRef CPUName = "");
30+
LLVM_ABI StringRef getNormalizedPPCTargetCPU(const Triple &T,
31+
StringRef CPUName = "");
3132

3233
// Get the tune CPU name.
33-
LLVM_ABI StringRef getNormalizedPPCTuneCPU(const Triple &T, StringRef CPUName = "");
34+
LLVM_ABI StringRef getNormalizedPPCTuneCPU(const Triple &T,
35+
StringRef CPUName = "");
3436

3537
// For PPC, there are some cpu names for same CPU, like pwr10 and power10,
3638
// normalize them.

llvm/include/llvm/TargetParser/RISCVISAInfo.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
#ifndef LLVM_SUPPORT_RISCVISAINFO_H
1010
#define LLVM_SUPPORT_RISCVISAINFO_H
1111

12-
#include "llvm/Support/Compiler.h"
1312
#include "llvm/ADT/StringMap.h"
1413
#include "llvm/ADT/StringRef.h"
14+
#include "llvm/Support/Compiler.h"
1515
#include "llvm/Support/Error.h"
1616
#include "llvm/Support/RISCVISAUtils.h"
1717

@@ -52,7 +52,7 @@ class RISCVISAInfo {
5252

5353
/// Convert RISC-V ISA info to a feature vector.
5454
LLVM_ABI std::vector<std::string> toFeatures(bool AddAllExtensions = false,
55-
bool IgnoreUnknown = true) const;
55+
bool IgnoreUnknown = true) const;
5656

5757
const RISCVISAUtils::OrderedExtensionMap &getExtensions() const {
5858
return Exts;
@@ -72,14 +72,15 @@ class RISCVISAInfo {
7272
LLVM_ABI static bool isSupportedExtensionFeature(StringRef Ext);
7373
LLVM_ABI static bool isSupportedExtension(StringRef Ext);
7474
LLVM_ABI static bool isSupportedExtensionWithVersion(StringRef Ext);
75-
LLVM_ABI static bool isSupportedExtension(StringRef Ext, unsigned MajorVersion,
76-
unsigned MinorVersion);
75+
LLVM_ABI static bool isSupportedExtension(StringRef Ext,
76+
unsigned MajorVersion,
77+
unsigned MinorVersion);
7778
LLVM_ABI static std::string getTargetFeatureForExtension(StringRef Ext);
7879

7980
LLVM_ABI static void printSupportedExtensions(StringMap<StringRef> &DescMap);
80-
LLVM_ABI static void printEnabledExtensions(bool IsRV64,
81-
std::set<StringRef> &EnabledFeatureNames,
82-
StringMap<StringRef> &DescMap);
81+
LLVM_ABI static void
82+
printEnabledExtensions(bool IsRV64, std::set<StringRef> &EnabledFeatureNames,
83+
StringMap<StringRef> &DescMap);
8384

8485
/// Return the group id and bit position of __riscv_feature_bits. Returns
8586
/// <-1, -1> if not supported.

llvm/include/llvm/TargetParser/RISCVTargetParser.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#ifndef LLVM_TARGETPARSER_RISCVTARGETPARSER_H
1515
#define LLVM_TARGETPARSER_RISCVTARGETPARSER_H
1616

17-
#include "llvm/Support/Compiler.h"
1817
#include "llvm/ADT/StringRef.h"
18+
#include "llvm/Support/Compiler.h"
1919
#include "llvm/Support/MathExtras.h"
2020
#include "llvm/Support/raw_ostream.h"
2121

@@ -45,13 +45,15 @@ static constexpr unsigned RVVBitsPerBlock = 64;
4545
static constexpr unsigned RVVBytesPerBlock = RVVBitsPerBlock / 8;
4646

4747
LLVM_ABI void getFeaturesForCPU(StringRef CPU,
48-
SmallVectorImpl<std::string> &EnabledFeatures,
49-
bool NeedPlus = false);
48+
SmallVectorImpl<std::string> &EnabledFeatures,
49+
bool NeedPlus = false);
5050
LLVM_ABI bool parseCPU(StringRef CPU, bool IsRV64);
5151
LLVM_ABI bool parseTuneCPU(StringRef CPU, bool IsRV64);
5252
LLVM_ABI StringRef getMArchFromMcpu(StringRef CPU);
53-
LLVM_ABI void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values, bool IsRV64);
54-
LLVM_ABI void fillValidTuneCPUArchList(SmallVectorImpl<StringRef> &Values, bool IsRV64);
53+
LLVM_ABI void fillValidCPUArchList(SmallVectorImpl<StringRef> &Values,
54+
bool IsRV64);
55+
LLVM_ABI void fillValidTuneCPUArchList(SmallVectorImpl<StringRef> &Values,
56+
bool IsRV64);
5557
LLVM_ABI bool hasFastScalarUnalignedAccess(StringRef CPU);
5658
LLVM_ABI bool hasFastVectorUnalignedAccess(StringRef CPU);
5759
LLVM_ABI bool hasValidCPUModel(StringRef CPU);
@@ -88,7 +90,7 @@ inline static bool isValidLMUL(unsigned LMUL, bool Fractional) {
8890
}
8991

9092
LLVM_ABI unsigned encodeVTYPE(VLMUL VLMUL, unsigned SEW, bool TailAgnostic,
91-
bool MaskAgnostic);
93+
bool MaskAgnostic);
9294

9395
LLVM_ABI unsigned encodeXSfmmVType(unsigned SEW, unsigned Widen, bool AltFmt);
9496

@@ -153,7 +155,8 @@ LLVM_ABI void printVType(unsigned VType, raw_ostream &OS);
153155

154156
LLVM_ABI unsigned getSEWLMULRatio(unsigned SEW, VLMUL VLMul);
155157

156-
LLVM_ABI std::optional<VLMUL> getSameRatioLMUL(unsigned SEW, VLMUL VLMUL, unsigned EEW);
158+
LLVM_ABI std::optional<VLMUL> getSameRatioLMUL(unsigned SEW, VLMUL VLMUL,
159+
unsigned EEW);
157160
} // namespace RISCVVType
158161

159162
} // namespace llvm

llvm/include/llvm/TargetParser/SubtargetFeature.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
#ifndef LLVM_TARGETPARSER_SUBTARGETFEATURE_H
1818
#define LLVM_TARGETPARSER_SUBTARGETFEATURE_H
1919

20-
#include "llvm/Support/Compiler.h"
2120
#include "llvm/ADT/ArrayRef.h"
2221
#include "llvm/ADT/STLExtras.h"
2322
#include "llvm/ADT/StringRef.h"
23+
#include "llvm/Support/Compiler.h"
2424
#include "llvm/Support/MathExtras.h"
2525
#include <array>
2626
#include <initializer_list>
@@ -196,7 +196,7 @@ class SubtargetFeatures {
196196
LLVM_ABI void dump() const;
197197

198198
/// Adds the default features for the specified target triple.
199-
LLVM_ABI void getDefaultSubtargetFeatures(const Triple& Triple);
199+
LLVM_ABI void getDefaultSubtargetFeatures(const Triple &Triple);
200200

201201
/// Determine if a feature has a flag; '+' or '-'
202202
static bool hasFlag(StringRef Feature) {

llvm/include/llvm/TargetParser/TargetParser.h

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

17-
#include "llvm/Support/Compiler.h"
1817
#include "llvm/ADT/StringMap.h"
1918
#include "llvm/ADT/StringRef.h"
19+
#include "llvm/Support/Compiler.h"
2020

2121
namespace llvm {
2222

@@ -182,7 +182,7 @@ LLVM_ABI IsaVersion getIsaVersion(StringRef GPU);
182182

183183
/// Fills Features map with default values for given target GPU
184184
LLVM_ABI void fillAMDGPUFeatureMap(StringRef GPU, const Triple &T,
185-
StringMap<bool> &Features);
185+
StringMap<bool> &Features);
186186

187187
/// Inserts wave size feature for given GPU into features map
188188
LLVM_ABI std::pair<FeatureError, StringRef>

llvm/include/llvm/TargetParser/Triple.h

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#ifndef LLVM_TARGETPARSER_TRIPLE_H
1010
#define LLVM_TARGETPARSER_TRIPLE_H
1111

12-
#include "llvm/Support/Compiler.h"
1312
#include "llvm/ADT/Twine.h"
13+
#include "llvm/Support/Compiler.h"
1414
#include "llvm/Support/VersionTuple.h"
1515

1616
// Some system headers or GCC predefined macros conflict with identifiers in
@@ -350,9 +350,10 @@ class Triple {
350350
Triple() = default;
351351

352352
LLVM_ABI explicit Triple(const Twine &Str);
353-
LLVM_ABI Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr);
354-
LLVM_ABI Triple(const Twine &ArchStr, const Twine &VendorStr, const Twine &OSStr,
355-
const Twine &EnvironmentStr);
353+
LLVM_ABI Triple(const Twine &ArchStr, const Twine &VendorStr,
354+
const Twine &OSStr);
355+
LLVM_ABI Triple(const Twine &ArchStr, const Twine &VendorStr,
356+
const Twine &OSStr, const Twine &EnvironmentStr);
356357

357358
bool operator==(const Triple &Other) const {
358359
return Arch == Other.Arch && SubArch == Other.SubArch &&
@@ -382,8 +383,8 @@ class Triple {
382383
/// reasonably be done). In particular, it handles the common case in which
383384
/// otherwise valid components are in the wrong order. \p Form is used to
384385
/// specify the output canonical form.
385-
LLVM_ABI static std::string normalize(StringRef Str,
386-
CanonicalForm Form = CanonicalForm::ANY);
386+
LLVM_ABI static std::string
387+
normalize(StringRef Str, CanonicalForm Form = CanonicalForm::ANY);
387388

388389
/// Return the normalized form of this triple's string.
389390
std::string normalize(CanonicalForm Form = CanonicalForm::ANY) const {
@@ -546,7 +547,7 @@ class Triple {
546547
/// Comparison function for checking OS X version compatibility, which handles
547548
/// supporting skewed version numbering schemes used by the "darwin" triples.
548549
LLVM_ABI bool isMacOSXVersionLT(unsigned Major, unsigned Minor = 0,
549-
unsigned Micro = 0) const;
550+
unsigned Micro = 0) const;
550551

551552
/// Is this a Mac OS X triple. For legacy reasons, we support both "darwin"
552553
/// and "osx" as OS X triples.
@@ -1269,7 +1270,8 @@ class Triple {
12691270
LLVM_ABI static StringRef getArchTypeName(ArchType Kind);
12701271

12711272
/// Get the architecture name based on \p Kind and \p SubArch.
1272-
LLVM_ABI static StringRef getArchName(ArchType Kind, SubArchType SubArch = NoSubArch);
1273+
LLVM_ABI static StringRef getArchName(ArchType Kind,
1274+
SubArchType SubArch = NoSubArch);
12731275

12741276
/// Get the "prefix" canonical name for the \p Kind architecture. This is the
12751277
/// prefix used by the architecture specific builtins, and is suitable for
@@ -1288,7 +1290,8 @@ class Triple {
12881290
LLVM_ABI static StringRef getEnvironmentTypeName(EnvironmentType Kind);
12891291

12901292
/// Get the name for the \p Object format.
1291-
LLVM_ABI static StringRef getObjectFormatTypeName(ObjectFormatType ObjectFormat);
1293+
LLVM_ABI static StringRef
1294+
getObjectFormatTypeName(ObjectFormatType ObjectFormat);
12921295

12931296
/// @}
12941297
/// @name Static helpers for converting alternate architecture names.
@@ -1300,12 +1303,13 @@ class Triple {
13001303
/// @}
13011304

13021305
/// Returns a canonicalized OS version number for the specified OS.
1303-
LLVM_ABI static VersionTuple getCanonicalVersionForOS(OSType OSKind,
1304-
const VersionTuple &Version,
1305-
bool IsInValidRange);
1306+
LLVM_ABI static VersionTuple
1307+
getCanonicalVersionForOS(OSType OSKind, const VersionTuple &Version,
1308+
bool IsInValidRange);
13061309

13071310
/// Returns whether an OS version is invalid and would not map to an Apple OS.
1308-
LLVM_ABI static bool isValidVersionForOS(OSType OSKind, const VersionTuple &Version);
1311+
LLVM_ABI static bool isValidVersionForOS(OSType OSKind,
1312+
const VersionTuple &Version);
13091313
};
13101314

13111315
} // End llvm namespace

0 commit comments

Comments
 (0)