[LLVMdev] DEBUG
Dominic Hamon
dom.hamon at gmail.com
Mon Jul 7 17:49:37 PDT 2008
On Jul 8, 2008, at 4:57 AM, Chris Lattner wrote:
> On Mon, 7 Jul 2008, David Greene wrote:
>>> Since I think it really is a part of the LLVM internals, I don't
>>> think
>>> that mangling it with a prefix is the right way to go. This would
>>> significantly increase verbosity in the code and would be generally
>>> detrimental.
>>
>> Verbose, yes, but "generally detrimental?" That's a pretty strong
>> statement.
>
> More specifically, this impacts the tyranical :) 80 column limit we
> have:
>
>
> DEBUG(cout << "whatever stuff here" << yeah << "ok");
>
> is much more clear to me than:
>
> LLVM_DEBUG(cout << "whatever stuff here"
> << yeah << "ok");
>
> To be specific, excess wrapping and clutter is what I would find
> detrimental.
I completely agree with this point, but then aren't you trading off
one aspect of clarity for another? It is a problem with the C
preprocessor that hits many projects and the equivalent to the
namespace solution for macros is to add a prefix specific to the
project. Ie, use LLVM_DEBUG rather than DEBUG.
The issue of clutter and excess wrapping is a secondary issue as much
of the code in LLVM already is excessively wrapped and, to my eyes,
borderline unreadable.
At the risk of starting a major thread that has surely been covered
many times before: Is there a reason to still cling to the 80 column
limit and not consider expanding it to a controversial 100 columns?
Dominic
More information about the llvm-dev
mailing list