[clang] [NFC][CUDA][HIP] Print the triple when there's no mcpu (PR #166565)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 5 06:11:44 PST 2025


================
@@ -1058,7 +1058,11 @@ void CompilerInstance::printDiagnosticStats() {
       if (!getLangOpts().CUDAIsDevice) {
         OS << " when compiling for host";
       } else {
-        OS << " when compiling for " << getTargetOpts().CPU;
+        OS << " when compiling for ";
+        if (getTargetOpts().CPU.empty())
+          OS << getTarget().getTriple().str();//"SPIR-V";
+        else
+          OS << getTargetOpts().CPU;
----------------
jhuber6 wrote:

Nit. could probably just use a ternary and keep it on one line.

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


More information about the cfe-commits mailing list