From ef493382839dbd7d398bc26e3356f5adc7173ba8 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Tue, 3 Jan 2017 11:36:47 -0800 Subject: [PATCH 1/2] Revert "Introduce and use SWIFT_HAVE_LIBEDIT" --- CMakeLists.txt | 3 --- include/swift/CMakeLists.txt | 4 ++++ tools/SourceKit/tools/CMakeLists.txt | 4 +--- tools/driver/CMakeLists.txt | 4 +--- tools/swift-remoteast-test/CMakeLists.txt | 4 +--- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 978a162f7259..c7b9997160d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 @@ -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() diff --git a/include/swift/CMakeLists.txt b/include/swift/CMakeLists.txt index c64a3fe0685f..8211c8ad2984 100644 --- a/include/swift/CMakeLists.txt +++ b/include/swift/CMakeLists.txt @@ -1,3 +1,7 @@ +include(CheckSymbolExists) + +check_symbol_exists(el_wgets "histedit.h" HAVE_UNICODE_LIBEDIT) + configure_file(Config.h.in ${CMAKE_CURRENT_BINARY_DIR}/Config.h ESCAPE_QUOTES @ONLY) diff --git a/tools/SourceKit/tools/CMakeLists.txt b/tools/SourceKit/tools/CMakeLists.txt index ad0a4fd63718..182638b794db 100644 --- a/tools/SourceKit/tools/CMakeLists.txt +++ b/tools/SourceKit/tools/CMakeLists.txt @@ -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) diff --git a/tools/driver/CMakeLists.txt b/tools/driver/CMakeLists.txt index e2f907a8a354..902b9fe97c4f 100644 --- a/tools/driver/CMakeLists.txt +++ b/tools/driver/CMakeLists.txt @@ -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" diff --git a/tools/swift-remoteast-test/CMakeLists.txt b/tools/swift-remoteast-test/CMakeLists.txt index 9ae0bb0598b3..b0c546ed5032 100644 --- a/tools/swift-remoteast-test/CMakeLists.txt +++ b/tools/swift-remoteast-test/CMakeLists.txt @@ -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) From f7b1cbc37f3251733d65516f69ad9b1fd49cb326 Mon Sep 17 00:00:00 2001 From: Mishal Shah Date: Tue, 3 Jan 2017 12:49:47 -0800 Subject: [PATCH 2/2] Revert "Added HAVE_UNICODE_LIBEDIT instead of doing platform checks" This reverts commit 81ae0fd89db50ce4474638941c11e3a97f7204af. --- include/swift/CMakeLists.txt | 4 ---- include/swift/Config.h.in | 2 -- lib/Immediate/REPL.cpp | 13 +++++++------ 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/include/swift/CMakeLists.txt b/include/swift/CMakeLists.txt index 8211c8ad2984..c64a3fe0685f 100644 --- a/include/swift/CMakeLists.txt +++ b/include/swift/CMakeLists.txt @@ -1,7 +1,3 @@ -include(CheckSymbolExists) - -check_symbol_exists(el_wgets "histedit.h" HAVE_UNICODE_LIBEDIT) - configure_file(Config.h.in ${CMAKE_CURRENT_BINARY_DIR}/Config.h ESCAPE_QUOTES @ONLY) diff --git a/include/swift/Config.h.in b/include/swift/Config.h.in index 652fbf467086..263e3086c572 100644 --- a/include/swift/Config.h.in +++ b/include/swift/Config.h.in @@ -6,6 +6,4 @@ #cmakedefine SWIFT_HAVE_WORKING_STD_REGEX 1 -#cmakedefine HAVE_UNICODE_LIBEDIT 1 - #endif // SWIFT_CONFIG_H diff --git a/lib/Immediate/REPL.cpp b/lib/Immediate/REPL.cpp index abb57f6f5c12..5e2c80813862 100644 --- a/lib/Immediate/REPL.cpp +++ b/lib/Immediate/REPL.cpp @@ -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" @@ -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 -#endif +#endif // __APPLE__ using namespace swift; using namespace swift::immediate; @@ -130,7 +131,7 @@ class ConvertForWcharSize<4> { using Convert = ConvertForWcharSize; -#if HAVE_UNICODE_LIBEDIT +#if defined(__APPLE__) || defined(__FreeBSD__) static void convertFromUTF8(llvm::StringRef utf8, llvm::SmallVectorImpl &out) { size_t reserve = out.size() + utf8.size(); @@ -162,7 +163,7 @@ static void convertToUTF8(llvm::ArrayRef wide, } // end anonymous namespace -#if HAVE_UNICODE_LIBEDIT +#if defined(__APPLE__) || defined(__FreeBSD__) static bool appendToREPLFile(SourceFile &SF, PersistentParserState &PersistentState, @@ -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) {