[PATCH] D41885: [libcxxabi][demangler] Improve handling of variadic templates
Duncan P. N. Exon Smith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 29 14:20:09 PST 2018
dexonsmith accepted this revision.
dexonsmith added a comment.
This revision is now accepted and ready to land.
LGTM once you clean up the `#if 0`.
================
Comment at: src/cxa_demangle.cpp:260-261
+
+#if 0
+ void dump() const {
+ char *Buffer = static_cast<char*>(std::malloc(1024));
----------------
erik.pilkington wrote:
> dexonsmith wrote:
> > Why is this behind `#if 0`? Should you just use something like `LLVM_DUMP_METHOD`?
> Do you mean conditionally defined based on NDEBUG and marked __attribute__((noinline,used)) for debuggers? I was just using it as a quick & simple little helper for debugging.
Yup, those two things sound great to me. You might need some platform-specific logic to define the attributes correctly.
I figured it was a quick and simple helper, like the `dump()` methods throughout LLVM. Here's why I think you should change it:
- I imagine this will be useful in the future, too, and being able to call `dump()` from the debugger without recompiling is a great feature.
- `#if 0`s render as comments in some editors, and then bitrot because no one compiles them.
https://reviews.llvm.org/D41885
More information about the cfe-commits
mailing list