[PATCH] D5767: Template Instantiation Observer + a few other templight-related changes

Ábel Sinkovics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 6 08:22:37 PST 2018


sabel83 marked an inline comment as done.
sabel83 added inline comments.


================
Comment at: include/clang/Driver/CC1Options.td:537
+def templight_dump : Flag<["-"], "templight-dump">,
+  HelpText<"Dump templight information to stdout">;
 def ast_dump_lookups : Flag<["-"], "ast-dump-lookups">,
----------------
xazax.hun wrote:
> Do we want to keep the templight name? I am ok with it, but I wonder if something like dump template instantiation information, or dump template profile information would be more descriptive to the newcomers.
As this patch and the related tool has already been presented and referred to as Templight, we prefer keeping the name. Examples:

https://www.youtube.com/watch?v=nUXjVVO4YlA

https://llvm.org/devmtg/2015-04/slides/EuroLLVM2015Templight.pdf

https://baptiste-wicht.com/posts/2016/02/use-templight-and-templar-to-debug-cpp-templates.html


================
Comment at: lib/Frontend/FrontendActions.cpp:319
+                               const CodeSynthesisContext &Inst) override {
+    DisplayTemplightEntry<true>(std::cout, TheSema, Inst);
+  }
----------------
xazax.hun wrote:
> `std::cout` is rarely used in LLVM. Did you consider `llvm::outs`?
> Also, do we want to output to the standard output or standard error? Is there other dump functionality that is being printed to the standard output?
We dump to standard output because the original purpose of this callback is to make the hook itself testable with FileCheck.


https://reviews.llvm.org/D5767





More information about the cfe-commits mailing list