[llvm] 9501af5 - Revert "[lineeditor] Add `setHistorySize()` method for adjusting history size (#110092)"

Thurston Dang via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 7 09:09:53 PST 2024


Author: Thurston Dang
Date: 2024-11-07T17:09:33Z
New Revision: 9501af5f92bb31fa9527d12a4b17b88d9fd651c4

URL: https://github.com/llvm/llvm-project/commit/9501af5f92bb31fa9527d12a4b17b88d9fd651c4
DIFF: https://github.com/llvm/llvm-project/commit/9501af5f92bb31fa9527d12a4b17b88d9fd651c4.diff

LOG: Revert "[lineeditor] Add `setHistorySize()` method for adjusting history size (#110092)"

This reverts commit ec05b883653ba1bb9e92399f78b99a9d9342efc0.

Reason: buildbot breakage (https://lab.llvm.org/buildbot/#/builders/66/builds/5904)

/home/b/sanitizer-x86_64-linux/build/llvm-project/llvm/lib/LineEditor/LineEditor.cpp:23:15: error: unused variable 'DefaultHistorySize' [-Werror,-Wunused-const-variable]
   23 | constexpr int DefaultHistorySize = 800;
      |               ^~~~~~~~~~~~~~~~~~
1 error generated.

Added: 
    

Modified: 
    llvm/include/llvm/LineEditor/LineEditor.h
    llvm/lib/LineEditor/LineEditor.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/LineEditor/LineEditor.h b/llvm/include/llvm/LineEditor/LineEditor.h
index ca0312bf6297f5..29fdf9f85c6fa5 100644
--- a/llvm/include/llvm/LineEditor/LineEditor.h
+++ b/llvm/include/llvm/LineEditor/LineEditor.h
@@ -41,7 +41,6 @@ class LineEditor {
 
   void saveHistory();
   void loadHistory();
-  void setHistorySize(int size);
 
   static std::string getDefaultHistoryPath(StringRef ProgName);
 

diff  --git a/llvm/lib/LineEditor/LineEditor.cpp b/llvm/lib/LineEditor/LineEditor.cpp
index 8f667b0238df8d..d0d138bb1f9d8d 100644
--- a/llvm/lib/LineEditor/LineEditor.cpp
+++ b/llvm/lib/LineEditor/LineEditor.cpp
@@ -20,7 +20,6 @@
 #endif
 
 using namespace llvm;
-constexpr int DefaultHistorySize = 800;
 
 std::string LineEditor::getDefaultHistoryPath(StringRef ProgName) {
   SmallString<32> Path;
@@ -221,8 +220,8 @@ LineEditor::LineEditor(StringRef ProgName, StringRef HistoryPath, FILE *In,
            NULL); // Fix the delete key.
   ::el_set(Data->EL, EL_CLIENTDATA, Data.get());
 
-  setHistorySize(DefaultHistorySize);
   HistEvent HE;
+  ::history(Data->Hist, &HE, H_SETSIZE, 800);
   ::history(Data->Hist, &HE, H_SETUNIQUE, 1);
   loadHistory();
 }
@@ -249,11 +248,6 @@ void LineEditor::loadHistory() {
   }
 }
 
-void LineEditor::setHistorySize(int size) {
-  HistEvent HE;
-  ::history(Data->Hist, &HE, H_SETSIZE, size);
-}
-
 std::optional<std::string> LineEditor::readLine() const {
   // Call el_gets to prompt the user and read the user's input.
   int LineLen = 0;
@@ -297,7 +291,6 @@ LineEditor::~LineEditor() {
 
 void LineEditor::saveHistory() {}
 void LineEditor::loadHistory() {}
-void LineEditor::setHistorySize(int size) {}
 
 std::optional<std::string> LineEditor::readLine() const {
   ::fprintf(Data->Out, "%s", Prompt.c_str());


        


More information about the llvm-commits mailing list