[llvm] Revert "Remove unnecessary newline from error message" (PR #120037)

Shao-Ce SUN via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 15 21:16:13 PST 2024


https://github.com/sunshaoce created https://github.com/llvm/llvm-project/pull/120037

This reverts commit 696eb3a55aecb6d6a702da9d7d88fbae7b3d77d0.

The previous commit caused missing a newline:
```shell
$ llc --mattr=help
llc: error: unable to get target for 'unknown', see --version and --triple.$
```

>From 75a9b1c130c2e94743cfc5fbf2e1a9fd98c5ad81 Mon Sep 17 00:00:00 2001
From: Shao-Ce SUN <sunshaoce at outlook.com>
Date: Mon, 16 Dec 2024 13:13:13 +0800
Subject: [PATCH] Revert "Remove unnecessary newline from error message"

This reverts commit 696eb3a55aecb6d6a702da9d7d88fbae7b3d77d0.
---
 llvm/lib/MC/TargetRegistry.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/MC/TargetRegistry.cpp b/llvm/lib/MC/TargetRegistry.cpp
index 3be6f1d4634990..b1c1f93791f679 100644
--- a/llvm/lib/MC/TargetRegistry.cpp
+++ b/llvm/lib/MC/TargetRegistry.cpp
@@ -142,8 +142,9 @@ const Target *TargetRegistry::lookupTarget(StringRef ArchName,
     std::string TempError;
     TheTarget = TargetRegistry::lookupTarget(TheTriple.getTriple(), TempError);
     if (!TheTarget) {
-      Error = "unable to get target for '" + TheTriple.getTriple() +
-              "', see --version and --triple.";
+      Error = "unable to get target for '"
+            + TheTriple.getTriple()
+            + "', see --version and --triple.\n";
       return nullptr;
     }
   }



More information about the llvm-commits mailing list