Skip to content

Commit

Permalink
Add constexpr to DenormalMode constructors
Browse files Browse the repository at this point in the history
This will allow their use in member initializers in a future commit.
  • Loading branch information
arsenm committed Mar 4, 2020
1 parent 7459781 commit b2dcde0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions llvm/include/llvm/ADT/FloatingPointMode.h
Expand Up @@ -45,25 +45,25 @@ struct DenormalMode {
/// floating-point instructions implicitly treat the input value as 0.
DenormalModeKind Input = DenormalModeKind::Invalid;

DenormalMode() = default;
DenormalMode(DenormalModeKind Out, DenormalModeKind In) :
constexpr DenormalMode() = default;
constexpr DenormalMode(DenormalModeKind Out, DenormalModeKind In) :
Output(Out), Input(In) {}


static DenormalMode getInvalid() {
static constexpr DenormalMode getInvalid() {
return DenormalMode(DenormalModeKind::Invalid, DenormalModeKind::Invalid);
}

static DenormalMode getIEEE() {
static constexpr DenormalMode getIEEE() {
return DenormalMode(DenormalModeKind::IEEE, DenormalModeKind::IEEE);
}

static DenormalMode getPreserveSign() {
static constexpr DenormalMode getPreserveSign() {
return DenormalMode(DenormalModeKind::PreserveSign,
DenormalModeKind::PreserveSign);
}

static DenormalMode getPositiveZero() {
static constexpr DenormalMode getPositiveZero() {
return DenormalMode(DenormalModeKind::PositiveZero,
DenormalModeKind::PositiveZero);
}
Expand Down

0 comments on commit b2dcde0

Please sign in to comment.