[llvm] b2dcde0 - Add constexpr to DenormalMode constructors

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 15:47:01 PST 2020


Author: Matt Arsenault
Date: 2020-03-04T18:46:46-05:00
New Revision: b2dcde08adaadf6fa6bf1b977ccac42a5ffe46fc

URL: https://github.com/llvm/llvm-project/commit/b2dcde08adaadf6fa6bf1b977ccac42a5ffe46fc
DIFF: https://github.com/llvm/llvm-project/commit/b2dcde08adaadf6fa6bf1b977ccac42a5ffe46fc.diff

LOG: Add constexpr to DenormalMode constructors

This will allow their use in member initializers in a future commit.

Added: 
    

Modified: 
    llvm/include/llvm/ADT/FloatingPointMode.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/FloatingPointMode.h b/llvm/include/llvm/ADT/FloatingPointMode.h
index dcac3dbca1d3..fd06789c0f6e 100644
--- a/llvm/include/llvm/ADT/FloatingPointMode.h
+++ b/llvm/include/llvm/ADT/FloatingPointMode.h
@@ -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);
   }


        


More information about the llvm-commits mailing list