[PATCH] D52104: lld-link: print demangled symbol names for "undefined symbol" diagnostics

Erik Pilkington via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 14 13:04:14 PDT 2018


erik.pilkington added inline comments.


================
Comment at: llvm/lib/Demangle/MicrosoftDemangle.cpp:1020-1022
+  if (initializeOutputStream(nullptr, nullptr, OS, 1024))
+    // FIXME: Propagate out-of-memory as an error?
+    std::terminate();
----------------
thakis wrote:
> zturner wrote:
> > Is this returning `true` if it fails?  Gross.  Can we make it return `false` if it fails?
> Returning true on error is reasonably common in the codebase: http://llvm-cs.pcc.me.uk/?q=true+on+error (e.g. https://reviews.llvm.org/D45898#inline-454138) I too wish it wasn't so.
> 
> (I'm also calling an existing function here, so I'd prefer to not change all the existing callers.)
I think LLVM style is true on error, aka unix style. I've seen a lot of both though. I don't see any mention in the coding style guide, but I think this would be a really good thing to have there. Maybe we should start a bikeshed on llvm-dev.


https://reviews.llvm.org/D52104





More information about the llvm-commits mailing list