diff options
Diffstat (limited to 'clang/lib/AST/StmtDumper.cpp')
-rw-r--r-- | clang/lib/AST/StmtDumper.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/clang/lib/AST/StmtDumper.cpp b/clang/lib/AST/StmtDumper.cpp index f11536f9c2d..c3ce92de60b 100644 --- a/clang/lib/AST/StmtDumper.cpp +++ b/clang/lib/AST/StmtDumper.cpp @@ -83,12 +83,14 @@ namespace { void DumpType(QualType T) { fprintf(F, "'%s'", T.getAsString().c_str()); - // If the type is directly a typedef, strip off typedefness to give at - // least one level of concreteness. - if (TypedefType *TDT = dyn_cast<TypedefType>(T)) { - QualType Simplified = - TDT->LookThroughTypedefs().getQualifiedType(T.getCVRQualifiers()); - fprintf(F, ":'%s'", Simplified.getAsString().c_str()); + if (!T.isNull()) { + // If the type is directly a typedef, strip off typedefness to give at + // least one level of concreteness. + if (TypedefType *TDT = dyn_cast<TypedefType>(T)) { + QualType Simplified = + TDT->LookThroughTypedefs().getQualifiedType(T.getCVRQualifiers()); + fprintf(F, ":'%s'", Simplified.getAsString().c_str()); + } } } void DumpStmt(const Stmt *Node) { |