[LLVMdev] DEBUG_TYPE
Pete Cooper
peter_cooper at apple.com
Fri Jul 3 14:20:37 PDT 2015
Sent from my iPhone
> On Jul 3, 2015, at 2:05 PM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
>
>
>> On 2015-Jul-03, at 13:53, Philip Reames <listmail at philipreames.com> wrote:
>>
>> No. DEBUG_TYPE is used for grouping debug output and statistics. The DEBUG_TYPE belongs in the source file. The fact it's in the other headers is suspicious and might be worth checking on.
>
> Might be. I think it sometimes makes sense.
>
>> Philip
>>
>>> On 07/03/2015 01:09 PM, Peter Finn wrote:
>>> In include/llvm/ADT/Statistic.h, the identifier “DEBUG_TYPE” is never defined. I’ve noticed it’s defined as different things in a few other header files, including llvm/Analysis/BlockFrequencyInfoImpl.h,
>
> FWIW, this one really is a BFI implementation file:
> --
> $ git grep -l llvm/Analysis/BlockFrequencyInfoImpl.h
> lib/Analysis/BlockFrequencyInfo.cpp
> lib/Analysis/BlockFrequencyInfoImpl.cpp
> lib/CodeGen/MachineBlockFrequencyInfo.cpp
> --
> (Maybe it should get moved to lib/Analysis, and MBFI can access it
> via a relative path like `../Analysis/`? I'm not clear on the
> tradeoffs.)
>
> It has template functions that want `DEBUG()` statements, and all
> three want to use `block-freq`.
>
> Haven't looked at the others you mentioned, but they could be
> similar.
I believe there's also a DEBUG_WITH_TYPE which allows a specific invocation of DEBUG() to use the given type. Perhaps headers should be required to use that and headers shouldn't be allowed to define DEBUG_TYPE?
Pete
>
>>> llvm/Analysis/RegionInfoImpl.h, llvm/Support/UnicodeCharRanges.h, llvm/Transforms/InstCombine/InstCombineWorkList.h, and llvm/Transforms/Utils/SSAUpdaterImpl.h. Should I edit Statistic.h so that it includes one of those? If so, which one? If not, what should I do?
>>>
>>> Thanks,
>>> Peter Finn
>>> _______________________________________________
>>> LLVM Developers mailing list
>>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list