[PATCH] D47663: Add a debug dump for DbgValueHistoryMap

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 1 15:33:11 PDT 2018



> On Jun 1, 2018, at 3:31 PM, Vedant Kumar <vsk at apple.com> wrote:
> 
> 
> 
>> On Jun 1, 2018, at 3:27 PM, Adrian Prantl via Phabricator <reviews at reviews.llvm.org> wrote:
>> 
>> aprantl accepted this revision.
>> aprantl added inline comments.
>> This revision is now accepted and ready to land.
>> 
>> 
>> ================
>> Comment at: lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.h:56
>> +
>> +#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
>> +  void dump() const;
>> ----------------
>> I vaguely recall that there is an LLVM_DUMP_FUNCTION macro for this purpose?
> 
> Unfortunately not:
> 
> If the defined operator appears as a result of a macro expansion, the C standard says the behavior is undefined.
> 
> https://gcc.gnu.org/onlinedocs/cpp/Defined.html

Ah. Also it seems to serve a different purpose as it prevents the function from being optimized away:

#define LLVM_DUMP_METHOD LLVM_ATTRIBUTE_NOINLINE

So I guess you'd want both!

-- adrian

> 
>> 
>> 
>> https://reviews.llvm.org/D47663
>> 
>> 
>> 
> 



More information about the llvm-commits mailing list