From bd3306aecb3a15e8967143b8cdbbccf2b1b19b74 Mon Sep 17 00:00:00 2001 From: patrick Date: Sat, 14 Jan 2017 19:55:43 +0000 Subject: Import LLVM 3.9.1 including clang and lld. --- gnu/llvm/lib/LineEditor/LineEditor.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'gnu/llvm/lib/LineEditor/LineEditor.cpp') diff --git a/gnu/llvm/lib/LineEditor/LineEditor.cpp b/gnu/llvm/lib/LineEditor/LineEditor.cpp index a50ccc388f1..533a928b2df 100644 --- a/gnu/llvm/lib/LineEditor/LineEditor.cpp +++ b/gnu/llvm/lib/LineEditor/LineEditor.cpp @@ -12,7 +12,9 @@ #include "llvm/Config/config.h" #include "llvm/Support/Path.h" #include "llvm/Support/raw_ostream.h" -#include +#include +#include +#include #ifdef HAVE_LIBEDIT #include #endif @@ -106,7 +108,9 @@ struct LineEditor::InternalData { FILE *Out; }; -static const char *ElGetPromptFn(EditLine *EL) { +namespace { + +const char *ElGetPromptFn(EditLine *EL) { LineEditor::InternalData *Data; if (el_get(EL, EL_CLIENTDATA, &Data) == 0) return Data->LE->getPrompt().c_str(); @@ -117,7 +121,7 @@ static const char *ElGetPromptFn(EditLine *EL) { // // This function is really horrible. But since the alternative is to get into // the line editor business, here we are. -static unsigned char ElCompletionFn(EditLine *EL, int ch) { +unsigned char ElCompletionFn(EditLine *EL, int ch) { LineEditor::InternalData *Data; if (el_get(EL, EL_CLIENTDATA, &Data) == 0) { if (!Data->ContinuationOutput.empty()) { @@ -190,6 +194,8 @@ static unsigned char ElCompletionFn(EditLine *EL, int ch) { return CC_ERROR; } +} // end anonymous namespace + LineEditor::LineEditor(StringRef ProgName, StringRef HistoryPath, FILE *In, FILE *Out, FILE *Err) : Prompt((ProgName + "> ").str()), HistoryPath(HistoryPath), @@ -269,7 +275,7 @@ Optional LineEditor::readLine() const { return std::string(Line, LineLen); } -#else +#else // HAVE_LIBEDIT // Simple fgets-based implementation. @@ -316,4 +322,4 @@ Optional LineEditor::readLine() const { return Line; } -#endif +#endif // HAVE_LIBEDIT -- cgit v1.2.3-59-g8ed1b