]> granicus.if.org Git - clang/commitdiff
Remove no-op checks for a null CodeCompleter. We have already
authorChandler Carruth <chandlerc@gmail.com>
Fri, 4 Nov 2016 06:06:50 +0000 (06:06 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 4 Nov 2016 06:06:50 +0000 (06:06 +0000)
dereferenced the pointer at this point, and these routines are
exclusively called after the parser encounters a code completion token.
Other code completion routines called at that point do not check for
null either, so this is clearly the current invariant expected in the
code.

This fixes another PVS-Studio found issue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285980 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaCodeComplete.cpp

index a0e79f6c3761ebac535585e8acbd90ddeba37ef7..f2b85b6da8721e390a78d81cac2b46372a5a6c6c 100644 (file)
@@ -6034,7 +6034,7 @@ void Sema::CodeCompleteObjCProtocolReferences(
                         CodeCompleter->getCodeCompletionTUInfo(),
                         CodeCompletionContext::CCC_ObjCProtocolName);
   
-  if (CodeCompleter && CodeCompleter->includeGlobals()) {
+  if (CodeCompleter->includeGlobals()) {
     Results.EnterNewScope();
     
     // Tell the result set to ignore all of the protocols we have
@@ -6062,7 +6062,7 @@ void Sema::CodeCompleteObjCProtocolDecl(Scope *) {
                         CodeCompleter->getCodeCompletionTUInfo(),
                         CodeCompletionContext::CCC_ObjCProtocolName);
   
-  if (CodeCompleter && CodeCompleter->includeGlobals()) {
+  if (CodeCompleter->includeGlobals()) {
     Results.EnterNewScope();
     
     // Add all protocols.