================
@@ -137,8 +137,10 @@ aarch64::getAArch64TargetTuneCPU(const llvm::opt::ArgList 
&Args,
 }
 
 // Decode AArch64 features from string like +[no]featureA+[no]featureB+...
-static bool DecodeAArch64Features(const Driver &D, StringRef text,
-                                  llvm::AArch64::ExtensionSet &Extensions) {
+static bool
+DecodeAArch64Features(const Driver &D, StringRef text,
+                      llvm::AArch64::ExtensionSet &Extensions,
+                      std::optional<std::string> *InvalidArg = nullptr) {
----------------
smithp35 wrote:

If this is implemented for mtune and mcpu then this can be a non-defaulted 
reference as all call-sites would pass in InvalidArg.

It may also be possible to use a StringRef rather than a String as it looks 
like the original String will still exist at time of printing the error message.

In theory we could have DecodeAArch64Features return std::optional with 
InvalidArg, but that would invert all the tests. I guess `llvm::expected<bool, 
string>` could work.

https://github.com/llvm/llvm-project/pull/197441
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to