Canonicalization for dependent typeof(expr) types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77639 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/StmtProfile.cpp b/lib/AST/StmtProfile.cpp
index 688777d..8039d97 100644
--- a/lib/AST/StmtProfile.cpp
+++ b/lib/AST/StmtProfile.cpp
@@ -602,9 +602,9 @@
 }
 
 void StmtProfiler::VisitDecl(Decl *D) {
-  if (Canonical) {
+  if (Canonical && D) {
     if (NonTypeTemplateParmDecl *NTTP 
-        = dyn_cast_or_null<NonTypeTemplateParmDecl>(D)) {
+        = dyn_cast<NonTypeTemplateParmDecl>(D)) {
       ID.AddInteger(NTTP->getDepth());
       ID.AddInteger(NTTP->getIndex());
       VisitType(NTTP->getType());