[lld] [ELF] Add context-aware diagnostic functions (PR #112319)

Ivan Kosarev via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 16 09:41:24 PDT 2024


================
@@ -45,6 +45,15 @@ std::string lld::toString(RelType type) {
   return std::string(s);
 }
 
+const ELFSyncStream &elf::operator<<(const ELFSyncStream &s, RelType type) {
+  StringRef buf = getELFRelocationTypeName(s.ctx.arg.emachine, type);
+  if (buf == "Unknown")
+    s << ("Unknown (" + Twine(type) + ")").str();
----------------
kosarev wrote:

```suggestion
    s << "Unknown (" << type << ')';
```

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


More information about the llvm-commits mailing list