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

via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 15 21:16:47 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mc

Author: Shao-Ce SUN (sunshaoce)

<details>
<summary>Changes</summary>

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.$
```

---
Full diff: https://github.com/llvm/llvm-project/pull/120037.diff


1 Files Affected:

- (modified) llvm/lib/MC/TargetRegistry.cpp (+3-2) 


``````````diff
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;
     }
   }

``````````

</details>


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


More information about the llvm-commits mailing list