Skip to content

Commit 9501af5

Browse files
committed
Revert "[lineeditor] Add setHistorySize() method for adjusting history size (#110092)"
This reverts commit ec05b88. 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.
1 parent ed6c106 commit 9501af5

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

llvm/include/llvm/LineEditor/LineEditor.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class LineEditor {
4141

4242
void saveHistory();
4343
void loadHistory();
44-
void setHistorySize(int size);
4544

4645
static std::string getDefaultHistoryPath(StringRef ProgName);
4746

llvm/lib/LineEditor/LineEditor.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#endif
2121

2222
using namespace llvm;
23-
constexpr int DefaultHistorySize = 800;
2423

2524
std::string LineEditor::getDefaultHistoryPath(StringRef ProgName) {
2625
SmallString<32> Path;
@@ -221,8 +220,8 @@ LineEditor::LineEditor(StringRef ProgName, StringRef HistoryPath, FILE *In,
221220
NULL); // Fix the delete key.
222221
::el_set(Data->EL, EL_CLIENTDATA, Data.get());
223222

224-
setHistorySize(DefaultHistorySize);
225223
HistEvent HE;
224+
::history(Data->Hist, &HE, H_SETSIZE, 800);
226225
::history(Data->Hist, &HE, H_SETUNIQUE, 1);
227226
loadHistory();
228227
}
@@ -249,11 +248,6 @@ void LineEditor::loadHistory() {
249248
}
250249
}
251250

252-
void LineEditor::setHistorySize(int size) {
253-
HistEvent HE;
254-
::history(Data->Hist, &HE, H_SETSIZE, size);
255-
}
256-
257251
std::optional<std::string> LineEditor::readLine() const {
258252
// Call el_gets to prompt the user and read the user's input.
259253
int LineLen = 0;
@@ -297,7 +291,6 @@ LineEditor::~LineEditor() {
297291

298292
void LineEditor::saveHistory() {}
299293
void LineEditor::loadHistory() {}
300-
void LineEditor::setHistorySize(int size) {}
301294

302295
std::optional<std::string> LineEditor::readLine() const {
303296
::fprintf(Data->Out, "%s", Prompt.c_str());

0 commit comments

Comments
 (0)