Skip to content

Commit f802efe

Browse files
committed
run clang-format
1 parent 37172da commit f802efe

19 files changed

+186
-141
lines changed

llvm/include/llvm/ADT/APFixedPoint.h

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
#ifndef LLVM_ADT_APFIXEDPOINT_H
1717
#define LLVM_ADT_APFIXEDPOINT_H
1818

19-
#include "llvm/Support/Compiler.h"
2019
#include "llvm/ADT/APSInt.h"
2120
#include "llvm/ADT/Hashing.h"
2221
#include "llvm/ADT/SmallString.h"
22+
#include "llvm/Support/Compiler.h"
2323
#include "llvm/Support/raw_ostream.h"
2424

2525
namespace llvm {
@@ -89,7 +89,7 @@ class FixedPointSemantics {
8989
getCommonSemantics(const FixedPointSemantics &Other) const;
9090

9191
/// Print semantics for debug purposes
92-
LLVM_ABI void print(llvm::raw_ostream& OS) const;
92+
LLVM_ABI void print(llvm::raw_ostream &OS) const;
9393

9494
/// Returns true if this fixed-point semantic with its value bits interpreted
9595
/// as an integer can fit in the given floating point semantic without
@@ -192,16 +192,20 @@ class APFixedPoint {
192192
// parameter is provided, set this value to true or false to indicate if this
193193
// operation results in an overflow.
194194
LLVM_ABI APFixedPoint convert(const FixedPointSemantics &DstSema,
195-
bool *Overflow = nullptr) const;
195+
bool *Overflow = nullptr) const;
196196

197197
// Perform binary operations on a fixed point type. The resulting fixed point
198198
// value will be in the common, full precision semantics that can represent
199199
// the precision and ranges of both input values. See convert() for an
200200
// explanation of the Overflow parameter.
201-
LLVM_ABI APFixedPoint add(const APFixedPoint &Other, bool *Overflow = nullptr) const;
202-
LLVM_ABI APFixedPoint sub(const APFixedPoint &Other, bool *Overflow = nullptr) const;
203-
LLVM_ABI APFixedPoint mul(const APFixedPoint &Other, bool *Overflow = nullptr) const;
204-
LLVM_ABI APFixedPoint div(const APFixedPoint &Other, bool *Overflow = nullptr) const;
201+
LLVM_ABI APFixedPoint add(const APFixedPoint &Other,
202+
bool *Overflow = nullptr) const;
203+
LLVM_ABI APFixedPoint sub(const APFixedPoint &Other,
204+
bool *Overflow = nullptr) const;
205+
LLVM_ABI APFixedPoint mul(const APFixedPoint &Other,
206+
bool *Overflow = nullptr) const;
207+
LLVM_ABI APFixedPoint div(const APFixedPoint &Other,
208+
bool *Overflow = nullptr) const;
205209

206210
// Perform shift operations on a fixed point type. Unlike the other binary
207211
// operations, the resulting fixed point value will be in the original
@@ -236,7 +240,7 @@ class APFixedPoint {
236240
/// to be fully stored in the provided width and sign, the overflow parameter
237241
/// is set to true.
238242
LLVM_ABI APSInt convertToInt(unsigned DstWidth, bool DstSign,
239-
bool *Overflow = nullptr) const;
243+
bool *Overflow = nullptr) const;
240244

241245
/// Convert this fixed point number to a floating point value with the
242246
/// provided semantics.
@@ -275,15 +279,16 @@ class APFixedPoint {
275279

276280
/// Given a floating point semantic, return the next floating point semantic
277281
/// with a larger exponent and larger or equal mantissa.
278-
LLVM_ABI static const fltSemantics *promoteFloatSemantics(const fltSemantics *S);
282+
LLVM_ABI static const fltSemantics *
283+
promoteFloatSemantics(const fltSemantics *S);
279284

280285
/// Create an APFixedPoint with a value equal to that of the provided integer,
281286
/// and in the same semantics as the provided target semantics. If the value
282287
/// is not able to fit in the specified fixed point semantics, and the
283288
/// overflow parameter is provided, it is set to true.
284-
LLVM_ABI static APFixedPoint getFromIntValue(const APSInt &Value,
285-
const FixedPointSemantics &DstFXSema,
286-
bool *Overflow = nullptr);
289+
LLVM_ABI static APFixedPoint
290+
getFromIntValue(const APSInt &Value, const FixedPointSemantics &DstFXSema,
291+
bool *Overflow = nullptr);
287292

288293
/// Create an APFixedPoint with a value equal to that of the provided
289294
/// floating point value, in the provided target semantics. If the value is
@@ -292,9 +297,9 @@ class APFixedPoint {
292297
/// For NaN, the Overflow flag is always set. For +inf and -inf, if the
293298
/// semantic is saturating, the value saturates. Otherwise, the Overflow flag
294299
/// is set.
295-
LLVM_ABI static APFixedPoint getFromFloatValue(const APFloat &Value,
296-
const FixedPointSemantics &DstFXSema,
297-
bool *Overflow = nullptr);
300+
LLVM_ABI static APFixedPoint
301+
getFromFloatValue(const APFloat &Value, const FixedPointSemantics &DstFXSema,
302+
bool *Overflow = nullptr);
298303

299304
private:
300305
APSInt Val;

llvm/include/llvm/ADT/APFloat.h

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

18-
#include "llvm/Support/Compiler.h"
1918
#include "llvm/ADT/APInt.h"
2019
#include "llvm/ADT/ArrayRef.h"
2120
#include "llvm/ADT/FloatingPointMode.h"
21+
#include "llvm/Support/Compiler.h"
2222
#include "llvm/Support/ErrorHandling.h"
2323
#include "llvm/Support/float128.h"
2424
#include <memory>
@@ -285,7 +285,8 @@ struct APFloatBase {
285285
// Returns true if any number described by this semantics can be precisely
286286
// represented by the specified semantics. Does not take into account
287287
// the value of fltNonfiniteBehavior, hasZero, hasSignedRepr.
288-
LLVM_ABI static bool isRepresentableBy(const fltSemantics &A, const fltSemantics &B);
288+
LLVM_ABI static bool isRepresentableBy(const fltSemantics &A,
289+
const fltSemantics &B);
289290

290291
/// @}
291292

@@ -349,7 +350,8 @@ struct APFloatBase {
349350
LLVM_ABI static ExponentType semanticsMinExponent(const fltSemantics &);
350351
LLVM_ABI static ExponentType semanticsMaxExponent(const fltSemantics &);
351352
LLVM_ABI static unsigned int semanticsSizeInBits(const fltSemantics &);
352-
LLVM_ABI static unsigned int semanticsIntSizeInBits(const fltSemantics&, bool);
353+
LLVM_ABI static unsigned int semanticsIntSizeInBits(const fltSemantics &,
354+
bool);
353355
LLVM_ABI static bool semanticsHasZero(const fltSemantics &);
354356
LLVM_ABI static bool semanticsHasSignedRepr(const fltSemantics &);
355357
LLVM_ABI static bool semanticsHasInf(const fltSemantics &);
@@ -360,7 +362,7 @@ struct APFloatBase {
360362
// Returns true if any number described by \p Src can be precisely represented
361363
// by a normal (not subnormal) value in \p Dst.
362364
LLVM_ABI static bool isRepresentableAsNormalIn(const fltSemantics &Src,
363-
const fltSemantics &Dst);
365+
const fltSemantics &Dst);
364366

365367
/// Returns the size of the floating point number (in bits) in the given
366368
/// semantics.
@@ -436,7 +438,8 @@ class IEEEFloat final {
436438
LLVM_ABI opStatus remainder(const IEEEFloat &);
437439
/// C fmod, or llvm frem.
438440
LLVM_ABI opStatus mod(const IEEEFloat &);
439-
LLVM_ABI opStatus fusedMultiplyAdd(const IEEEFloat &, const IEEEFloat &, roundingMode);
441+
LLVM_ABI opStatus fusedMultiplyAdd(const IEEEFloat &, const IEEEFloat &,
442+
roundingMode);
440443
LLVM_ABI opStatus roundToIntegral(roundingMode);
441444
/// IEEE-754R 5.3.1: nextUp/nextDown.
442445
LLVM_ABI opStatus next(bool nextDown);
@@ -454,13 +457,15 @@ class IEEEFloat final {
454457
/// @{
455458

456459
LLVM_ABI opStatus convert(const fltSemantics &, roundingMode, bool *);
457-
LLVM_ABI opStatus convertToInteger(MutableArrayRef<integerPart>, unsigned int, bool,
458-
roundingMode, bool *) const;
460+
LLVM_ABI opStatus convertToInteger(MutableArrayRef<integerPart>, unsigned int,
461+
bool, roundingMode, bool *) const;
459462
LLVM_ABI opStatus convertFromAPInt(const APInt &, bool, roundingMode);
460-
LLVM_ABI opStatus convertFromSignExtendedInteger(const integerPart *, unsigned int,
461-
bool, roundingMode);
462-
LLVM_ABI opStatus convertFromZeroExtendedInteger(const integerPart *, unsigned int,
463-
bool, roundingMode);
463+
LLVM_ABI opStatus convertFromSignExtendedInteger(const integerPart *,
464+
unsigned int, bool,
465+
roundingMode);
466+
LLVM_ABI opStatus convertFromZeroExtendedInteger(const integerPart *,
467+
unsigned int, bool,
468+
roundingMode);
464469
LLVM_ABI Expected<opStatus> convertFromString(StringRef, roundingMode);
465470
LLVM_ABI APInt bitcastToAPInt() const;
466471
LLVM_ABI double convertToDouble() const;
@@ -487,7 +492,7 @@ class IEEEFloat final {
487492
/// which must be of sufficient size, in the C99 form [-]0xh.hhhhp[+-]d.
488493
/// Return the number of characters written, excluding the terminating NUL.
489494
LLVM_ABI unsigned int convertToHexString(char *dst, unsigned int hexDigits,
490-
bool upperCase, roundingMode) const;
495+
bool upperCase, roundingMode) const;
491496

492497
/// \name IEEE-754R 5.7.2 General operations.
493498
/// @{
@@ -595,17 +600,18 @@ class IEEEFloat final {
595600
/// 1.01E-2 5 2 0.0101
596601
/// 1.01E-2 4 2 0.0101
597602
/// 1.01E-2 4 1 1.01E-2
598-
LLVM_ABI void toString(SmallVectorImpl<char> &Str, unsigned FormatPrecision = 0,
599-
unsigned FormatMaxPadding = 3, bool TruncateZero = true) const;
603+
LLVM_ABI void toString(SmallVectorImpl<char> &Str,
604+
unsigned FormatPrecision = 0,
605+
unsigned FormatMaxPadding = 3,
606+
bool TruncateZero = true) const;
600607

601608
/// If this value has an exact multiplicative inverse, store it in inv and
602609
/// return true.
603610
LLVM_ABI bool getExactInverse(APFloat *inv) const;
604611

605612
// If this is an exact power of two, return the exponent while ignoring the
606613
// sign bit. If it's not an exact power of 2, return INT_MIN
607-
LLVM_ABI LLVM_READONLY
608-
int getExactLog2Abs() const;
614+
LLVM_ABI LLVM_READONLY int getExactLog2Abs() const;
609615

610616
// If this is an exact power of two, return the exponent. If it's not an exact
611617
// power of 2, return INT_MIN
@@ -636,7 +642,7 @@ class IEEEFloat final {
636642
LLVM_ABI void makeLargest(bool Neg = false);
637643
LLVM_ABI void makeSmallest(bool Neg = false);
638644
LLVM_ABI void makeNaN(bool SNaN = false, bool Neg = false,
639-
const APInt *fill = nullptr);
645+
const APInt *fill = nullptr);
640646
LLVM_ABI void makeInf(bool Neg = false);
641647
LLVM_ABI void makeZero(bool Neg = false);
642648
LLVM_ABI void makeQuiet();
@@ -822,7 +828,8 @@ class DoubleAPFloat final {
822828
LLVM_ABI DoubleAPFloat(const fltSemantics &S, uninitializedTag);
823829
LLVM_ABI DoubleAPFloat(const fltSemantics &S, integerPart);
824830
LLVM_ABI DoubleAPFloat(const fltSemantics &S, const APInt &I);
825-
LLVM_ABI DoubleAPFloat(const fltSemantics &S, APFloat &&First, APFloat &&Second);
831+
LLVM_ABI DoubleAPFloat(const fltSemantics &S, APFloat &&First,
832+
APFloat &&Second);
826833
LLVM_ABI DoubleAPFloat(const DoubleAPFloat &RHS);
827834
LLVM_ABI DoubleAPFloat(DoubleAPFloat &&RHS);
828835
~DoubleAPFloat();
@@ -844,7 +851,8 @@ class DoubleAPFloat final {
844851
LLVM_ABI opStatus remainder(const DoubleAPFloat &RHS);
845852
LLVM_ABI opStatus mod(const DoubleAPFloat &RHS);
846853
LLVM_ABI opStatus fusedMultiplyAdd(const DoubleAPFloat &Multiplicand,
847-
const DoubleAPFloat &Addend, roundingMode RM);
854+
const DoubleAPFloat &Addend,
855+
roundingMode RM);
848856
LLVM_ABI opStatus roundToIntegral(roundingMode RM);
849857
LLVM_ABI void changeSign();
850858
LLVM_ABI cmpResult compareAbsoluteValue(const DoubleAPFloat &RHS) const;
@@ -866,17 +874,21 @@ class DoubleAPFloat final {
866874
LLVM_ABI opStatus next(bool nextDown);
867875

868876
LLVM_ABI opStatus convertToInteger(MutableArrayRef<integerPart> Input,
869-
unsigned int Width, bool IsSigned, roundingMode RM,
870-
bool *IsExact) const;
871-
LLVM_ABI opStatus convertFromAPInt(const APInt &Input, bool IsSigned, roundingMode RM);
877+
unsigned int Width, bool IsSigned,
878+
roundingMode RM, bool *IsExact) const;
879+
LLVM_ABI opStatus convertFromAPInt(const APInt &Input, bool IsSigned,
880+
roundingMode RM);
872881
LLVM_ABI opStatus convertFromSignExtendedInteger(const integerPart *Input,
873-
unsigned int InputSize, bool IsSigned,
874-
roundingMode RM);
882+
unsigned int InputSize,
883+
bool IsSigned,
884+
roundingMode RM);
875885
LLVM_ABI opStatus convertFromZeroExtendedInteger(const integerPart *Input,
876-
unsigned int InputSize, bool IsSigned,
877-
roundingMode RM);
886+
unsigned int InputSize,
887+
bool IsSigned,
888+
roundingMode RM);
878889
LLVM_ABI unsigned int convertToHexString(char *DST, unsigned int HexDigits,
879-
bool UpperCase, roundingMode RM) const;
890+
bool UpperCase,
891+
roundingMode RM) const;
880892

881893
LLVM_ABI bool isDenormal() const;
882894
LLVM_ABI bool isSmallest() const;
@@ -885,22 +897,22 @@ class DoubleAPFloat final {
885897
LLVM_ABI bool isInteger() const;
886898

887899
LLVM_ABI void toString(SmallVectorImpl<char> &Str, unsigned FormatPrecision,
888-
unsigned FormatMaxPadding, bool TruncateZero = true) const;
900+
unsigned FormatMaxPadding,
901+
bool TruncateZero = true) const;
889902

890903
LLVM_ABI bool getExactInverse(APFloat *inv) const;
891904

892-
LLVM_ABI LLVM_READONLY
893-
int getExactLog2() const;
894-
LLVM_ABI LLVM_READONLY
895-
int getExactLog2Abs() const;
905+
LLVM_ABI LLVM_READONLY int getExactLog2() const;
906+
LLVM_ABI LLVM_READONLY int getExactLog2Abs() const;
896907

897908
friend DoubleAPFloat scalbn(const DoubleAPFloat &X, int Exp, roundingMode);
898909
friend DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp, roundingMode);
899910
friend hash_code hash_value(const DoubleAPFloat &Arg);
900911
};
901912

902913
LLVM_ABI hash_code hash_value(const DoubleAPFloat &Arg);
903-
LLVM_ABI DoubleAPFloat scalbn(const DoubleAPFloat &Arg, int Exp, roundingMode RM);
914+
LLVM_ABI DoubleAPFloat scalbn(const DoubleAPFloat &Arg, int Exp,
915+
roundingMode RM);
904916
LLVM_ABI DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp, roundingMode);
905917

906918
} // End detail namespace
@@ -1328,15 +1340,15 @@ class APFloat : public APFloatBase {
13281340
}
13291341

13301342
LLVM_ABI opStatus convert(const fltSemantics &ToSemantics, roundingMode RM,
1331-
bool *losesInfo);
1343+
bool *losesInfo);
13321344
opStatus convertToInteger(MutableArrayRef<integerPart> Input,
13331345
unsigned int Width, bool IsSigned, roundingMode RM,
13341346
bool *IsExact) const {
13351347
APFLOAT_DISPATCH_ON_SEMANTICS(
13361348
convertToInteger(Input, Width, IsSigned, RM, IsExact));
13371349
}
13381350
LLVM_ABI opStatus convertToInteger(APSInt &Result, roundingMode RM,
1339-
bool *IsExact) const;
1351+
bool *IsExact) const;
13401352
opStatus convertFromAPInt(const APInt &Input, bool IsSigned,
13411353
roundingMode RM) {
13421354
APFLOAT_DISPATCH_ON_SEMANTICS(convertFromAPInt(Input, IsSigned, RM));

0 commit comments

Comments
 (0)