diff options
author | Richard Trieu <rtrieu@google.com> | 2018-02-13 19:53:40 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2018-02-13 19:53:40 +0000 |
commit | 4d06bef38d404253266c2e42209f6d036b04f0cc (patch) | |
tree | df84d19eb3e3229e3ed53240b2439b06118a60d9 /clang/lib/AST/StmtProfile.cpp | |
parent | 2e2958497fdeeac97f1658b6d65e916ed950421e (diff) | |
download | bcm5719-llvm-4d06bef38d404253266c2e42209f6d036b04f0cc.tar.gz bcm5719-llvm-4d06bef38d404253266c2e42209f6d036b04f0cc.zip |
Update StmtProfile.cpp to handle zero template arguments.
Treat having no templates arguments differently than having zero template
arguments when profiling.
llvm-svn: 325040
Diffstat (limited to 'clang/lib/AST/StmtProfile.cpp')
-rw-r--r-- | clang/lib/AST/StmtProfile.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp index 00ef0da18bb..08261205ef0 100644 --- a/clang/lib/AST/StmtProfile.cpp +++ b/clang/lib/AST/StmtProfile.cpp @@ -966,8 +966,11 @@ void StmtProfiler::VisitDeclRefExpr(const DeclRefExpr *S) { if (!Canonical) VisitNestedNameSpecifier(S->getQualifier()); VisitDecl(S->getDecl()); - if (!Canonical) - VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs()); + if (!Canonical) { + ID.AddBoolean(S->hasExplicitTemplateArgs()); + if (S->hasExplicitTemplateArgs()) + VisitTemplateArguments(S->getTemplateArgs(), S->getNumTemplateArgs()); + } } void StmtProfiler::VisitPredefinedExpr(const PredefinedExpr *S) { |