r285980 - Remove no-op checks for a null CodeCompleter. We have already

Chandler Carruth via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 3 23:06:50 PDT 2016


Author: chandlerc
Date: Fri Nov  4 01:06:50 2016
New Revision: 285980

URL: http://llvm.org/viewvc/llvm-project?rev=285980&view=rev
Log:
Remove no-op checks for a null CodeCompleter. We have already
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.

Modified:
    cfe/trunk/lib/Sema/SemaCodeComplete.cpp

Modified: cfe/trunk/lib/Sema/SemaCodeComplete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaCodeComplete.cpp?rev=285980&r1=285979&r2=285980&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaCodeComplete.cpp (original)
+++ cfe/trunk/lib/Sema/SemaCodeComplete.cpp Fri Nov  4 01:06:50 2016
@@ -6034,7 +6034,7 @@ void Sema::CodeCompleteObjCProtocolRefer
                         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(
                         CodeCompleter->getCodeCompletionTUInfo(),
                         CodeCompletionContext::CCC_ObjCProtocolName);
   
-  if (CodeCompleter && CodeCompleter->includeGlobals()) {
+  if (CodeCompleter->includeGlobals()) {
     Results.EnterNewScope();
     
     // Add all protocols.




More information about the cfe-commits mailing list