[PATCH] D126524: [CompilerInstance] Fix weird condition on `createCodeCompletionConsumer`

2022-05-27 Thread Yuki Okushi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd3d3e2528e60: [CompilerInstance] Fix weird condition on 
`createCodeCompletionConsumer` (authored by JohnTitor).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126524/new/

https://reviews.llvm.org/D126524

Files:
  clang/lib/Frontend/CompilerInstance.cpp


Index: clang/lib/Frontend/CompilerInstance.cpp
===
--- clang/lib/Frontend/CompilerInstance.cpp
+++ clang/lib/Frontend/CompilerInstance.cpp
@@ -710,13 +710,10 @@
 void CompilerInstance::createCodeCompletionConsumer() {
   const ParsedSourceLocation  = getFrontendOpts().CodeCompletionAt;
   if (!CompletionConsumer) {
-setCodeCompletionConsumer(
-  createCodeCompletionConsumer(getPreprocessor(),
-   Loc.FileName, Loc.Line, Loc.Column,
-   getFrontendOpts().CodeCompleteOpts,
-   llvm::outs()));
-if (!CompletionConsumer)
-  return;
+setCodeCompletionConsumer(createCodeCompletionConsumer(
+getPreprocessor(), Loc.FileName, Loc.Line, Loc.Column,
+getFrontendOpts().CodeCompleteOpts, llvm::outs()));
+return;
   } else if (EnableCodeCompletion(getPreprocessor(), Loc.FileName,
   Loc.Line, Loc.Column)) {
 setCodeCompletionConsumer(nullptr);


Index: clang/lib/Frontend/CompilerInstance.cpp
===
--- clang/lib/Frontend/CompilerInstance.cpp
+++ clang/lib/Frontend/CompilerInstance.cpp
@@ -710,13 +710,10 @@
 void CompilerInstance::createCodeCompletionConsumer() {
   const ParsedSourceLocation  = getFrontendOpts().CodeCompletionAt;
   if (!CompletionConsumer) {
-setCodeCompletionConsumer(
-  createCodeCompletionConsumer(getPreprocessor(),
-   Loc.FileName, Loc.Line, Loc.Column,
-   getFrontendOpts().CodeCompleteOpts,
-   llvm::outs()));
-if (!CompletionConsumer)
-  return;
+setCodeCompletionConsumer(createCodeCompletionConsumer(
+getPreprocessor(), Loc.FileName, Loc.Line, Loc.Column,
+getFrontendOpts().CodeCompleteOpts, llvm::outs()));
+return;
   } else if (EnableCodeCompletion(getPreprocessor(), Loc.FileName,
   Loc.Line, Loc.Column)) {
 setCodeCompletionConsumer(nullptr);
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D126524: [CompilerInstance] Fix weird condition on `createCodeCompletionConsumer`

2022-05-27 Thread Jan Svoboda via Phabricator via cfe-commits
jansvoboda11 added a comment.

The differential I linked doesn't contain the right diff. Here's the commit I 
meant to point out: 3a75330f573a31c7e0f7e27c5d34501c293673a5.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126524/new/

https://reviews.llvm.org/D126524

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D126524: [CompilerInstance] Fix weird condition on `createCodeCompletionConsumer`

2022-05-27 Thread Jan Svoboda via Phabricator via cfe-commits
jansvoboda11 accepted this revision.
jansvoboda11 added a comment.
This revision is now accepted and ready to land.

Nice. This is the patch that makes the condition obsolete: D60871 
. You might also remove the `else`, since the 
first `if` now has an unconditional early return.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126524/new/

https://reviews.llvm.org/D126524

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D126524: [CompilerInstance] Fix weird condition on `createCodeCompletionConsumer`

2022-05-27 Thread Yuki Okushi via Phabricator via cfe-commits
JohnTitor updated this revision to Diff 432527.
JohnTitor added a comment.

Fix the indention


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126524/new/

https://reviews.llvm.org/D126524

Files:
  clang/lib/Frontend/CompilerInstance.cpp


Index: clang/lib/Frontend/CompilerInstance.cpp
===
--- clang/lib/Frontend/CompilerInstance.cpp
+++ clang/lib/Frontend/CompilerInstance.cpp
@@ -710,13 +710,10 @@
 void CompilerInstance::createCodeCompletionConsumer() {
   const ParsedSourceLocation  = getFrontendOpts().CodeCompletionAt;
   if (!CompletionConsumer) {
-setCodeCompletionConsumer(
-  createCodeCompletionConsumer(getPreprocessor(),
-   Loc.FileName, Loc.Line, Loc.Column,
-   getFrontendOpts().CodeCompleteOpts,
-   llvm::outs()));
-if (!CompletionConsumer)
-  return;
+setCodeCompletionConsumer(createCodeCompletionConsumer(
+getPreprocessor(), Loc.FileName, Loc.Line, Loc.Column,
+getFrontendOpts().CodeCompleteOpts, llvm::outs()));
+return;
   } else if (EnableCodeCompletion(getPreprocessor(), Loc.FileName,
   Loc.Line, Loc.Column)) {
 setCodeCompletionConsumer(nullptr);


Index: clang/lib/Frontend/CompilerInstance.cpp
===
--- clang/lib/Frontend/CompilerInstance.cpp
+++ clang/lib/Frontend/CompilerInstance.cpp
@@ -710,13 +710,10 @@
 void CompilerInstance::createCodeCompletionConsumer() {
   const ParsedSourceLocation  = getFrontendOpts().CodeCompletionAt;
   if (!CompletionConsumer) {
-setCodeCompletionConsumer(
-  createCodeCompletionConsumer(getPreprocessor(),
-   Loc.FileName, Loc.Line, Loc.Column,
-   getFrontendOpts().CodeCompleteOpts,
-   llvm::outs()));
-if (!CompletionConsumer)
-  return;
+setCodeCompletionConsumer(createCodeCompletionConsumer(
+getPreprocessor(), Loc.FileName, Loc.Line, Loc.Column,
+getFrontendOpts().CodeCompleteOpts, llvm::outs()));
+return;
   } else if (EnableCodeCompletion(getPreprocessor(), Loc.FileName,
   Loc.Line, Loc.Column)) {
 setCodeCompletionConsumer(nullptr);
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D126524: [CompilerInstance] Fix weird condition on `createCodeCompletionConsumer`

2022-05-27 Thread Yuki Okushi via Phabricator via cfe-commits
JohnTitor updated this revision to Diff 432526.
JohnTitor added a comment.

[CompilerInstance] Tweak the condition on `createCodeCompletionConsumer`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126524/new/

https://reviews.llvm.org/D126524

Files:
  clang/lib/Frontend/CompilerInstance.cpp


Index: clang/lib/Frontend/CompilerInstance.cpp
===
--- clang/lib/Frontend/CompilerInstance.cpp
+++ clang/lib/Frontend/CompilerInstance.cpp
@@ -710,15 +710,12 @@
 void CompilerInstance::createCodeCompletionConsumer() {
   const ParsedSourceLocation  = getFrontendOpts().CodeCompletionAt;
   if (!CompletionConsumer) {
-setCodeCompletionConsumer(
-  createCodeCompletionConsumer(getPreprocessor(),
-   Loc.FileName, Loc.Line, Loc.Column,
-   getFrontendOpts().CodeCompleteOpts,
-   llvm::outs()));
-if (!CompletionConsumer)
-  return;
-  } else if (EnableCodeCompletion(getPreprocessor(), Loc.FileName,
-  Loc.Line, Loc.Column)) {
+setCodeCompletionConsumer(createCodeCompletionConsumer(
+getPreprocessor(), Loc.FileName, Loc.Line, Loc.Column,
+getFrontendOpts().CodeCompleteOpts, llvm::outs()));
+return;
+  } else if (EnableCodeCompletion(getPreprocessor(), Loc.FileName, Loc.Line,
+  Loc.Column)) {
 setCodeCompletionConsumer(nullptr);
 return;
   }


Index: clang/lib/Frontend/CompilerInstance.cpp
===
--- clang/lib/Frontend/CompilerInstance.cpp
+++ clang/lib/Frontend/CompilerInstance.cpp
@@ -710,15 +710,12 @@
 void CompilerInstance::createCodeCompletionConsumer() {
   const ParsedSourceLocation  = getFrontendOpts().CodeCompletionAt;
   if (!CompletionConsumer) {
-setCodeCompletionConsumer(
-  createCodeCompletionConsumer(getPreprocessor(),
-   Loc.FileName, Loc.Line, Loc.Column,
-   getFrontendOpts().CodeCompleteOpts,
-   llvm::outs()));
-if (!CompletionConsumer)
-  return;
-  } else if (EnableCodeCompletion(getPreprocessor(), Loc.FileName,
-  Loc.Line, Loc.Column)) {
+setCodeCompletionConsumer(createCodeCompletionConsumer(
+getPreprocessor(), Loc.FileName, Loc.Line, Loc.Column,
+getFrontendOpts().CodeCompleteOpts, llvm::outs()));
+return;
+  } else if (EnableCodeCompletion(getPreprocessor(), Loc.FileName, Loc.Line,
+  Loc.Column)) {
 setCodeCompletionConsumer(nullptr);
 return;
   }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D126524: [CompilerInstance] Fix weird condition on `createCodeCompletionConsumer`

2022-05-27 Thread Yuki Okushi via Phabricator via cfe-commits
JohnTitor created this revision.
Herald added a project: All.
JohnTitor requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Fixes llvm#53545


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126524

Files:
  clang/lib/Frontend/CompilerInstance.cpp


Index: clang/lib/Frontend/CompilerInstance.cpp
===
--- clang/lib/Frontend/CompilerInstance.cpp
+++ clang/lib/Frontend/CompilerInstance.cpp
@@ -710,15 +710,13 @@
 void CompilerInstance::createCodeCompletionConsumer() {
   const ParsedSourceLocation  = getFrontendOpts().CodeCompletionAt;
   if (!CompletionConsumer) {
-setCodeCompletionConsumer(
-  createCodeCompletionConsumer(getPreprocessor(),
-   Loc.FileName, Loc.Line, Loc.Column,
-   getFrontendOpts().CodeCompleteOpts,
-   llvm::outs()));
-if (!CompletionConsumer)
-  return;
-  } else if (EnableCodeCompletion(getPreprocessor(), Loc.FileName,
-  Loc.Line, Loc.Column)) {
+setCodeCompletionConsumer(createCodeCompletionConsumer(
+getPreprocessor(), Loc.FileName, Loc.Line, Loc.Column,
+getFrontendOpts().CodeCompleteOpts, llvm::outs()));
+return;
+  } else if (!CompletionConsumer &&
+ EnableCodeCompletion(getPreprocessor(), Loc.FileName, Loc.Line,
+  Loc.Column)) {
 setCodeCompletionConsumer(nullptr);
 return;
   }


Index: clang/lib/Frontend/CompilerInstance.cpp
===
--- clang/lib/Frontend/CompilerInstance.cpp
+++ clang/lib/Frontend/CompilerInstance.cpp
@@ -710,15 +710,13 @@
 void CompilerInstance::createCodeCompletionConsumer() {
   const ParsedSourceLocation  = getFrontendOpts().CodeCompletionAt;
   if (!CompletionConsumer) {
-setCodeCompletionConsumer(
-  createCodeCompletionConsumer(getPreprocessor(),
-   Loc.FileName, Loc.Line, Loc.Column,
-   getFrontendOpts().CodeCompleteOpts,
-   llvm::outs()));
-if (!CompletionConsumer)
-  return;
-  } else if (EnableCodeCompletion(getPreprocessor(), Loc.FileName,
-  Loc.Line, Loc.Column)) {
+setCodeCompletionConsumer(createCodeCompletionConsumer(
+getPreprocessor(), Loc.FileName, Loc.Line, Loc.Column,
+getFrontendOpts().CodeCompleteOpts, llvm::outs()));
+return;
+  } else if (!CompletionConsumer &&
+ EnableCodeCompletion(getPreprocessor(), Loc.FileName, Loc.Line,
+  Loc.Column)) {
 setCodeCompletionConsumer(nullptr);
 return;
   }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits