JonChesterfield added inline comments.
================ 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); } ---------------- yaxunl wrote: > JonChesterfield wrote: > > getAsInteger writes to CodeObjVer. > can we return Optional<unsigned> and return None if there is a remnant? Then > we can call this function in checkAMDGPUCodeObjectVersion We could. It would spawn handling of the Optional<> at all the call sites though. I'll see if I can pull the search logic into a local helper. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101077/new/ https://reviews.llvm.org/D101077 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits