From: Chandler Carruth Date: Fri, 4 Nov 2016 06:06:50 +0000 (+0000) Subject: Remove no-op checks for a null CodeCompleter. We have already X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0b0e503e9c9a28574c141c1fd3f0ca8ebffeb801;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285980 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index a0e79f6c37..f2b85b6da8 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -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.