summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/ASTUnit.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-08-16 16:46:30 +0000
committerDouglas Gregor <dgregor@apple.com>2010-08-16 16:46:30 +0000
commit247474085efd989f67186ca8668a20a72f9ecfb9 (patch)
tree1c25678586409ebca49ee672130e5203f3f7fbf5 /clang/lib/Frontend/ASTUnit.cpp
parent57825eea36177da7f9f941bc784d7f3c9824d36e (diff)
downloadbcm5719-llvm-247474085efd989f67186ca8668a20a72f9ecfb9.tar.gz
bcm5719-llvm-247474085efd989f67186ca8668a20a72f9ecfb9.zip
Dereferencing NULL pointers is such poor form.
llvm-svn: 111150
Diffstat (limited to 'clang/lib/Frontend/ASTUnit.cpp')
-rw-r--r--clang/lib/Frontend/ASTUnit.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index a573fb41ab6..b54162f8d7d 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -191,10 +191,14 @@ void ASTUnit::CacheCodeCompletionResults() {
Ctx->getLangOptions());
CachedResult.Priority = Results[I].Priority;
CachedResult.Kind = Results[I].CursorKind;
- CachedResult.TypeClass
- = getSimplifiedTypeClass(
- Ctx->getCanonicalType(getDeclUsageType(*Ctx,
- Results[I].Declaration)));
+
+ QualType UsageType = getDeclUsageType(*Ctx, Results[I].Declaration);
+ if (UsageType.isNull())
+ CachedResult.TypeClass = STC_Void;
+ else {
+ CachedResult.TypeClass
+ = getSimplifiedTypeClass(Ctx->getCanonicalType(UsageType));
+ }
CachedCompletionResults.push_back(CachedResult);
break;
}
OpenPOWER on IntegriCloud