diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-02 18:53:24 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-02 18:53:24 +0000 |
| commit | d9a1cd8dbf2ce62597a114344d6d3824d26be75c (patch) | |
| tree | 8e8605b0fe6b2b8617cdeff502296123d32e7b4a /clang/lib | |
| parent | cf8ec8dad61c09a5b5bfd0738c0484788b1e9e3f (diff) | |
| download | bcm5719-llvm-d9a1cd8dbf2ce62597a114344d6d3824d26be75c.tar.gz bcm5719-llvm-d9a1cd8dbf2ce62597a114344d6d3824d26be75c.zip | |
PR12438: Profile a reference to a type template parameter by depth and index,
not by canonical decl. This only matters for sizeof...(Pack) expressions; in
all other cases, we'd profile it as a type instead.
llvm-svn: 153884
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/StmtProfile.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp index c999ed45260..e5526cea74a 100644 --- a/clang/lib/AST/StmtProfile.cpp +++ b/clang/lib/AST/StmtProfile.cpp @@ -1083,6 +1083,14 @@ void StmtProfiler::VisitDecl(const Decl *D) { return; } + if (const TemplateTypeParmDecl *TTP = + dyn_cast<TemplateTypeParmDecl>(D)) { + ID.AddInteger(TTP->getDepth()); + ID.AddInteger(TTP->getIndex()); + ID.AddBoolean(TTP->isParameterPack()); + return; + } + if (const TemplateTemplateParmDecl *TTP = dyn_cast<TemplateTemplateParmDecl>(D)) { ID.AddInteger(TTP->getDepth()); |

