[PATCH] D101077: [clang][nfc] Split getOrCheckAMDGPUCodeObjectVersion

Jon Chesterfield via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 22 09:02:51 PDT 2021


JonChesterfield added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:1597
+
+    if (CodeObjArg->getOption().getID() ==
+        options::OPT_mcode_object_version_EQ) {
----------------
This would probably be more useful if it diagnosed an invalid argument even when overridden by a legacy option. This patch preserves the existing behaviour.


================
Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:1626
     } else {
-      auto Remnant =
-          StringRef(CodeObjArg->getValue()).getAsInteger(0, CodeObjVer);
-      if (Diagnose &&
-          (Remnant || CodeObjVer < MinCodeObjVer || CodeObjVer > MaxCodeObjVer))
-        D.Diag(diag::err_drv_invalid_int_value)
-            << CodeObjArg->getAsString(Args) << CodeObjArg->getValue();
+      StringRef(CodeObjArg->getValue()).getAsInteger(0, CodeObjVer);
     }
----------------
getAsInteger writes to CodeObjVer.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101077/new/

https://reviews.llvm.org/D101077



More information about the cfe-commits mailing list