[PATCH] D5767: Template Instantiation Observer + a few other templight-related changes
sabel83 updated this revision to Diff 119377. sabel83 added reviewers: cfe-commits, klimek, mclow.lists, martong, xazax.hun. https://reviews.llvm.org/D5767 Files: include/clang/Driver/CC1Options.td include/clang/Frontend/FrontendActions.h include/clang/Frontend/FrontendOptions.h include/clang/FrontendTool/Utils.h include/clang/Sema/Sema.h include/clang/Sema/TemplateInstCallbacks.h lib/Frontend/CompilerInvocation.cpp lib/Frontend/FrontendActions.cpp lib/FrontendTool/ExecuteCompilerInvocation.cpp lib/Parse/ParseAST.cpp lib/Sema/Sema.cpp lib/Sema/SemaTemplateInstantiate.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp lib/Sema/SemaType.cpp test/Sema/templight-deduced-func.cpp test/Sema/templight-default-arg-inst.cpp test/Sema/templight-default-func-arg.cpp test/Sema/templight-default-template-arg.cpp test/Sema/templight-exception-spec-func.cpp test/Sema/templight-explicit-template-arg.cpp test/Sema/templight-memoization.cpp test/Sema/templight-nested-memoization.cpp test/Sema/templight-nested-template-instantiation.cpp test/Sema/templight-one-instantiation.cpp test/Sema/templight-prior-template-arg.cpp tools/CMakeLists.txt Index: tools/CMakeLists.txt === --- tools/CMakeLists.txt +++ tools/CMakeLists.txt @@ -34,3 +34,4 @@ # libclang may require clang-tidy in clang-tools-extra. add_clang_subdirectory(libclang) +add_subdirectory(templight) Index: test/Sema/templight-prior-template-arg.cpp === --- /dev/null +++ test/Sema/templight-prior-template-arg.cpp @@ -0,0 +1,62 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s +template +class A {}; + +template class Outer> +class B {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+50]]{{:1'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+45]]{{:1'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+39]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+34]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+28]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+23]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+17]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+12]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+6]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+1]]{{:6'$}} +B b; Index: test/Sema/templight-one-instantiation.cpp === --- /dev/null +++ test/Sema/templight-one-instantiation.cpp @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s + +template +struct foo {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-one-instantiation.cpp:}}[[@LINE+6]]{{:10'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-one-instantiation.cpp:}}[[@LINE+1]]{{:10'$}} +foo x; Index: test/Sema/templight-nested-template-instantiation.cpp === --- /dev/null +++ test/Sema/templight-nested-template-instantiation.cpp @@ -0,0 +1,72 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s
[PATCH] D5767: Template Instantiation Observer + a few other templight-related changes
sabel83 updated this revision to Diff 119774. https://reviews.llvm.org/D5767 Files: include/clang/Driver/CC1Options.td include/clang/Frontend/FrontendActions.h include/clang/Frontend/FrontendOptions.h include/clang/FrontendTool/Utils.h include/clang/Sema/Sema.h include/clang/Sema/TemplateInstCallback.h lib/Frontend/CompilerInvocation.cpp lib/Frontend/FrontendActions.cpp lib/FrontendTool/ExecuteCompilerInvocation.cpp lib/Parse/ParseAST.cpp lib/Sema/Sema.cpp lib/Sema/SemaTemplateInstantiate.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp lib/Sema/SemaType.cpp test/Sema/templight-deduced-func.cpp test/Sema/templight-default-arg-inst.cpp test/Sema/templight-default-func-arg.cpp test/Sema/templight-default-template-arg.cpp test/Sema/templight-exception-spec-func.cpp test/Sema/templight-explicit-template-arg.cpp test/Sema/templight-memoization.cpp test/Sema/templight-nested-memoization.cpp test/Sema/templight-nested-template-instantiation.cpp test/Sema/templight-one-instantiation.cpp test/Sema/templight-prior-template-arg.cpp tools/CMakeLists.txt Index: tools/CMakeLists.txt === --- tools/CMakeLists.txt +++ tools/CMakeLists.txt @@ -35,3 +35,4 @@ # libclang may require clang-tidy in clang-tools-extra. add_clang_subdirectory(libclang) +add_subdirectory(templight) Index: test/Sema/templight-prior-template-arg.cpp === --- test/Sema/templight-prior-template-arg.cpp +++ test/Sema/templight-prior-template-arg.cpp @@ -0,0 +1,62 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s +template +class A {}; + +template class Outer> +class B {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+50]]{{:1'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+45]]{{:1'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+39]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+34]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+28]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+23]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+17]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+12]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+6]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+1]]{{:6'$}} +B b; Index: test/Sema/templight-one-instantiation.cpp === --- test/Sema/templight-one-instantiation.cpp +++ test/Sema/templight-one-instantiation.cpp @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s + +template +struct foo {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-one-instantiation.cpp:}}[[@LINE+6]]{{:10'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-one-instantiation.cpp:}}[[@LINE+1]]{{:10'$}} +foo x; Index: test/Sema/templight-nested-template-instantiation.cpp === --- test/Sema/templight-nested-template-instantiation.cpp +++ test/Sema/templight-nested-template-instantiation.cpp @@ -0,0 +1,72 @@ +// RUN: %clang_cc1 -templight
[PATCH] D5767: Template Instantiation Observer + a few other templight-related changes
sabel83 added a comment. I've updated the patch based on your comments. https://reviews.llvm.org/D5767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D5767: Template Instantiation Observer + a few other templight-related changes
sabel83 added a comment. This pull requests consists of two parts: a) a hook, which is called during template instantiation events b) a callback, which dumps the details of the events out to standard output Tools like Templight (https://github.com/mikael-s-persson/templight) rely on the hook. The callback is available to make it testable (see the tests, which are part of the pull request) and can be used as a simple way of querying some information about template instantiations if needed. 1. Testing on larger software: Templight is based on the hook and Metashell (http://metashell.org) is using Templight intensively. We have a branch of Metashell using the YAML output for template debugging (https://github.com/sabel83/metashell/tree/use_templight_dump). 2. What do you mean by regression tests? We have run the clang-test target successfully on the patched code (which has the hook). Note that the hook this pull request provides is implemented as a ProgramAction. It is not intended to be used together with other program actions, I don't see how we could turn it on for other tests (if that is what you referred to). https://reviews.llvm.org/D5767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D5767: Template Instantiation Observer + a few other templight-related changes
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(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 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D5767: Template Instantiation Observer + a few other templight-related changes
sabel83 updated this revision to Diff 133400. sabel83 marked an inline comment as done. https://reviews.llvm.org/D5767 Files: include/clang/Driver/CC1Options.td include/clang/Frontend/FrontendActions.h include/clang/Frontend/FrontendOptions.h include/clang/FrontendTool/Utils.h include/clang/Sema/Sema.h include/clang/Sema/TemplateInstCallback.h lib/Frontend/CompilerInvocation.cpp lib/Frontend/FrontendActions.cpp lib/FrontendTool/ExecuteCompilerInvocation.cpp lib/Parse/ParseAST.cpp lib/Sema/Sema.cpp lib/Sema/SemaTemplateInstantiate.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp lib/Sema/SemaType.cpp test/Templight/templight-deduced-func.cpp test/Templight/templight-default-arg-inst.cpp test/Templight/templight-default-func-arg.cpp test/Templight/templight-default-template-arg.cpp test/Templight/templight-exception-spec-func.cpp test/Templight/templight-explicit-template-arg.cpp test/Templight/templight-memoization.cpp test/Templight/templight-nested-memoization.cpp test/Templight/templight-nested-template-instantiation.cpp test/Templight/templight-one-instantiation.cpp test/Templight/templight-prior-template-arg.cpp Index: test/Templight/templight-prior-template-arg.cpp === --- test/Templight/templight-prior-template-arg.cpp +++ test/Templight/templight-prior-template-arg.cpp @@ -0,0 +1,72 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s +template +class A {}; + +template class Outer> +class B {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:5:40'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:1'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:5:40'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:1'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:6'$}} +B b; Index: test/Templight/templight-one-instantiation.cpp === --- test/Templight/templight-one-instantiation.cpp +++ test/Templight/templight-one-instantiation.cpp @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s + +template +struct foo {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^orig:[ ]+'.*templight-one-instantiation.cpp:4:8'}} +// CHECK: {{^poi:[ ]+'.*templight-one-instantiation.cpp:18:10'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^eve
[PATCH] D5767: Template Instantiation Observer + a few other templight-related changes
sabel83 updated this revision to Diff 133614. https://reviews.llvm.org/D5767 Files: include/clang/Driver/CC1Options.td include/clang/Frontend/FrontendActions.h include/clang/Frontend/FrontendOptions.h include/clang/FrontendTool/Utils.h include/clang/Sema/Sema.h include/clang/Sema/TemplateInstCallback.h lib/Frontend/CompilerInvocation.cpp lib/Frontend/FrontendActions.cpp lib/FrontendTool/ExecuteCompilerInvocation.cpp lib/Parse/ParseAST.cpp lib/Sema/Sema.cpp lib/Sema/SemaTemplateInstantiate.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp lib/Sema/SemaType.cpp test/Templight/templight-deduced-func.cpp test/Templight/templight-default-arg-inst.cpp test/Templight/templight-default-func-arg.cpp test/Templight/templight-default-template-arg.cpp test/Templight/templight-exception-spec-func.cpp test/Templight/templight-explicit-template-arg.cpp test/Templight/templight-memoization.cpp test/Templight/templight-nested-memoization.cpp test/Templight/templight-nested-template-instantiation.cpp test/Templight/templight-one-instantiation.cpp test/Templight/templight-prior-template-arg.cpp Index: test/Templight/templight-prior-template-arg.cpp === --- test/Templight/templight-prior-template-arg.cpp +++ test/Templight/templight-prior-template-arg.cpp @@ -0,0 +1,72 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s +template +class A {}; + +template class Outer> +class B {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:5:40'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:1'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:5:40'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:1'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:72:6'$}} +B b; Index: test/Templight/templight-one-instantiation.cpp === --- test/Templight/templight-one-instantiation.cpp +++ test/Templight/templight-one-instantiation.cpp @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s + +template +struct foo {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^orig:[ ]+'.*templight-one-instantiation.cpp:4:8'}} +// CHECK: {{^poi:[ ]+'.*templight-one-instantiation.cpp:18:10'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^orig:[ ]+'.*te
[PATCH] D5767: Template Instantiation Observer + a few other templight-related changes
sabel83 updated this revision to Diff 125272. sabel83 marked an inline comment as done. https://reviews.llvm.org/D5767 Files: include/clang/Driver/CC1Options.td include/clang/Frontend/FrontendActions.h include/clang/Frontend/FrontendOptions.h include/clang/FrontendTool/Utils.h include/clang/Sema/Sema.h include/clang/Sema/TemplateInstCallback.h lib/Frontend/CompilerInvocation.cpp lib/Frontend/FrontendActions.cpp lib/FrontendTool/ExecuteCompilerInvocation.cpp lib/Parse/ParseAST.cpp lib/Sema/Sema.cpp lib/Sema/SemaTemplateInstantiate.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp lib/Sema/SemaType.cpp test/Templight/templight-deduced-func.cpp test/Templight/templight-default-arg-inst.cpp test/Templight/templight-default-func-arg.cpp test/Templight/templight-default-template-arg.cpp test/Templight/templight-exception-spec-func.cpp test/Templight/templight-explicit-template-arg.cpp test/Templight/templight-memoization.cpp test/Templight/templight-nested-memoization.cpp test/Templight/templight-nested-template-instantiation.cpp test/Templight/templight-one-instantiation.cpp test/Templight/templight-prior-template-arg.cpp Index: test/Templight/templight-prior-template-arg.cpp === --- test/Templight/templight-prior-template-arg.cpp +++ test/Templight/templight-prior-template-arg.cpp @@ -0,0 +1,62 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s +template +class A {}; + +template class Outer> +class B {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+50]]{{:1'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+45]]{{:1'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+39]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+34]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+28]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+23]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+17]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+12]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+6]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+1]]{{:6'$}} +B b; Index: test/Templight/templight-one-instantiation.cpp === --- test/Templight/templight-one-instantiation.cpp +++ test/Templight/templight-one-instantiation.cpp @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s + +template +struct foo {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-one-instantiation.cpp:}}[[@LINE+6]]{{:10'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-one-instantiation.cpp:}}[[@LINE+1]]{{:10'$}} +foo x; Index: test/Templight/templight-nested-template-instantiation.cpp === --- test/Templight/templight-nested-template-instantiation.cpp +++ test/Templight/templight-nested-template-instantiation.cpp @@ -0,0 +1,72 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s + +template +struct foo : foo {}; + +template <> +struct foo<0> {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo<2>'$}} +// C
[PATCH] D5767: Template Instantiation Observer + a few other templight-related changes
sabel83 marked 2 inline comments as done. sabel83 added a comment. I have extended the context as suggested. https://reviews.llvm.org/D5767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D5767: Template Instantiation Observer + a few other templight-related changes
sabel83 updated this revision to Diff 120358. sabel83 marked 2 inline comments as done. https://reviews.llvm.org/D5767 Files: include/clang/Driver/CC1Options.td include/clang/Frontend/FrontendActions.h include/clang/Frontend/FrontendOptions.h include/clang/FrontendTool/Utils.h include/clang/Sema/Sema.h include/clang/Sema/TemplateInstCallback.h lib/Frontend/CompilerInvocation.cpp lib/Frontend/FrontendActions.cpp lib/FrontendTool/ExecuteCompilerInvocation.cpp lib/Parse/ParseAST.cpp lib/Sema/Sema.cpp lib/Sema/SemaTemplateInstantiate.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp lib/Sema/SemaType.cpp test/Sema/templight-deduced-func.cpp test/Sema/templight-default-arg-inst.cpp test/Sema/templight-default-func-arg.cpp test/Sema/templight-default-template-arg.cpp test/Sema/templight-exception-spec-func.cpp test/Sema/templight-explicit-template-arg.cpp test/Sema/templight-memoization.cpp test/Sema/templight-nested-memoization.cpp test/Sema/templight-nested-template-instantiation.cpp test/Sema/templight-one-instantiation.cpp test/Sema/templight-prior-template-arg.cpp tools/CMakeLists.txt Index: tools/CMakeLists.txt === --- tools/CMakeLists.txt +++ tools/CMakeLists.txt @@ -35,3 +35,4 @@ # libclang may require clang-tidy in clang-tools-extra. add_clang_subdirectory(libclang) +add_subdirectory(templight) Index: test/Sema/templight-prior-template-arg.cpp === --- test/Sema/templight-prior-template-arg.cpp +++ test/Sema/templight-prior-template-arg.cpp @@ -0,0 +1,62 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s +template +class A {}; + +template class Outer> +class B {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+50]]{{:1'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+45]]{{:1'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+39]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+34]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+28]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+23]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+17]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+12]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+6]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+1]]{{:6'$}} +B b; Index: test/Sema/templight-one-instantiation.cpp === --- test/Sema/templight-one-instantiation.cpp +++ test/Sema/templight-one-instantiation.cpp @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s + +template +struct foo {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-one-instantiation.cpp:}}[[@LINE+6]]{{:10'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-one-instantiation.cpp:}}[[@LINE+1]]{{:10'$}} +foo x; Index: test/Sema/templight-nested-template-instantiation.cpp === --- test/Sema/templight-nested-template-instantiation.cpp +++ test/Sema/templight-nested-template-instantiation.cpp @@ -0
[PATCH] D38818: Template Instantiation Observer + a few other templight-related changes
sabel83 updated this revision to Diff 122324. https://reviews.llvm.org/D38818 Files: include/clang/Driver/CC1Options.td include/clang/Frontend/FrontendActions.h include/clang/Frontend/FrontendOptions.h include/clang/FrontendTool/Utils.h include/clang/Sema/Sema.h include/clang/Sema/TemplateInstCallback.h lib/Frontend/CompilerInvocation.cpp lib/Frontend/FrontendActions.cpp lib/FrontendTool/ExecuteCompilerInvocation.cpp lib/Parse/ParseAST.cpp lib/Sema/Sema.cpp lib/Sema/SemaTemplateInstantiate.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp lib/Sema/SemaType.cpp test/Templight/templight-deduced-func.cpp test/Templight/templight-default-arg-inst.cpp test/Templight/templight-default-func-arg.cpp test/Templight/templight-default-template-arg.cpp test/Templight/templight-exception-spec-func.cpp test/Templight/templight-explicit-template-arg.cpp test/Templight/templight-memoization.cpp test/Templight/templight-nested-memoization.cpp test/Templight/templight-nested-template-instantiation.cpp test/Templight/templight-one-instantiation.cpp test/Templight/templight-prior-template-arg.cpp Index: test/Templight/templight-prior-template-arg.cpp === --- test/Templight/templight-prior-template-arg.cpp +++ test/Templight/templight-prior-template-arg.cpp @@ -0,0 +1,62 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s +template +class A {}; + +template class Outer> +class B {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+50]]{{:1'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+45]]{{:1'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+39]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+34]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+28]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+23]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+17]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+12]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+6]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+1]]{{:6'$}} +B b; Index: test/Templight/templight-one-instantiation.cpp === --- test/Templight/templight-one-instantiation.cpp +++ test/Templight/templight-one-instantiation.cpp @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s + +template +struct foo {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-one-instantiation.cpp:}}[[@LINE+6]]{{:10'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-one-instantiation.cpp:}}[[@LINE+1]]{{:10'$}} +foo x; Index: test/Templight/templight-nested-template-instantiation.cpp === --- test/Templight/templight-nested-template-instantiation.cpp +++ test/Templight/templight-nested-template-instantiation.cpp @@ -0,0 +1,72 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s + +template +struct foo : foo {}; + +template <> +struct foo<0> {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo<2>'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}
[PATCH] D38818: Template Instantiation Observer + a few other templight-related changes
sabel83 marked an inline comment as done. sabel83 added a comment. I have moved the tests into their own directory in the last update. Comment at: tools/CMakeLists.txt:37 add_clang_subdirectory(libclang) +add_subdirectory(templight) rsmith wrote: > Did you mean to include this in this patch? There's no such directory added > here. (Should this be an `add_llvm_external_project`, to pick up some > external project if it's checked out here?) It is a reference to a utility based on this patch. The utility has not been finished yet, so I have removed that line. https://reviews.llvm.org/D38818 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D38818: Template Instantiation Observer + a few other templight-related changes
sabel83 marked an inline comment as done. sabel83 added a comment. The last update of the patch also contains the changes to this pull request based on comments from https://reviews.llvm.org/D5767. https://reviews.llvm.org/D38818 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D5767: Template Instantiation Observer + a few other templight-related changes
sabel83 updated this revision to Diff 122325. sabel83 marked an inline comment as done. https://reviews.llvm.org/D5767 Files: include/clang/Driver/CC1Options.td include/clang/Frontend/FrontendActions.h include/clang/Frontend/FrontendOptions.h include/clang/FrontendTool/Utils.h include/clang/Sema/Sema.h include/clang/Sema/TemplateInstCallback.h lib/Frontend/CompilerInvocation.cpp lib/Frontend/FrontendActions.cpp lib/FrontendTool/ExecuteCompilerInvocation.cpp lib/Parse/ParseAST.cpp lib/Sema/Sema.cpp lib/Sema/SemaTemplateInstantiate.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp lib/Sema/SemaType.cpp test/Templight/templight-deduced-func.cpp test/Templight/templight-default-arg-inst.cpp test/Templight/templight-default-func-arg.cpp test/Templight/templight-default-template-arg.cpp test/Templight/templight-exception-spec-func.cpp test/Templight/templight-explicit-template-arg.cpp test/Templight/templight-memoization.cpp test/Templight/templight-nested-memoization.cpp test/Templight/templight-nested-template-instantiation.cpp test/Templight/templight-one-instantiation.cpp test/Templight/templight-prior-template-arg.cpp Index: test/Templight/templight-prior-template-arg.cpp === --- test/Templight/templight-prior-template-arg.cpp +++ test/Templight/templight-prior-template-arg.cpp @@ -0,0 +1,62 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s +template +class A {}; + +template class Outer> +class B {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+50]]{{:1'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+45]]{{:1'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+39]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+34]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+28]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+23]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+17]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+12]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+6]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+1]]{{:6'$}} +B b; Index: test/Templight/templight-one-instantiation.cpp === --- test/Templight/templight-one-instantiation.cpp +++ test/Templight/templight-one-instantiation.cpp @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s + +template +struct foo {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-one-instantiation.cpp:}}[[@LINE+6]]{{:10'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-one-instantiation.cpp:}}[[@LINE+1]]{{:10'$}} +foo x; Index: test/Templight/templight-nested-template-instantiation.cpp === --- test/Templight/templight-nested-template-instantiation.cpp +++ test/Templight/templight-nested-template-instantiation.cpp @@ -0,0 +1,72 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s + +template +struct foo : foo {}; + +template <> +struct foo<0> {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo<2>'$}} +// C
[PATCH] D5767: Template Instantiation Observer + a few other templight-related changes
sabel83 added a comment. In https://reviews.llvm.org/D5767#920085, @rsmith wrote: > I'm not entirely sure what's happening with this and > https://reviews.llvm.org/D38818, but the direction looks good to me, and I > left a couple of comments on the other review thread. This was the original pull request. I created https://reviews.llvm.org/D38818 when I didn't know how to update this one (it was originally created by Mikael, not me). I have updated https://reviews.llvm.org/D38818 and this one as well based on the comments, so both pull requests have the same code now (and I'll cancel the one that does not get merged). https://reviews.llvm.org/D5767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D5767: Template Instantiation Observer + a few other templight-related changes
sabel83 updated this revision to Diff 123465. Herald added a subscriber: rnkovacs. https://reviews.llvm.org/D5767 Files: include/clang/Driver/CC1Options.td include/clang/Frontend/FrontendActions.h include/clang/Frontend/FrontendOptions.h include/clang/FrontendTool/Utils.h include/clang/Sema/Sema.h include/clang/Sema/TemplateInstCallback.h lib/Frontend/CompilerInvocation.cpp lib/Frontend/FrontendActions.cpp lib/FrontendTool/ExecuteCompilerInvocation.cpp lib/Parse/ParseAST.cpp lib/Sema/Sema.cpp lib/Sema/SemaTemplateInstantiate.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp lib/Sema/SemaType.cpp test/Templight/templight-deduced-func.cpp test/Templight/templight-default-arg-inst.cpp test/Templight/templight-default-func-arg.cpp test/Templight/templight-default-template-arg.cpp test/Templight/templight-exception-spec-func.cpp test/Templight/templight-explicit-template-arg.cpp test/Templight/templight-memoization.cpp test/Templight/templight-nested-memoization.cpp test/Templight/templight-nested-template-instantiation.cpp test/Templight/templight-one-instantiation.cpp test/Templight/templight-prior-template-arg.cpp Index: test/Templight/templight-prior-template-arg.cpp === --- test/Templight/templight-prior-template-arg.cpp +++ test/Templight/templight-prior-template-arg.cpp @@ -0,0 +1,62 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s +template +class A {}; + +template class Outer> +class B {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+50]]{{:1'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+45]]{{:1'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+39]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+34]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+28]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+23]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+17]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+12]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+6]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+1]]{{:6'$}} +B b; Index: test/Templight/templight-one-instantiation.cpp === --- test/Templight/templight-one-instantiation.cpp +++ test/Templight/templight-one-instantiation.cpp @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s + +template +struct foo {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^poi:[ ]+'.*templight-one-instantiation.cpp:}}[[@LINE+6]]{{:10'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^poi:[ ]+'.*templight-one-instantiation.cpp:}}[[@LINE+1]]{{:10'$}} +foo x; Index: test/Templight/templight-nested-template-instantiation.cpp === --- test/Templight/templight-nested-template-instantiation.cpp +++ test/Templight/templight-nested-template-instantiation.cpp @@ -0,0 +1,72 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s + +template +struct foo : foo {}; + +template <> +struct foo<0> {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo<2>'$}} +// CHECK:
[PATCH] D5767: Template Instantiation Observer + a few other templight-related changes
sabel83 added a comment. I have no commit access, please commit the patch for me. https://reviews.llvm.org/D5767 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D5767: Template Instantiation Observer + a few other templight-related changes
sabel83 updated this revision to Diff 132778. https://reviews.llvm.org/D5767 Files: include/clang/Driver/CC1Options.td include/clang/Frontend/FrontendActions.h include/clang/Frontend/FrontendOptions.h include/clang/FrontendTool/Utils.h include/clang/Sema/Sema.h include/clang/Sema/TemplateInstCallback.h lib/Frontend/CompilerInvocation.cpp lib/Frontend/FrontendActions.cpp lib/FrontendTool/ExecuteCompilerInvocation.cpp lib/Parse/ParseAST.cpp lib/Sema/Sema.cpp lib/Sema/SemaTemplateInstantiate.cpp lib/Sema/SemaTemplateInstantiateDecl.cpp lib/Sema/SemaType.cpp test/Templight/templight-deduced-func.cpp test/Templight/templight-default-arg-inst.cpp test/Templight/templight-default-func-arg.cpp test/Templight/templight-default-template-arg.cpp test/Templight/templight-exception-spec-func.cpp test/Templight/templight-explicit-template-arg.cpp test/Templight/templight-memoization.cpp test/Templight/templight-nested-memoization.cpp test/Templight/templight-nested-template-instantiation.cpp test/Templight/templight-one-instantiation.cpp test/Templight/templight-prior-template-arg.cpp Index: test/Templight/templight-prior-template-arg.cpp === --- test/Templight/templight-prior-template-arg.cpp +++ test/Templight/templight-prior-template-arg.cpp @@ -0,0 +1,72 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s +template +class A {}; + +template class Outer> +class B {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:5:40'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+50]]{{:1'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B::Outer'$}} +// CHECK: {{^kind:[ ]+PriorTemplateArgumentSubstitution$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:5:40'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+45]]{{:1'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+39]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+34]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+28]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+23]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+17]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+12]]{{:6'$}} +// +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+6]]{{:6'$}} +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'B'$}} +// CHECK: {{^kind:[ ]+Memoization$}} +// CHECK: {{^event:[ ]+End$}} +// CHECK: {{^orig:[ ]+'.*templight-prior-template-arg.cpp:6:7'}} +// CHECK: {{^poi:[ ]+'.*templight-prior-template-arg.cpp:}}[[@LINE+1]]{{:6'$}} +B b; Index: test/Templight/templight-one-instantiation.cpp === --- test/Templight/templight-one-instantiation.cpp +++ test/Templight/templight-one-instantiation.cpp @@ -0,0 +1,18 @@ +// RUN: %clang_cc1 -templight-dump %s 2>&1 | FileCheck %s + +template +struct foo {}; + +// CHECK-LABEL: {{^---$}} +// CHECK: {{^name:[ ]+'foo'$}} +// CHECK: {{^kind:[ ]+TemplateInstantiation$}} +// CHECK: {{^event:[ ]+Begin$}} +// CHECK: {{^orig:[ ]+'.*templight-one-instantiation.cpp:4:8'}} +// CHECK: {{^poi:[ ]+'.*templight-one-instantiation.cpp:18:10'$}} +// CHECK-LABEL: {{^---$}} +
[PATCH] D115521: [Templight] Don't display empty strings for names of unnamed template parameters
sabel83 added inline comments. Comment at: clang/lib/Frontend/FrontendActions.cpp:554 + +llvm_unreachable("Failed to retrieve a name for this entry!"); + } Have you considered generating some default text here? In case a new, uncovered case does not get covered here in the future generating something like `unknown type` can keep the overall output (apart from this type) usable until the bug gets fixed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115521/new/ https://reviews.llvm.org/D115521 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits