Skip to content

Revert "Introduce and use SWIFT_HAVE_LIBEDIT" #6534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ set_property(GLOBAL PROPERTY JOB_POOL_LINK local_jobs)

# First include general CMake utilities.
include(SwiftUtils)
include(CheckSymbolExists)

#
# User-configurable options that control the inclusion and default build
Expand Down Expand Up @@ -806,8 +805,6 @@ if(LIBXML2_FOUND)
set(SWIFT_HAVE_LIBXML 1)
endif()

check_symbol_exists(el_wgets "histedit.h" HAVE_UNICODE_LIBEDIT)

if (LLVM_ENABLE_DOXYGEN)
message(STATUS "Doxygen: enabled")
endif()
Expand Down
2 changes: 0 additions & 2 deletions include/swift/Config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@

#cmakedefine SWIFT_HAVE_WORKING_STD_REGEX 1

#cmakedefine HAVE_UNICODE_LIBEDIT 1

#endif // SWIFT_CONFIG_H
13 changes: 7 additions & 6 deletions lib/Immediate/REPL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include "swift/Immediate/Immediate.h"
#include "ImmediateImpl.h"

#include "swift/Config.h"
#include "swift/Subsystems.h"
#include "swift/AST/ASTContext.h"
#include "swift/AST/DiagnosticsFrontend.h"
Expand All @@ -35,9 +34,11 @@
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Process.h"

#if HAVE_UNICODE_LIBEDIT
#if defined(__APPLE__) || defined(__FreeBSD__)
// FIXME: Support REPL on non-Apple platforms. Ubuntu 14.10's editline does not
// include the wide character entry points needed by the REPL yet.
#include <histedit.h>
#endif
#endif // __APPLE__

using namespace swift;
using namespace swift::immediate;
Expand Down Expand Up @@ -130,7 +131,7 @@ class ConvertForWcharSize<4> {

using Convert = ConvertForWcharSize<sizeof(wchar_t)>;

#if HAVE_UNICODE_LIBEDIT
#if defined(__APPLE__) || defined(__FreeBSD__)
static void convertFromUTF8(llvm::StringRef utf8,
llvm::SmallVectorImpl<wchar_t> &out) {
size_t reserve = out.size() + utf8.size();
Expand Down Expand Up @@ -162,7 +163,7 @@ static void convertToUTF8(llvm::ArrayRef<wchar_t> wide,

} // end anonymous namespace

#if HAVE_UNICODE_LIBEDIT
#if defined(__APPLE__) || defined(__FreeBSD__)

static bool appendToREPLFile(SourceFile &SF,
PersistentParserState &PersistentState,
Expand Down Expand Up @@ -1181,7 +1182,7 @@ void swift::runREPL(CompilerInstance &CI, const ProcessCmdLine &CmdLine,
} while (env.handleREPLInput(inputKind, Line));
}

#else
#else // __APPLE__

void swift::runREPL(CompilerInstance &CI, const ProcessCmdLine &CmdLine,
bool ParseStdlib) {
Expand Down
4 changes: 1 addition & 3 deletions tools/SourceKit/tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ include_directories(

add_swift_lib_subdirectory(sourcekitd)
add_swift_tool_subdirectory(sourcekitd-test)
if(HAVE_UNICODE_LIBEDIT)
add_swift_tool_subdirectory(sourcekitd-repl)
endif()
add_swift_tool_subdirectory(sourcekitd-repl)
add_swift_tool_subdirectory(complete-test)
4 changes: 1 addition & 3 deletions tools/driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ add_swift_host_tool(swift
SWIFT_COMPONENT compiler
)

if(HAVE_UNICODE_LIBEDIT)
target_link_libraries(swift edit)
endif()
target_link_libraries(swift edit)

add_custom_command(TARGET swift POST_BUILD
COMMAND "${CMAKE_COMMAND}" "-E" "create_symlink" "swift" "swiftc"
Expand Down
4 changes: 1 addition & 3 deletions tools/swift-remoteast-test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ add_swift_host_tool(swift-remoteast-test
)

set_target_properties(swift-remoteast-test PROPERTIES ENABLE_EXPORTS 1)
if(HAVE_UNICODE_LIBEDIT)
target_link_libraries(swift-remoteast-test edit)
endif()
target_link_libraries(swift-remoteast-test edit)

# If building as part of clang, make sure the headers are installed.
if(NOT SWIFT_BUILT_STANDALONE)
Expand Down