r358696 - [CodeComplete] Remove obsolete isOutputBinary().

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 18 10:35:55 PDT 2019


Author: sammccall
Date: Thu Apr 18 10:35:55 2019
New Revision: 358696

URL: http://llvm.org/viewvc/llvm-project?rev=358696&view=rev
Log:
[CodeComplete] Remove obsolete isOutputBinary().

Summary:
It's never set to true. Its only effect would be to set stdout to binary mode.
Hopefully we have better ways of doing this by now :-)

Reviewers: hokein

Subscribers: jkorous, arphaman, kadircet, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60871

Modified:
    cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h
    cfe/trunk/lib/Frontend/ASTUnit.cpp
    cfe/trunk/lib/Frontend/CompilerInstance.cpp
    cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp
    cfe/trunk/unittests/Sema/CodeCompleteTest.cpp

Modified: cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h?rev=358696&r1=358695&r2=358696&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h (original)
+++ cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h Thu Apr 18 10:35:55 2019
@@ -992,10 +992,6 @@ class CodeCompleteConsumer {
 protected:
   const CodeCompleteOptions CodeCompleteOpts;
 
-  /// Whether the output format for the code-completion consumer is
-  /// binary.
-  bool OutputIsBinary;
-
 public:
   class OverloadCandidate {
   public:
@@ -1066,9 +1062,8 @@ public:
                                       bool IncludeBriefComments) const;
   };
 
-  CodeCompleteConsumer(const CodeCompleteOptions &CodeCompleteOpts,
-                       bool OutputIsBinary)
-      : CodeCompleteOpts(CodeCompleteOpts), OutputIsBinary(OutputIsBinary) {}
+  CodeCompleteConsumer(const CodeCompleteOptions &CodeCompleteOpts)
+      : CodeCompleteOpts(CodeCompleteOpts) {}
 
   /// Whether the code-completion consumer wants to see macros.
   bool includeMacros() const {
@@ -1106,9 +1101,6 @@ public:
     return CodeCompleteOpts.LoadExternal;
   }
 
-  /// Determine whether the output of this consumer is binary.
-  bool isOutputBinary() const { return OutputIsBinary; }
-
   /// Deregisters and destroys this code-completion consumer.
   virtual ~CodeCompleteConsumer();
 
@@ -1181,7 +1173,7 @@ public:
   /// results to the given raw output stream.
   PrintingCodeCompleteConsumer(const CodeCompleteOptions &CodeCompleteOpts,
                                raw_ostream &OS)
-      : CodeCompleteConsumer(CodeCompleteOpts, false), OS(OS),
+      : CodeCompleteConsumer(CodeCompleteOpts), OS(OS),
         CCTUInfo(std::make_shared<GlobalCodeCompletionAllocator>()) {}
 
   /// Prints the finalized code-completion results.

Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=358696&r1=358695&r2=358696&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Thu Apr 18 10:35:55 2019
@@ -1877,8 +1877,7 @@ namespace {
   public:
     AugmentedCodeCompleteConsumer(ASTUnit &AST, CodeCompleteConsumer &Next,
                                   const CodeCompleteOptions &CodeCompleteOpts)
-        : CodeCompleteConsumer(CodeCompleteOpts, Next.isOutputBinary()),
-          AST(AST), Next(Next) {
+        : CodeCompleteConsumer(CodeCompleteOpts), AST(AST), Next(Next) {
       // Compute the set of contexts in which we will look when we don't have
       // any information about the specific context.
       NormalContexts

Modified: cfe/trunk/lib/Frontend/CompilerInstance.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInstance.cpp?rev=358696&r1=358695&r2=358696&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInstance.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInstance.cpp Thu Apr 18 10:35:55 2019
@@ -585,12 +585,6 @@ void CompilerInstance::createCodeComplet
     setCodeCompletionConsumer(nullptr);
     return;
   }
-
-  if (CompletionConsumer->isOutputBinary() &&
-      llvm::sys::ChangeStdoutToBinary()) {
-    getPreprocessor().getDiagnostics().Report(diag::err_fe_stdout_binary);
-    setCodeCompletionConsumer(nullptr);
-  }
 }
 
 void CompilerInstance::createFrontendTimer() {

Modified: cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp?rev=358696&r1=358695&r2=358696&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp (original)
+++ cfe/trunk/tools/libclang/CIndexCodeCompletion.cpp Thu Apr 18 10:35:55 2019
@@ -568,9 +568,8 @@ namespace {
     CaptureCompletionResults(const CodeCompleteOptions &Opts,
                              AllocatedCXCodeCompleteResults &Results,
                              CXTranslationUnit *TranslationUnit)
-      : CodeCompleteConsumer(Opts, false), 
-        AllocatedResults(Results), CCTUInfo(Results.CodeCompletionAllocator),
-        TU(TranslationUnit) { }
+        : CodeCompleteConsumer(Opts), AllocatedResults(Results),
+          CCTUInfo(Results.CodeCompletionAllocator), TU(TranslationUnit) {}
     ~CaptureCompletionResults() override { Finish(); }
 
     void ProcessCodeCompleteResults(Sema &S, 

Modified: cfe/trunk/unittests/Sema/CodeCompleteTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Sema/CodeCompleteTest.cpp?rev=358696&r1=358695&r2=358696&view=diff
==============================================================================
--- cfe/trunk/unittests/Sema/CodeCompleteTest.cpp (original)
+++ cfe/trunk/unittests/Sema/CodeCompleteTest.cpp Thu Apr 18 10:35:55 2019
@@ -38,9 +38,7 @@ struct CompletionContext {
 class VisitedContextFinder : public CodeCompleteConsumer {
 public:
   VisitedContextFinder(CompletionContext &ResultCtx)
-      : CodeCompleteConsumer(/*CodeCompleteOpts=*/{},
-                             /*CodeCompleteConsumer*/ false),
-        ResultCtx(ResultCtx),
+      : CodeCompleteConsumer(/*CodeCompleteOpts=*/{}), ResultCtx(ResultCtx),
         CCTUInfo(std::make_shared<GlobalCodeCompletionAllocator>()) {}
 
   void ProcessCodeCompleteResults(Sema &S, CodeCompletionContext Context,




More information about the cfe-commits mailing list