Eliminate the use of getTypeForDecl from clang_getCursorType() and
clang_getDeclObjCTypeEncoding(); use ASTContext's methods instead,
which will (lazily) create the type as needed. Otherwise, we can end
up with null QualTypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124133 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Index/print-typekind.c b/test/Index/print-typekind.c
index d521f06..fad3a2d 100644
--- a/test/Index/print-typekind.c
+++ b/test/Index/print-typekind.c
@@ -4,6 +4,7 @@
   FooType w = z;
   return p + z;
 }
+typedef double OtherType;
 
 // RUN: c-index-test -test-print-typekind %s | FileCheck %s
 // CHECK: TypedefDecl=FooType:1:13 (Definition) typekind=Typedef [canonical=Int] [isPOD=1]
@@ -22,4 +23,5 @@
 // CHECK: UnexposedExpr= typekind=Pointer [isPOD=1]
 // CHECK: DeclRefExpr=p:3:13 typekind=Pointer [isPOD=1]
 // CHECK: DeclRefExpr=z:3:33 typekind=Typedef [canonical=Int] [isPOD=1]
+// CHECK: TypedefDecl=OtherType:7:16 (Definition) typekind=Typedef [canonical=Double] [isPOD=1]