[clang] 1e64590 - [clang][sema] - remove CodeCompleter nullptr checks
Simon Pilgrim via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 11 07:11:27 PST 2022
Author: Simon Pilgrim
Date: 2022-02-11T15:09:44Z
New Revision: 1e6459004177c8f5830e1ea5a5a62820fa6a333f
URL: https://github.com/llvm/llvm-project/commit/1e6459004177c8f5830e1ea5a5a62820fa6a333f
DIFF: https://github.com/llvm/llvm-project/commit/1e6459004177c8f5830e1ea5a5a62820fa6a333f.diff
LOG: [clang][sema] - remove CodeCompleter nullptr checks
All paths have already dereferenced the CodeCompleter pointer in the ResultBuilder constructor
Added:
Modified:
clang/lib/Sema/SemaCodeComplete.cpp
Removed:
################################################################################
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index 01fdf51c60c3..0c9bcf546da7 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -9787,7 +9787,7 @@ void Sema::CodeCompletePreprocessorMacroName(bool IsDefinition) {
CodeCompleter->getCodeCompletionTUInfo(),
IsDefinition ? CodeCompletionContext::CCC_MacroName
: CodeCompletionContext::CCC_MacroNameUse);
- if (!IsDefinition && (!CodeCompleter || CodeCompleter->includeMacros())) {
+ if (!IsDefinition && CodeCompleter->includeMacros()) {
// Add just the names of macros, not their arguments.
CodeCompletionBuilder Builder(Results.getAllocator(),
Results.getCodeCompletionTUInfo());
@@ -9814,9 +9814,8 @@ void Sema::CodeCompletePreprocessorExpression() {
CodeCompleter->getCodeCompletionTUInfo(),
CodeCompletionContext::CCC_PreprocessorExpression);
- if (!CodeCompleter || CodeCompleter->includeMacros())
- AddMacroResults(PP, Results,
- !CodeCompleter || CodeCompleter->loadExternal(), true);
+ if (CodeCompleter->includeMacros())
+ AddMacroResults(PP, Results, CodeCompleter->loadExternal(), true);
// defined (<macro>)
Results.EnterNewScope();
More information about the cfe-commits
mailing list