[llvm] [Support] Simplify setDefaultImpl (NFC) (PR #137528)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 27 12:12:41 PDT 2025


================
@@ -1459,18 +1459,16 @@ class opt
     }
   }
 
-  template <class T, class = std::enable_if_t<std::is_assignable_v<T &, T>>>
-  void setDefaultImpl() {
-    const OptionValue<DataType> &V = this->getDefault();
-    if (V.hasValue())
-      this->setValue(V.getValue());
-    else
-      this->setValue(T());
+  template <class T> void setDefaultImpl() {
----------------
nikic wrote:

Merge this into setDefault() now? I assume the impl method only exists for SFINAE.

https://github.com/llvm/llvm-project/pull/137528


More information about the llvm-commits mailing list