[PATCH] D48612: [ThinLTO] Print names in function import debug messages when available

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 27 10:29:32 PDT 2018


tejohnson added a comment.

In https://reviews.llvm.org/D48612#1144207, @davidxl wrote:

> Perhaps define a little helper function:
>
> #ifndef NDEBUG
>  raw_ostream& operator << (raw_ostream&, ValueInfo&VI) {
>
>    if (!VI.empty()) {
>         ....
>    }
>   return dbgs();
>
> }
>  #endif
>
> then this call can be embedded inside dbgs() << getGUID(VI) << VI << "\n";


Good idea. I made it a bit more general, so that it prints both the GUID and Name (when available), which allows it to simplify the LLVM_DEBUG invocation further.


Repository:
  rL LLVM

https://reviews.llvm.org/D48612





More information about the llvm-commits mailing list