Skip to content

Commit 783b49c

Browse files
committed
EISW-173755 Fix clang-format failures as part of Check code formatting/code_formatter (pull_request) CI check
1 parent 3d0cf4e commit 783b49c

File tree

26 files changed

+196
-164
lines changed

26 files changed

+196
-164
lines changed

llvm/include/llvm/ADT/FunctionExtras.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,12 @@ template <typename ReturnT, typename... ParamTs> class UniqueFunctionBase {
111111
// This specialization ensures that 'AdjustedParam<V<T>&>' or
112112
// 'AdjustedParam<V<T>&&>' does not trigger a compile-time error when 'T' is
113113
// an incomplete type and V a templated type.
114-
template <typename T> struct AdjustedParamTBase<T &> { using type = T &; };
115-
template <typename T> struct AdjustedParamTBase<T &&> { using type = T &; };
114+
template <typename T> struct AdjustedParamTBase<T &> {
115+
using type = T &;
116+
};
117+
template <typename T> struct AdjustedParamTBase<T &&> {
118+
using type = T &;
119+
};
116120

117121
template <typename T>
118122
using AdjustedParamT = typename AdjustedParamTBase<T>::type;

llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,13 @@ bool DWARFVerifier::verifyUnitHeader(const DWARFDataExtractor DebugInfoData,
154154
if (Version >= 5) {
155155
UnitType = DebugInfoData.getU8(Offset);
156156
AddrSize = DebugInfoData.getU8(Offset);
157-
AbbrOffset = isUnitDWARF64 ? DebugInfoData.getU64(Offset) : DebugInfoData.getU32(Offset);
157+
AbbrOffset = isUnitDWARF64 ? DebugInfoData.getU64(Offset)
158+
: DebugInfoData.getU32(Offset);
158159
ValidType = dwarf::isUnitType(UnitType);
159160
} else {
160161
UnitType = 0;
161-
AbbrOffset = isUnitDWARF64 ? DebugInfoData.getU64(Offset) : DebugInfoData.getU32(Offset);
162+
AbbrOffset = isUnitDWARF64 ? DebugInfoData.getU64(Offset)
163+
: DebugInfoData.getU32(Offset);
162164
AddrSize = DebugInfoData.getU8(Offset);
163165
}
164166

@@ -420,7 +422,7 @@ unsigned DWARFVerifier::verifyUnits(const DWARFUnitVector &Units) {
420422
unsigned Index = 1;
421423
for (const auto &Unit : Units) {
422424
OS << "Verifying unit: " << Index << " / " << Units.getNumUnits();
423-
if (const char* Name = Unit->getUnitDIE(true).getShortName())
425+
if (const char *Name = Unit->getUnitDIE(true).getShortName())
424426
OS << ", \"" << Name << '\"';
425427
OS << '\n';
426428
OS.flush();
@@ -539,14 +541,12 @@ bool DWARFVerifier::handleDebugInfo() {
539541
unsigned NumErrors = 0;
540542

541543
OS << "Verifying .debug_info Unit Header Chain...\n";
542-
DObj.forEachInfoSections([&](const DWARFSection &S) {
543-
NumErrors += verifyUnitSection(S);
544-
});
544+
DObj.forEachInfoSections(
545+
[&](const DWARFSection &S) { NumErrors += verifyUnitSection(S); });
545546

546547
OS << "Verifying .debug_types Unit Header Chain...\n";
547-
DObj.forEachTypesSections([&](const DWARFSection &S) {
548-
NumErrors += verifyUnitSection(S);
549-
});
548+
DObj.forEachTypesSections(
549+
[&](const DWARFSection &S) { NumErrors += verifyUnitSection(S); });
550550

551551
OS << "Verifying non-dwo Units...\n";
552552
NumErrors += verifyUnits(DCtx.getNormalUnitsVector());
@@ -922,8 +922,7 @@ unsigned DWARFVerifier::verifyDebugInfoReferences(
922922
return DWARFDie();
923923
};
924924
unsigned NumErrors = 0;
925-
for (const std::pair<const uint64_t, std::set<uint64_t>> &Pair :
926-
References) {
925+
for (const std::pair<const uint64_t, std::set<uint64_t>> &Pair : References) {
927926
if (GetDIEForOffset(Pair.first))
928927
continue;
929928
++NumErrors;
@@ -1434,8 +1433,8 @@ unsigned DWARFVerifier::verifyNameIndexAttribute(
14341433
}
14351434

14361435
if (AttrEnc.Index == dwarf::DW_IDX_parent) {
1437-
static constexpr dwarf::Form AllowedForms[] = {dwarf::Form::DW_FORM_flag_present,
1438-
dwarf::Form::DW_FORM_ref4};
1436+
static constexpr dwarf::Form AllowedForms[] = {
1437+
dwarf::Form::DW_FORM_flag_present, dwarf::Form::DW_FORM_ref4};
14391438
if (!is_contained(AllowedForms, AttrEnc.Form)) {
14401439
ErrorCategory.Report("Unexpected NameIndex Abbreviation", [&]() {
14411440
error() << formatv(
@@ -2125,7 +2124,8 @@ bool DWARFVerifier::verifyDebugStrOffsets(
21252124
});
21262125
Success = false;
21272126
}
2128-
for (uint64_t Index = 0; C && C.tell() + OffsetByteSize <= NextUnit; ++Index) {
2127+
for (uint64_t Index = 0; C && C.tell() + OffsetByteSize <= NextUnit;
2128+
++Index) {
21292129
uint64_t OffOff = C.tell();
21302130
uint64_t StrOff = DA.getAddress(C);
21312131
// check StrOff refers to the start of a string

mlir/include/mlir/Dialect/Quant/IR/QuantTypes.h

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,9 @@ class UniformQuantizedPerAxisType
401401
};
402402

403403
/// QuantileQuantizedType derives from UniformQuantizedType and adds to it a
404-
/// look up table array of quantile values. The type of the data in the look up table is determined by
405-
/// the quantileType member: supported quantileType types are integer/unsigned/hf8/bf8/f16/bf16/f32/f64.
404+
/// look up table array of quantile values. The type of the data in the look up
405+
/// table is determined by the quantileType member: supported quantileType types
406+
/// are integer/unsigned/hf8/bf8/f16/bf16/f32/f64.
406407
///
407408
/// Syntax synopsis:
408409
/// Per-layer, all parameters expressed:
@@ -441,12 +442,11 @@ class QuantileQuantizedType
441442
int64_t storageTypeMin, int64_t storageTypeMax);
442443

443444
/// Verifies construction invariants and issues errors/warnings.
444-
static LogicalResult verifyInvariants(function_ref<InFlightDiagnostic()> emitError,
445-
unsigned flags, Type storageType,
446-
Type quantileType, Type expressedType,
447-
ArrayRef<double> quantiles, double scale,
448-
int64_t zeroPoint, int64_t storageTypeMin,
449-
int64_t storageTypeMax);
445+
static LogicalResult
446+
verifyInvariants(function_ref<InFlightDiagnostic()> emitError, unsigned flags,
447+
Type storageType, Type quantileType, Type expressedType,
448+
ArrayRef<double> quantiles, double scale, int64_t zeroPoint,
449+
int64_t storageTypeMin, int64_t storageTypeMax);
450450

451451
static bool classof(mlir::Type type);
452452

@@ -468,8 +468,9 @@ class QuantileQuantizedType
468468
};
469469

470470
/// Represents per-axis QuantileQuantizedType (also known as per-channel
471-
/// quantization). The type of the data in the look up table is determined by the
472-
/// quantileType member: supported quantileType types are integer/unsigned/hf8/bf8/f16/bf16/f32/f64.
471+
/// quantization). The type of the data in the look up table is determined by
472+
/// the quantileType member: supported quantileType types are
473+
/// integer/unsigned/hf8/bf8/f16/bf16/f32/f64.
473474
///
474475
/// Syntax synopsis:
475476
/// Per-axis, all parameters expressed:
@@ -516,10 +517,10 @@ class QuantileQuantizedPerAxisType
516517
/// Verifies construction invariants and issues errors/warnings.
517518
static LogicalResult
518519
verifyInvariants(function_ref<InFlightDiagnostic()> emitError, unsigned flags,
519-
Type storageType, Type quantileType, Type expressedType,
520-
ArrayRef<double> quantiles, ArrayRef<double> scales,
521-
ArrayRef<int64_t> zeroPoints, int32_t quantizedDimension,
522-
int64_t storageTypeMin, int64_t storageTypeMax);
520+
Type storageType, Type quantileType, Type expressedType,
521+
ArrayRef<double> quantiles, ArrayRef<double> scales,
522+
ArrayRef<int64_t> zeroPoints, int32_t quantizedDimension,
523+
int64_t storageTypeMin, int64_t storageTypeMax);
523524

524525
static bool classof(mlir::Type type);
525526

mlir/include/mlir/IR/BuiltinTypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ enum class SliceVerificationResult {
250250
/// code.
251251
SliceVerificationResult isRankReducedType(ShapedType originalType,
252252
ShapedType candidateReducedType);
253-
253+
254254
//===----------------------------------------------------------------------===//
255255
// Convenience wrappers for VectorType
256256
//

mlir/include/mlir/IR/OpImplementation.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ class AsmPrinter {
119119
/// Print a newline and indent the printer to the start of the current
120120
/// operation.
121121
virtual void printNewline();
122-
122+
123123
/// Increase indentation.
124124
virtual void increaseIndent();
125-
125+
126126
/// Decrease indentation.
127127
virtual void decreaseIndent();
128128

mlir/include/mlir/IR/SymbolTable.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ class SymbolTable {
265265
static LogicalResult replaceAllSymbolUses(Operation *oldSymbol,
266266
SymbolRefAttr newSymbolName,
267267
Region *from);
268+
268269
private:
269270
Operation *symbolTableOp;
270271

@@ -474,10 +475,10 @@ class SymbolTable : public TraitBase<ConcreteType, SymbolTable> {
474475

475476
template <typename ConcreteType>
476477
class SymbolContainer : public TraitBase<ConcreteType, SymbolContainer> {
477-
public:
478-
static LogicalResult verifyTrait(Operation *op) {
479-
return mlir::success(); //TODO::implement
480-
}
478+
public:
479+
static LogicalResult verifyTrait(Operation *op) {
480+
return mlir::success(); // TODO::implement
481+
}
481482

482483
/// Look up a symbol with the specified name, returning null if no such
483484
/// name exists. Symbol names never include the @ on them. Note: This

mlir/include/mlir/Interfaces/SideEffectInterfaces.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,17 @@ class EffectInstance {
146146
: effect(effect), resource(resource), stage(stage),
147147
effectOnFullRegion(effectOnFullRegion) {}
148148
template <typename T,
149-
std::enable_if_t<
150-
llvm::is_one_of<T, OpOperand *, OpResult, BlockArgument, Value>::value,
151-
bool> = true>
149+
std::enable_if_t<llvm::is_one_of<T, OpOperand *, OpResult,
150+
BlockArgument, Value>::value,
151+
bool> = true>
152152
EffectInstance(EffectT *effect, T value,
153153
Resource *resource = DefaultResource::get())
154154
: effect(effect), resource(resource), value(value), stage(0),
155155
effectOnFullRegion(false) {}
156156
template <typename T,
157-
std::enable_if_t<
158-
llvm::is_one_of<T, OpOperand *, OpResult, BlockArgument, Value>::value,
159-
bool> = true>
157+
std::enable_if_t<llvm::is_one_of<T, OpOperand *, OpResult,
158+
BlockArgument, Value>::value,
159+
bool> = true>
160160
EffectInstance(EffectT *effect, T value, int stage, bool effectOnFullRegion,
161161
Resource *resource = DefaultResource::get())
162162
: effect(effect), resource(resource), value(value), stage(stage),
@@ -267,7 +267,8 @@ class EffectInstance {
267267

268268
/// The Symbol, OpOperand, OpResult or BlockArgument that the effect applies
269269
/// to. This is optionally null.
270-
PointerUnion<SymbolRefAttr, OpOperand *, OpResult, BlockArgument, Value> value;
270+
PointerUnion<SymbolRefAttr, OpOperand *, OpResult, BlockArgument, Value>
271+
value;
271272

272273
/// Additional parameters of the effect instance. An attribute is used for
273274
/// type-safe structured storage and context-based uniquing. Concrete effects

mlir/include/mlir/Pass/Pass.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,9 @@ class Pass {
184184
/// invoked within this hook.
185185
/// This method is invoked after all dependent dialects for the pipeline are
186186
/// loaded, and is not allowed to load any further dialects (override the
187-
/// `getDependentDialects()` for this purpose instead). Returns a LogicalResult
188-
/// to indicate failure, in which case the pass pipeline won't execute.
187+
/// `getDependentDialects()` for this purpose instead). Returns a
188+
/// LogicalResult to indicate failure, in which case the pass pipeline won't
189+
/// execute.
189190
virtual LogicalResult initialize(MLIRContext *context) { return success(); }
190191

191192
/// Indicate if the current pass can be scheduled on the given operation type.
@@ -296,7 +297,7 @@ class Pass {
296297
/// Copy the option values from 'other', which is another instance of this
297298
/// pass.
298299
void copyOptionValuesFrom(const Pass *other);
299-
300+
300301
/// Copy the option values from 'other', which are PassPipeline options.
301302
/// Here we copy only those options that have the same argument name.
302303
void copyOptionValuesFrom(const detail::PassOptions &other);

mlir/include/mlir/Pass/PassOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ class PassOptions : protected llvm::cl::SubCommand {
342342
/// Copy the option values from 'other' into 'this', where 'other' has the
343343
/// same options as 'this'.
344344
void copyOptionValuesFrom(const PassOptions &other);
345-
345+
346346
/// Copy only those options that have the same argument name.
347347
void matchAndCopyOptionValuesFrom(const PassOptions &otherPassOptions);
348348

mlir/include/mlir/Tools/mlir-opt/MlirOptMain.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ class MlirOptMainConfig {
297297
/// VPUX-specific method to get value for arch kind from command line
298298
/// and register HW-specific passes and pipelines
299299
using AdditionalRegistrationFn =
300-
std::function<void(llvm::StringRef helpHeader)>;
300+
std::function<void(llvm::StringRef helpHeader)>;
301301

302302
/// This defines the function type used to setup the pass manager. This can be
303303
/// used to pass in a callback to setup a default pass pipeline to be applied on
@@ -328,10 +328,10 @@ LogicalResult MlirOptMain(llvm::raw_ostream &outputStream,
328328
/// - registry should contain all the dialects that can be parsed in the source.
329329
/// - additionalRegistration will be called before the main command line parsing
330330
/// to perform additional registrations.
331-
LogicalResult MlirOptMain(int argc, char **argv, llvm::StringRef toolName,
332-
DialectRegistry &registry,
333-
const AdditionalRegistrationFn &additionalRegistration
334-
= [](llvm::StringRef){});
331+
LogicalResult MlirOptMain(
332+
int argc, char **argv, llvm::StringRef toolName, DialectRegistry &registry,
333+
const AdditionalRegistrationFn &additionalRegistration =
334+
[](llvm::StringRef) {});
335335

336336
/// Helper wrapper to return the result of MlirOptMain directly from main.
337337
///

0 commit comments

Comments
 (0)