Skip to content

Commit b62d5d3

Browse files
committed
clang-format without using git-clang-format
1 parent 5fdcdcf commit b62d5d3

File tree

16 files changed

+43
-44
lines changed

16 files changed

+43
-44
lines changed

flang-rt/include/flang-rt/runtime/environment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct ExecutionEnvironment {
3939
// FIXME: https://github.com/llvm/llvm-project/issues/84942
4040
constexpr
4141
#endif
42-
ExecutionEnvironment(){};
42+
ExecutionEnvironment() {};
4343
void Configure(int argc, const char *argv[], const char *envp[],
4444
const EnvironmentDefaultList *envDefaults);
4545
const char *GetEnv(

flang-rt/include/flang-rt/runtime/format.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ enum EditingFlags {
3535

3636
struct MutableModes {
3737
std::uint8_t editingFlags{0}; // BN, DP, SS
38-
enum decimal::FortranRounding round{
39-
executionEnvironment
38+
enum decimal::FortranRounding round{executionEnvironment
4039
.defaultOutputRoundingMode}; // RP/ROUND='PROCESSOR_DEFAULT'
4140
bool pad{true}; // PAD= mode on READ
4241
char delim{'\0'}; // DELIM=

flang-rt/include/flang-rt/runtime/reduction-templates.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ inline RT_API_ATTRS void DoTotalReduction(const Descriptor &x, int dim,
5757
SubscriptValue maskAt[maxRank];
5858
mask->GetLowerBounds(maskAt);
5959
for (auto elements{x.Elements()}; elements--;
60-
x.IncrementSubscripts(xAt), mask->IncrementSubscripts(maskAt)) {
60+
x.IncrementSubscripts(xAt), mask->IncrementSubscripts(maskAt)) {
6161
if (IsLogicalElementTrue(*mask, maskAt)) {
6262
if (!accumulator.template AccumulateAt<TYPE>(xAt)) {
6363
break;
@@ -161,7 +161,7 @@ inline RT_API_ATTRS void ReduceDimMaskToScalar(const Descriptor &x,
161161
const auto &maskDim{mask.GetDimension(zeroBasedDim)};
162162
SubscriptValue maskPos{maskDim.LowerBound()};
163163
for (auto n{x.GetDimension(zeroBasedDim).Extent()}; n-- > 0;
164-
++xPos, ++maskPos) {
164+
++xPos, ++maskPos) {
165165
maskAt[zeroBasedDim] = maskPos;
166166
if (IsLogicalElementTrue(mask, maskAt)) {
167167
xAt[zeroBasedDim] = xPos;

flang-rt/lib/runtime/assign.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ static RT_API_ATTRS void DoElementalDefinedAssignment(const Descriptor &to,
202202
fromElementDesc.Establish(
203203
derived, nullptr, 0, nullptr, CFI_attribute_pointer);
204204
for (std::size_t toElements{to.Elements()}; toElements-- > 0;
205-
to.IncrementSubscripts(toAt), from.IncrementSubscripts(fromAt)) {
205+
to.IncrementSubscripts(toAt), from.IncrementSubscripts(fromAt)) {
206206
toElementDesc.set_base_addr(to.Element<char>(toAt));
207207
fromElementDesc.set_base_addr(from.Element<char>(fromAt));
208208
DoScalarDefinedAssignment(toElementDesc, fromElementDesc, special);
@@ -217,7 +217,7 @@ static RT_API_ATTRS void BlankPadCharacterAssignment(Descriptor &to,
217217
std::size_t padding{(toElementBytes - fromElementBytes) / sizeof(CHAR)};
218218
std::size_t copiedCharacters{fromElementBytes / sizeof(CHAR)};
219219
for (; elements-- > 0;
220-
to.IncrementSubscripts(toAt), from.IncrementSubscripts(fromAt)) {
220+
to.IncrementSubscripts(toAt), from.IncrementSubscripts(fromAt)) {
221221
CHAR *p{to.Element<CHAR>(toAt)};
222222
Fortran::runtime::memmove(
223223
p, from.Element<std::add_const_t<CHAR>>(fromAt), fromElementBytes);
@@ -385,7 +385,7 @@ RT_API_ATTRS void Assign(Descriptor &to, const Descriptor &from,
385385
const Descriptor &componentDesc{updatedToDerived->component()};
386386
std::size_t numComponents{componentDesc.Elements()};
387387
for (std::size_t j{0}; j < toElements;
388-
++j, to.IncrementSubscripts(toAt), from.IncrementSubscripts(fromAt)) {
388+
++j, to.IncrementSubscripts(toAt), from.IncrementSubscripts(fromAt)) {
389389
for (std::size_t k{0}; k < numComponents; ++k) {
390390
const auto &comp{
391391
*componentDesc.ZeroBasedIndexedElement<typeInfo::Component>(
@@ -493,7 +493,7 @@ RT_API_ATTRS void Assign(Descriptor &to, const Descriptor &from,
493493
}
494494
} else { // elemental copies, possibly with character truncation
495495
for (std::size_t n{toElements}; n-- > 0;
496-
to.IncrementSubscripts(toAt), from.IncrementSubscripts(fromAt)) {
496+
to.IncrementSubscripts(toAt), from.IncrementSubscripts(fromAt)) {
497497
memmoveFct(to.Element<char>(toAt), from.Element<const char>(fromAt),
498498
toElementBytes);
499499
}
@@ -520,14 +520,14 @@ RT_API_ATTRS void DoFromSourceAssign(Descriptor &alloc,
520520
alloc.GetLowerBounds(allocAt);
521521
if (allocDerived) {
522522
for (std::size_t n{alloc.Elements()}; n-- > 0;
523-
alloc.IncrementSubscripts(allocAt)) {
523+
alloc.IncrementSubscripts(allocAt)) {
524524
Descriptor allocElement{*Descriptor::Create(*allocDerived,
525525
reinterpret_cast<void *>(alloc.Element<char>(allocAt)), 0)};
526526
Assign(allocElement, source, terminator, NoAssignFlags, memmoveFct);
527527
}
528528
} else { // intrinsic type
529529
for (std::size_t n{alloc.Elements()}; n-- > 0;
530-
alloc.IncrementSubscripts(allocAt)) {
530+
alloc.IncrementSubscripts(allocAt)) {
531531
memmoveFct(alloc.Element<char>(allocAt), source.raw().base_addr,
532532
alloc.ElementBytes());
533533
}

flang-rt/lib/runtime/character.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static RT_API_ATTRS void Compare(Descriptor &result, const Descriptor &x,
123123
std::size_t xChars{x.ElementBytes() >> shift<CHAR>};
124124
std::size_t yChars{y.ElementBytes() >> shift<char>};
125125
for (SubscriptValue resultAt{0}; elements-- > 0;
126-
++resultAt, x.IncrementSubscripts(xAt), y.IncrementSubscripts(yAt)) {
126+
++resultAt, x.IncrementSubscripts(xAt), y.IncrementSubscripts(yAt)) {
127127
*result.OffsetElement<char>(resultAt) = CharacterScalarCompare<CHAR>(
128128
x.Element<CHAR>(xAt), y.Element<CHAR>(yAt), xChars, yChars);
129129
}
@@ -176,7 +176,7 @@ static RT_API_ATTRS void AdjustLRHelper(Descriptor &result,
176176
terminator.Crash("ADJUSTL/R: could not allocate storage for result");
177177
}
178178
for (SubscriptValue resultAt{0}; elements-- > 0;
179-
resultAt += elementBytes, string.IncrementSubscripts(stringAt)) {
179+
resultAt += elementBytes, string.IncrementSubscripts(stringAt)) {
180180
Adjust<CHAR, ADJUSTR>(result.OffsetElement<CHAR>(resultAt),
181181
string.Element<const CHAR>(stringAt), elementBytes >> shift<CHAR>);
182182
}
@@ -231,7 +231,7 @@ static RT_API_ATTRS void LenTrim(Descriptor &result, const Descriptor &string,
231231
}
232232
std::size_t stringElementChars{string.ElementBytes() >> shift<CHAR>};
233233
for (SubscriptValue resultAt{0}; elements-- > 0;
234-
resultAt += sizeof(INT), string.IncrementSubscripts(stringAt)) {
234+
resultAt += sizeof(INT), string.IncrementSubscripts(stringAt)) {
235235
*result.OffsetElement<INT>(resultAt) =
236236
LenTrim(string.Element<CHAR>(stringAt), stringElementChars);
237237
}
@@ -414,8 +414,8 @@ static RT_API_ATTRS void GeneralCharFunc(Descriptor &result,
414414
std::size_t stringElementChars{string.ElementBytes() >> shift<CHAR>};
415415
std::size_t argElementChars{arg.ElementBytes() >> shift<CHAR>};
416416
for (SubscriptValue resultAt{0}; elements-- > 0; resultAt += sizeof(INT),
417-
string.IncrementSubscripts(stringAt), arg.IncrementSubscripts(argAt),
418-
back && back->IncrementSubscripts(backAt)) {
417+
string.IncrementSubscripts(stringAt), arg.IncrementSubscripts(argAt),
418+
back && back->IncrementSubscripts(backAt)) {
419419
if constexpr (FUNC == CharFunc::Index) {
420420
*result.OffsetElement<INT>(resultAt) =
421421
Index<CHAR>(string.Element<CHAR>(stringAt), stringElementChars,
@@ -514,7 +514,7 @@ static RT_API_ATTRS void MaxMinHelper(Descriptor &accumulator,
514514
RUNTIME_CHECK(terminator, accumulator.Allocate() == CFI_SUCCESS);
515515
}
516516
for (CHAR *result{accumulator.OffsetElement<CHAR>()}; elements-- > 0;
517-
accumData += accumChars, result += chars, x.IncrementSubscripts(xAt)) {
517+
accumData += accumChars, result += chars, x.IncrementSubscripts(xAt)) {
518518
const CHAR *xData{x.Element<CHAR>(xAt)};
519519
int cmp{CharacterScalarCompare(accumData, xData, accumChars, xChars)};
520520
if constexpr (ISMIN) {
@@ -595,7 +595,7 @@ void RTDEF(CharacterConcatenate)(Descriptor &accumulator,
595595
char *to{static_cast<char *>(accumulator.raw().base_addr)};
596596
from.GetLowerBounds(fromAt);
597597
for (; elements-- > 0;
598-
to += newBytes, p += oldBytes, from.IncrementSubscripts(fromAt)) {
598+
to += newBytes, p += oldBytes, from.IncrementSubscripts(fromAt)) {
599599
std::memcpy(to, p, oldBytes);
600600
std::memcpy(to + oldBytes, from.Element<char>(fromAt), fromBytes);
601601
}

flang-rt/lib/runtime/derived-api.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ bool RTDEF(ExtendsTypeOf)(const Descriptor &a, const Descriptor &mold) {
154154
// true if and only if the dynamic type of A is an extension type of the
155155
// dynamic type of MOLD.
156156
for (const typeInfo::DerivedType *derivedTypeA{GetDerivedType(a)};
157-
derivedTypeA; derivedTypeA = derivedTypeA->GetParentType()) {
157+
derivedTypeA; derivedTypeA = derivedTypeA->GetParentType()) {
158158
if (CompareDerivedType(derivedTypeA, derivedTypeMold)) {
159159
return true;
160160
}

flang-rt/lib/runtime/derived.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,14 @@ static RT_API_ATTRS void CallFinalSubroutine(const Descriptor &descriptor,
233233
elemDesc.raw().rank = 0;
234234
auto *p{special->GetProc<void (*)(const Descriptor &)>()};
235235
for (std::size_t j{0}; j++ < elements;
236-
descriptor.IncrementSubscripts(at)) {
236+
descriptor.IncrementSubscripts(at)) {
237237
elemDesc.set_base_addr(descriptor.Element<char>(at));
238238
p(elemDesc);
239239
}
240240
} else {
241241
auto *p{special->GetProc<void (*)(char *)>()};
242242
for (std::size_t j{0}; j++ < elements;
243-
descriptor.IncrementSubscripts(at)) {
243+
descriptor.IncrementSubscripts(at)) {
244244
p(descriptor.Element<char>(at));
245245
}
246246
}
@@ -300,7 +300,7 @@ RT_API_ATTRS void Finalize(const Descriptor &descriptor,
300300
for (auto k{recurse ? std::size_t{1}
301301
/* skip first component, it's the parent */
302302
: 0};
303-
k < myComponents; ++k) {
303+
k < myComponents; ++k) {
304304
const auto &comp{
305305
*componentDesc.ZeroBasedIndexedElement<typeInfo::Component>(k)};
306306
SubscriptValue at[maxRank];
@@ -310,7 +310,7 @@ RT_API_ATTRS void Finalize(const Descriptor &descriptor,
310310
// Component may be polymorphic or unlimited polymorphic. Need to use the
311311
// dynamic type to check whether finalization is needed.
312312
for (std::size_t j{0}; j++ < elements;
313-
descriptor.IncrementSubscripts(at)) {
313+
descriptor.IncrementSubscripts(at)) {
314314
const Descriptor &compDesc{
315315
*descriptor.ElementComponent<Descriptor>(at, comp.offset())};
316316
if (compDesc.IsAllocated()) {
@@ -329,7 +329,7 @@ RT_API_ATTRS void Finalize(const Descriptor &descriptor,
329329
if (const typeInfo::DerivedType * compType{comp.derivedType()}) {
330330
if (!compType->noFinalizationNeeded()) {
331331
for (std::size_t j{0}; j++ < elements;
332-
descriptor.IncrementSubscripts(at)) {
332+
descriptor.IncrementSubscripts(at)) {
333333
const Descriptor &compDesc{
334334
*descriptor.ElementComponent<Descriptor>(at, comp.offset())};
335335
if (compDesc.IsAllocated()) {
@@ -346,7 +346,7 @@ RT_API_ATTRS void Finalize(const Descriptor &descriptor,
346346
Descriptor &compDesc{staticDescriptor.descriptor()};
347347
const typeInfo::DerivedType &compType{*comp.derivedType()};
348348
for (std::size_t j{0}; j++ < elements;
349-
descriptor.IncrementSubscripts(at)) {
349+
descriptor.IncrementSubscripts(at)) {
350350
compDesc.Establish(compType,
351351
descriptor.ElementComponent<char>(at, comp.offset()), comp.rank(),
352352
extents);
@@ -408,7 +408,7 @@ RT_API_ATTRS void Destroy(const Descriptor &descriptor, bool finalize,
408408
Descriptor &compDesc{staticDescriptor.descriptor()};
409409
const typeInfo::DerivedType &compType{*comp.derivedType()};
410410
for (std::size_t j{0}; j++ < elements;
411-
descriptor.IncrementSubscripts(at)) {
411+
descriptor.IncrementSubscripts(at)) {
412412
compDesc.Establish(compType,
413413
descriptor.ElementComponent<char>(at, comp.offset()), comp.rank(),
414414
extents);

flang-rt/lib/runtime/descriptor-io.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ static RT_API_ATTRS bool DefaultComponentwiseFormattedIO(IoStatementState &io,
284284
SubscriptValue at[maxRank];
285285
compArray.GetLowerBounds(at);
286286
for (std::size_t k{0}; k < numComponents;
287-
++k, compArray.IncrementSubscripts(at)) {
287+
++k, compArray.IncrementSubscripts(at)) {
288288
const typeInfo::Component &component{
289289
*compArray.Element<typeInfo::Component>(at)};
290290
if (!DefaultComponentIO<DIR>(
@@ -311,11 +311,11 @@ static RT_API_ATTRS bool DefaultComponentwiseUnformattedIO(IoStatementState &io,
311311
SubscriptValue subscripts[maxRank];
312312
descriptor.GetLowerBounds(subscripts);
313313
for (std::size_t j{0}; j < numElements;
314-
++j, descriptor.IncrementSubscripts(subscripts)) {
314+
++j, descriptor.IncrementSubscripts(subscripts)) {
315315
SubscriptValue at[maxRank];
316316
compArray.GetLowerBounds(at);
317317
for (std::size_t k{0}; k < numComponents;
318-
++k, compArray.IncrementSubscripts(at)) {
318+
++k, compArray.IncrementSubscripts(at)) {
319319
const typeInfo::Component &component{
320320
*compArray.Element<typeInfo::Component>(at)};
321321
if (!DefaultComponentIO<DIR>(
@@ -370,7 +370,7 @@ static RT_API_ATTRS bool FormattedDerivedTypeIO(IoStatementState &io,
370370
descriptor.GetLowerBounds(subscripts);
371371
std::size_t numElements{descriptor.Elements()};
372372
for (std::size_t j{0}; j < numElements;
373-
++j, descriptor.IncrementSubscripts(subscripts)) {
373+
++j, descriptor.IncrementSubscripts(subscripts)) {
374374
Fortran::common::optional<bool> result;
375375
if (special) {
376376
result = DefinedFormattedIo(io, descriptor, *type, *special, subscripts);

flang-rt/lib/runtime/edit-input.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ static RT_API_ATTRS ScannedRealInput ScanRealInput(
352352
// NaN or infinity - convert to upper case
353353
// Subtle: a blank field of digits could be followed by 'E' or 'D',
354354
for (; next &&
355-
((*next >= 'a' && *next <= 'z') || (*next >= 'A' && *next <= 'Z'));
356-
next = io.NextInField(remaining, edit)) {
355+
((*next >= 'a' && *next <= 'z') || (*next >= 'A' && *next <= 'Z'));
356+
next = io.NextInField(remaining, edit)) {
357357
if (*next >= 'a' && *next <= 'z') {
358358
Put(*next - 'a' + 'A');
359359
} else {

flang-rt/lib/runtime/edit-output.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,8 @@ RT_API_ATTRS bool RealOutputEditing<KIND>::EditListDirectedOutput(
644644
// follows that precedent so as to avoid a gratuitous incompatibility.
645645
template <int KIND>
646646
RT_API_ATTRS auto RealOutputEditing<KIND>::ConvertToHexadecimal(
647-
int significantDigits, enum decimal::FortranRounding rounding,
648-
int flags) -> ConvertToHexadecimalResult {
647+
int significantDigits, enum decimal::FortranRounding rounding, int flags)
648+
-> ConvertToHexadecimalResult {
649649
if (x_.IsNaN() || x_.IsInfinite()) {
650650
auto converted{ConvertToDecimal(significantDigits, rounding, flags)};
651651
return {converted.str, static_cast<int>(converted.length), 0};

0 commit comments

Comments
 (0)