[flang-commits] [clang] [flang] [llvm] [flang] Improvise the error message for the option "-fconvert" with allowed values (PR #215966)

Tarun Prabhu via flang-commits flang-commits at lists.llvm.org
Fri Aug 14 05:56:28 PDT 2026


================
@@ -299,6 +299,14 @@ class LLVM_ABI OptTable {
     return getInfo(id).MetaVar;
   }
 
+  /// Get the comma-separated list of values accepted by this option, as
+  /// declared by `Values` in its TableGen definition. Returns an empty string
+  /// for options that do not declare any.
+  StringRef getOptionValues(OptSpecifier id) const {
+    const char *Values = getInfo(id).Values;
+    return Values ? StringRef(Values) : StringRef();
----------------
tarunprabhu wrote:

I believe that a `StringRef` is only valid for as long as the underlying string is valid. So you're saying that `Values` will not go out of scope before the program terminates, right?

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


More information about the flang-commits mailing list