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 | 0f6931a2c2cf7f19bab07ab752dfd632d8494205 (patch) | |
tree | ba4d8f351311a74bb0a58f17875ca709ee8523fa /lib | |
parent | 1c931be1873f8c20cdcb5060c84570cd3359aa02 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153884 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/StmtProfile.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/AST/StmtProfile.cpp b/lib/AST/StmtProfile.cpp index c999ed4526..e5526cea74 100644 --- a/lib/AST/StmtProfile.cpp +++ b/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()); |