[PATCH] D98867: [HIP] Fix ROCm detection

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 19 10:08:03 PDT 2021


tra added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/AMDGPU.cpp:267-268
+    // rocm-{major}.{minor}.{subMinor}[-{build}]
+    auto Loc = StringRef(VerStr).rfind('_');
+    if (Loc != StringRef::npos)
+      VerStr[Loc] = '.';
----------------
You don't need `StringRef` here. `VerStr.rfind()` will do.


================
Comment at: clang/lib/Driver/ToolChains/AMDGPU.cpp:269
+    if (Loc != StringRef::npos)
+      VerStr[Loc] = '.';
+    V.tryParse(VerStr);
----------------
This only deals with a single `.` in the version. It's likely that we will have to deal with a patch release at some point, so you may want to replace all instances.



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

https://reviews.llvm.org/D98867



More information about the cfe-commits mailing list