[Lldb-commits] [PATCH] D47929: Add modules support for lldb headers in include/

2018-06-13 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

I'm getting a new warning now, can you also reproduce this?

  In file included from :21:
  In file included from ../tools/lldb/include/lldb/Host/MainLoop.h:13:
  tools/lldb/include/lldb/Host/Config.h:33:9: warning: 'HAVE_LIBCOMPRESSION' 
macro redefined [-Wmacro-redefined]
  #define HAVE_LIBCOMPRESSION
  ^
  :1:9: note: previous definition is here
  #define HAVE_LIBCOMPRESSION 1
  ^
  1 warning generated.


Repository:
  rL LLVM

https://reviews.llvm.org/D47929



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47929: Add modules support for lldb headers in include/

2018-06-13 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor updated this revision to Diff 151181.
teemperor added a comment.

- Finally found the one and only way to spell "Objective-C++"


https://reviews.llvm.org/D47929

Files:
  include/lldb/module.modulemap
  source/Host/CMakeLists.txt
  source/Host/common/Terminal.cpp
  source/Host/macosx/Host.mm
  source/Host/macosx/HostInfoMacOSX.mm
  source/Host/macosx/HostThreadMacOSX.mm
  source/Host/macosx/objcxx/CMakeLists.txt
  source/Host/macosx/objcxx/Host.mm
  source/Host/macosx/objcxx/HostInfoMacOSX.mm
  source/Host/macosx/objcxx/HostThreadMacOSX.mm
  source/Plugins/Platform/MacOSX/CMakeLists.txt
  source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.mm
  source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
  
source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm

Index: source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
===
--- /dev/null
+++ source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
@@ -0,0 +1,18 @@
+remove_module_flags()
+include_directories(..)
+
+add_lldb_library(lldbPluginPlatformMacOSXObjCXX
+  PlatformiOSSimulatorCoreSimulatorSupport.mm
+
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbUtility
+${LLDB_PLUGINS}
+${EXTRA_LIBS}
+
+  LINK_COMPONENTS
+Object
+Support
+  )
Index: source/Plugins/Platform/MacOSX/CMakeLists.txt
===
--- source/Plugins/Platform/MacOSX/CMakeLists.txt
+++ source/Plugins/Platform/MacOSX/CMakeLists.txt
@@ -11,13 +11,14 @@
 list(APPEND PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES
   PlatformAppleSimulator.cpp
   PlatformiOSSimulator.cpp
-  PlatformiOSSimulatorCoreSimulatorSupport.mm
   PlatformAppleTVSimulator.cpp
   PlatformAppleWatchSimulator.cpp
   )
 
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
   include_directories(${LIBXML2_INCLUDE_DIR})
+  add_subdirectory(objcxx)
+  set(OBJC_LIBS "lldbPluginPlatformMacOSXObjCXX")
   list(APPEND PLUGIN_PLATFORM_MACOSX_SOURCES
 ${PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES})
 else()
@@ -38,6 +39,7 @@
 lldbTarget
 lldbUtility
 lldbPluginPlatformPOSIX
+${OBJC_LIBS}
   LINK_COMPONENTS
 Support
 )
Index: source/Host/macosx/objcxx/CMakeLists.txt
===
--- /dev/null
+++ source/Host/macosx/objcxx/CMakeLists.txt
@@ -0,0 +1,21 @@
+
+remove_module_flags()
+include_directories(..)
+
+add_lldb_library(lldbHostMacOSXObjCXX
+  Host.mm
+  HostInfoMacOSX.mm
+  HostThreadMacOSX.mm
+
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbUtility
+${LLDB_PLUGINS}
+${EXTRA_LIBS}
+
+  LINK_COMPONENTS
+Object
+Support
+  )
Index: source/Host/common/Terminal.cpp
===
--- source/Host/common/Terminal.cpp
+++ source/Host/common/Terminal.cpp
@@ -9,6 +9,7 @@
 
 #include "lldb/Host/Terminal.h"
 
+#include "lldb/Host/Config.h"
 #include "lldb/Host/PosixApi.h"
 #include "llvm/ADT/STLExtras.h"
 
Index: source/Host/CMakeLists.txt
===
--- source/Host/CMakeLists.txt
+++ source/Host/CMakeLists.txt
@@ -3,6 +3,18 @@
   source_group(${group} FILES ${ARGN})
 endmacro()
 
+# Removes all module flags from the current CMAKE_CXX_FLAGS. Used for
+# the Objective-C++ code in lldb which we don't want to build with modules.
+# Reasons for this are that modules with Objective-C++ would require that
+# all LLVM/Clang modules are Objective-C++ compatible (which they are likely
+# not) and we would have rebuild a second set of modules just for the few
+# Objective-C++ files in lldb (which slows down the build process).
+macro(remove_module_flags)
+  string(REGEX REPLACE "-fmodules-cache-path=[^ ]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-fmodules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-fcxx-modules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+endmacro()
+
 add_host_subdirectory(common
   common/File.cpp
   common/FileCache.cpp
@@ -92,10 +104,9 @@
 
   if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
 include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR})
-add_host_subdirectory(macosx
-  macosx/Host.mm
-  macosx/HostInfoMacOSX.mm
-  macosx/HostThreadMacOSX.mm
+add_subdirectory(macosx/objcxx)
+set(LLDBObjCLibs lldbHostMacOSXObjCXX)
+add_host_subdirectory(maqcosx
   macosx/Symbols.cpp
   macosx/cfcpp/CFCBundle.cpp
   macosx/cfcpp/CFCData.cpp
@@ -177,15 +188,16 @@
 
 add_lldb_library(lldbHost
   ${HOST_SOURCES}
-  
+
   LINK_LIBS
 lldbCore
 lldbSymbol
 lldbTarget
 lldbUtility
 ${LLDB_PLUGINS}
 ${EXTRA_LIBS}
-  
+${LLDBObjCLibs}
+
   LINK_COMPONENTS
 Object
 Support
Index: include/lldb/module.modulemap
===
--- /dev/null
+++ include/lldb/module.modulemap
@@ -0,0 

[Lldb-commits] [PATCH] D47929: Add modules support for lldb headers in include/

2018-06-12 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor updated this revision to Diff 151077.
teemperor added a comment.

- The regex that removes the modules cache now actually removes the whole flag 
+ path.
- Fixed more typos.


https://reviews.llvm.org/D47929

Files:
  include/lldb/module.modulemap
  source/Host/CMakeLists.txt
  source/Host/common/Terminal.cpp
  source/Host/macosx/Host.mm
  source/Host/macosx/HostInfoMacOSX.mm
  source/Host/macosx/HostThreadMacOSX.mm
  source/Host/macosx/objcxx/CMakeLists.txt
  source/Host/macosx/objcxx/Host.mm
  source/Host/macosx/objcxx/HostInfoMacOSX.mm
  source/Host/macosx/objcxx/HostThreadMacOSX.mm
  source/Plugins/Platform/MacOSX/CMakeLists.txt
  source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.mm
  source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
  
source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm

Index: source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
===
--- /dev/null
+++ source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
@@ -0,0 +1,18 @@
+remove_module_flags()
+include_directories(..)
+
+add_lldb_library(lldbPluginPlatformMacOSXObjCXX
+  PlatformiOSSimulatorCoreSimulatorSupport.mm
+
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbUtility
+${LLDB_PLUGINS}
+${EXTRA_LIBS}
+
+  LINK_COMPONENTS
+Object
+Support
+  )
Index: source/Plugins/Platform/MacOSX/CMakeLists.txt
===
--- source/Plugins/Platform/MacOSX/CMakeLists.txt
+++ source/Plugins/Platform/MacOSX/CMakeLists.txt
@@ -11,13 +11,14 @@
 list(APPEND PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES
   PlatformAppleSimulator.cpp
   PlatformiOSSimulator.cpp
-  PlatformiOSSimulatorCoreSimulatorSupport.mm
   PlatformAppleTVSimulator.cpp
   PlatformAppleWatchSimulator.cpp
   )
 
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
   include_directories(${LIBXML2_INCLUDE_DIR})
+  add_subdirectory(objcxx)
+  set(OBJC_LIBS "lldbPluginPlatformMacOSXObjCXX")
   list(APPEND PLUGIN_PLATFORM_MACOSX_SOURCES
 ${PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES})
 else()
@@ -38,6 +39,7 @@
 lldbTarget
 lldbUtility
 lldbPluginPlatformPOSIX
+${OBJC_LIBS}
   LINK_COMPONENTS
 Support
 )
Index: source/Host/macosx/objcxx/CMakeLists.txt
===
--- /dev/null
+++ source/Host/macosx/objcxx/CMakeLists.txt
@@ -0,0 +1,21 @@
+
+remove_module_flags()
+include_directories(..)
+
+add_lldb_library(lldbHostMacOSXObjCXX
+  Host.mm
+  HostInfoMacOSX.mm
+  HostThreadMacOSX.mm
+
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbUtility
+${LLDB_PLUGINS}
+${EXTRA_LIBS}
+
+  LINK_COMPONENTS
+Object
+Support
+  )
Index: source/Host/common/Terminal.cpp
===
--- source/Host/common/Terminal.cpp
+++ source/Host/common/Terminal.cpp
@@ -9,6 +9,7 @@
 
 #include "lldb/Host/Terminal.h"
 
+#include "lldb/Host/Config.h"
 #include "lldb/Host/PosixApi.h"
 #include "llvm/ADT/STLExtras.h"
 
Index: source/Host/CMakeLists.txt
===
--- source/Host/CMakeLists.txt
+++ source/Host/CMakeLists.txt
@@ -3,6 +3,18 @@
   source_group(${group} FILES ${ARGN})
 endmacro()
 
+# Removes all module flags from the current CMAKE_CXX_FLAGS. Used for
+# the Objective C++ code in lldb which we don't want to build with modules.
+# Reasons for this are that modules with Objective C++ would require that
+# all LLVM/Clang modules are Objective C++ compatible (which they are likely
+# not) and we would have rebuild a second set of modules just for the few
+# Objective C++ files in lldb (which slows down the build process).
+macro(remove_module_flags)
+  string(REGEX REPLACE "-fmodules-cache-path=[^ ]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-fmodules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-fcxx-modules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+endmacro()
+
 add_host_subdirectory(common
   common/File.cpp
   common/FileCache.cpp
@@ -92,10 +104,9 @@
 
   if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
 include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR})
-add_host_subdirectory(macosx
-  macosx/Host.mm
-  macosx/HostInfoMacOSX.mm
-  macosx/HostThreadMacOSX.mm
+add_subdirectory(macosx/objcxx)
+set(LLDBObjCLibs lldbHostMacOSXObjCXX)
+add_host_subdirectory(maqcosx
   macosx/Symbols.cpp
   macosx/cfcpp/CFCBundle.cpp
   macosx/cfcpp/CFCData.cpp
@@ -177,15 +188,16 @@
 
 add_lldb_library(lldbHost
   ${HOST_SOURCES}
-  
+
   LINK_LIBS
 lldbCore
 lldbSymbol
 lldbTarget
 lldbUtility
 ${LLDB_PLUGINS}
 ${EXTRA_LIBS}
-  
+${LLDBObjCLibs}
+
   LINK_COMPONENTS
 Object
 Support
Index: include/lldb/module.modulemap
===
--- /dev/n

[Lldb-commits] [PATCH] D47929: Add modules support for lldb headers in include/

2018-06-12 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: source/Host/CMakeLists.txt:7
+# Removes all module flags from the current CMAKE_CXX_FLAGS. Used for
+# the Obj-C++ code in lldb which we don't want to build with modules.
+# Reasons for this are that modules with Obj-C++ would require that all

aprantl wrote:
> ObjC++ or Objective C++
s/Obj-C++/Objective C++/



Comment at: source/Host/CMakeLists.txt:8
+# the Obj-C++ code in lldb which we don't want to build with modules.
+# Reasons for this are that modules with Obj-C++ would require that all
+# LLVM/Clang modules are Obj-C++ compatible (which they are most likely

s/Obj-C++/Objective C++/



Comment at: source/Host/CMakeLists.txt:108
+add_subdirectory(macosx/objcxx)
+set(LLDBObjCLibs lldbHostMacOSXObjCxx)
+add_host_subdirectory(maqcosx

either `...objcxx` or `...ObjCXX` 


https://reviews.llvm.org/D47929



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47929: Add modules support for lldb headers in include/

2018-06-12 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor updated this revision to Diff 151025.
teemperor marked an inline comment as done.
teemperor added a comment.

- Fixed a typo.


https://reviews.llvm.org/D47929

Files:
  include/lldb/module.modulemap
  source/Host/CMakeLists.txt
  source/Host/common/Terminal.cpp
  source/Host/macosx/Host.mm
  source/Host/macosx/HostInfoMacOSX.mm
  source/Host/macosx/HostThreadMacOSX.mm
  source/Host/macosx/objcxx/CMakeLists.txt
  source/Host/macosx/objcxx/Host.mm
  source/Host/macosx/objcxx/HostInfoMacOSX.mm
  source/Host/macosx/objcxx/HostThreadMacOSX.mm
  source/Plugins/Platform/MacOSX/CMakeLists.txt
  source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.mm
  source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
  
source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm

Index: source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
===
--- /dev/null
+++ source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
@@ -0,0 +1,18 @@
+remove_module_flags()
+include_directories(..)
+
+add_lldb_library(lldbPluginPlatformMacOSXObjCxx
+  PlatformiOSSimulatorCoreSimulatorSupport.mm
+
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbUtility
+${LLDB_PLUGINS}
+${EXTRA_LIBS}
+
+  LINK_COMPONENTS
+Object
+Support
+  )
Index: source/Plugins/Platform/MacOSX/CMakeLists.txt
===
--- source/Plugins/Platform/MacOSX/CMakeLists.txt
+++ source/Plugins/Platform/MacOSX/CMakeLists.txt
@@ -11,13 +11,14 @@
 list(APPEND PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES
   PlatformAppleSimulator.cpp
   PlatformiOSSimulator.cpp
-  PlatformiOSSimulatorCoreSimulatorSupport.mm
   PlatformAppleTVSimulator.cpp
   PlatformAppleWatchSimulator.cpp
   )
 
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
   include_directories(${LIBXML2_INCLUDE_DIR})
+  add_subdirectory(objcxx)
+  set(OBJC_LIBS "lldbPluginPlatformMacOSXObjCxx")
   list(APPEND PLUGIN_PLATFORM_MACOSX_SOURCES
 ${PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES})
 else()
@@ -38,6 +39,7 @@
 lldbTarget
 lldbUtility
 lldbPluginPlatformPOSIX
+${OBJC_LIBS}
   LINK_COMPONENTS
 Support
 )
Index: source/Host/macosx/objcxx/CMakeLists.txt
===
--- /dev/null
+++ source/Host/macosx/objcxx/CMakeLists.txt
@@ -0,0 +1,21 @@
+
+remove_module_flags()
+include_directories(..)
+
+add_lldb_library(lldbHostMacOSXObjCxx
+  Host.mm
+  HostInfoMacOSX.mm
+  HostThreadMacOSX.mm
+
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbUtility
+${LLDB_PLUGINS}
+${EXTRA_LIBS}
+
+  LINK_COMPONENTS
+Object
+Support
+  )
Index: source/Host/common/Terminal.cpp
===
--- source/Host/common/Terminal.cpp
+++ source/Host/common/Terminal.cpp
@@ -9,6 +9,7 @@
 
 #include "lldb/Host/Terminal.h"
 
+#include "lldb/Host/Config.h"
 #include "lldb/Host/PosixApi.h"
 #include "llvm/ADT/STLExtras.h"
 
Index: source/Host/CMakeLists.txt
===
--- source/Host/CMakeLists.txt
+++ source/Host/CMakeLists.txt
@@ -3,6 +3,18 @@
   source_group(${group} FILES ${ARGN})
 endmacro()
 
+# Removes all module flags from the current CMAKE_CXX_FLAGS. Used for
+# the Obj-C++ code in lldb which we don't want to build with modules.
+# Reasons for this are that modules with Obj-C++ would require that all
+# LLVM/Clang modules are Obj-C++ compatible (which they are most likely
+# not) and we would have rebuild a second set of modules just for the few
+# Objective C++ files in lldb (which slows down the build process).
+macro(remove_module_flags)
+  string(REGEX REPLACE "-fmodules-cache-path=[\\S]*" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-fmodules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-fcxx-modules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+endmacro()
+
 add_host_subdirectory(common
   common/File.cpp
   common/FileCache.cpp
@@ -92,10 +104,9 @@
 
   if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
 include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR})
-add_host_subdirectory(macosx
-  macosx/Host.mm
-  macosx/HostInfoMacOSX.mm
-  macosx/HostThreadMacOSX.mm
+add_subdirectory(macosx/objcxx)
+set(LLDBObjCLibs lldbHostMacOSXObjCxx)
+add_host_subdirectory(maqcosx
   macosx/Symbols.cpp
   macosx/cfcpp/CFCBundle.cpp
   macosx/cfcpp/CFCData.cpp
@@ -177,15 +188,16 @@
 
 add_lldb_library(lldbHost
   ${HOST_SOURCES}
-  
+
   LINK_LIBS
 lldbCore
 lldbSymbol
 lldbTarget
 lldbUtility
 ${LLDB_PLUGINS}
 ${EXTRA_LIBS}
-  
+${LLDBObjCLibs}
+
   LINK_COMPONENTS
 Object
 Support
Index: include/lldb/module.modulemap
===
--- /dev/null
+++ include/lldb/module.modulemap
@@ -0,0 +1,139 @@
+
+m

[Lldb-commits] [PATCH] D47929: Add modules support for lldb headers in include/

2018-06-12 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor updated this revision to Diff 151023.
teemperor added a comment.

- Obj-C -> Obj-C++


https://reviews.llvm.org/D47929

Files:
  include/lldb/module.modulemap
  source/Host/CMakeLists.txt
  source/Host/common/Terminal.cpp
  source/Host/macosx/Host.mm
  source/Host/macosx/HostInfoMacOSX.mm
  source/Host/macosx/HostThreadMacOSX.mm
  source/Host/macosx/objcxx/CMakeLists.txt
  source/Host/macosx/objcxx/Host.mm
  source/Host/macosx/objcxx/HostInfoMacOSX.mm
  source/Host/macosx/objcxx/HostThreadMacOSX.mm
  source/Plugins/Platform/MacOSX/CMakeLists.txt
  source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.mm
  source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
  
source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm

Index: source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
===
--- /dev/null
+++ source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
@@ -0,0 +1,18 @@
+remove_module_flags()
+include_directories(..)
+
+add_lldb_library(lldbPluginPlatformMacOSXObjCxx
+  PlatformiOSSimulatorCoreSimulatorSupport.mm
+
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbUtility
+${LLDB_PLUGINS}
+${EXTRA_LIBS}
+
+  LINK_COMPONENTS
+Object
+Support
+  )
Index: source/Plugins/Platform/MacOSX/CMakeLists.txt
===
--- source/Plugins/Platform/MacOSX/CMakeLists.txt
+++ source/Plugins/Platform/MacOSX/CMakeLists.txt
@@ -11,13 +11,14 @@
 list(APPEND PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES
   PlatformAppleSimulator.cpp
   PlatformiOSSimulator.cpp
-  PlatformiOSSimulatorCoreSimulatorSupport.mm
   PlatformAppleTVSimulator.cpp
   PlatformAppleWatchSimulator.cpp
   )
 
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
   include_directories(${LIBXML2_INCLUDE_DIR})
+  add_subdirectory(objcxx)
+  set(OBJC_LIBS "lldbPluginPlatformMacOSXObjCxx")
   list(APPEND PLUGIN_PLATFORM_MACOSX_SOURCES
 ${PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES})
 else()
@@ -38,6 +39,7 @@
 lldbTarget
 lldbUtility
 lldbPluginPlatformPOSIX
+${OBJC_LIBS}
   LINK_COMPONENTS
 Support
 )
Index: source/Host/macosx/objcxx/CMakeLists.txt
===
--- /dev/null
+++ source/Host/macosx/objcxx/CMakeLists.txt
@@ -0,0 +1,21 @@
+
+remove_module_flags()
+include_directories(..)
+
+add_lldb_library(lldbHostMacOSXObjCxx
+  Host.mm
+  HostInfoMacOSX.mm
+  HostThreadMacOSX.mm
+
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbUtility
+${LLDB_PLUGINS}
+${EXTRA_LIBS}
+
+  LINK_COMPONENTS
+Object
+Support
+  )
Index: source/Host/common/Terminal.cpp
===
--- source/Host/common/Terminal.cpp
+++ source/Host/common/Terminal.cpp
@@ -9,6 +9,7 @@
 
 #include "lldb/Host/Terminal.h"
 
+#include "lldb/Host/Config.h"
 #include "lldb/Host/PosixApi.h"
 #include "llvm/ADT/STLExtras.h"
 
Index: source/Host/CMakeLists.txt
===
--- source/Host/CMakeLists.txt
+++ source/Host/CMakeLists.txt
@@ -3,6 +3,18 @@
   source_group(${group} FILES ${ARGN})
 endmacro()
 
+# Removes all module flags from the current CMAKE_CXX_FLAGS. Used for
+# the Obj-C++ code in lldb which we don't want to build with modules.
+# Reasons for this are that modules with Obj-C++ would require that all
+# LLVM/Clang modules are Obj-C++ compatible (which they are most likely
+# not) and we would have rebuild a second set of modules just for the few
+# Obj-C++ files in lldb (which slows down the build process).
+macro(remove_module_flags)
+  string(REGEX REPLACE "-fmodules-cache-path=[\\S]*" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-fmodules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-fcxx-modules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+endmacro()
+
 add_host_subdirectory(common
   common/File.cpp
   common/FileCache.cpp
@@ -92,10 +104,9 @@
 
   if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
 include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR})
-add_host_subdirectory(macosx
-  macosx/Host.mm
-  macosx/HostInfoMacOSX.mm
-  macosx/HostThreadMacOSX.mm
+add_subdirectory(macosx/objcxx)
+set(LLDBObjCLibs lldbHostMacOSXObjCxx)
+add_host_subdirectory(maqcosx
   macosx/Symbols.cpp
   macosx/cfcpp/CFCBundle.cpp
   macosx/cfcpp/CFCData.cpp
@@ -177,15 +188,16 @@
 
 add_lldb_library(lldbHost
   ${HOST_SOURCES}
-  
+
   LINK_LIBS
 lldbCore
 lldbSymbol
 lldbTarget
 lldbUtility
 ${LLDB_PLUGINS}
 ${EXTRA_LIBS}
-  
+${LLDBObjCLibs}
+
   LINK_COMPONENTS
 Object
 Support
Index: include/lldb/module.modulemap
===
--- /dev/null
+++ include/lldb/module.modulemap
@@ -0,0 +1,139 @@
+
+module lldb_API {
+  requires cplusplus
+
+  umb

[Lldb-commits] [PATCH] D47929: Add modules support for lldb headers in include/

2018-06-12 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl accepted this revision.
aprantl added inline comments.



Comment at: source/Host/CMakeLists.txt:7
+# Removes all module flags from the current CMAKE_CXX_FLAGS. Used for
+# the Obj-C++ code in lldb which we don't want to build with modules.
+# Reasons for this are that modules with Obj-C++ would require that all

ObjC++ or Objective C++



Comment at: source/Host/CMakeLists.txt:107
 include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR})
-add_host_subdirectory(macosx
-  macosx/Host.mm
-  macosx/HostInfoMacOSX.mm
-  macosx/HostThreadMacOSX.mm
+add_subdirectory(macosx/objc)
+set(LLDBObjCLibs lldbHostMacOSXObjC)

This is really Objective C++, so `ObjCXX` or `objcxx` would be a more 
appropriate directory name.



Comment at: source/Host/CMakeLists.txt:109
+set(LLDBObjCLibs lldbHostMacOSXObjC)
+add_host_subdirectory(maqcosx
   macosx/Symbols.cpp

macosx

(technically MacOS X is now macOS, but you don't need to change that)


https://reviews.llvm.org/D47929



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47929: Add modules support for lldb headers in include/

2018-06-12 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added inline comments.



Comment at: include/lldb/module.modulemap:66
+// This big module is necessary to work around the cyclic dependencies
+// between its submodules.
+module lldb {

teemperor wrote:
> bruno wrote:
> > Will this trick be enough for local submodules visibility mode as well? 
> From my (very limited) experience with disabled local submodule visibility I 
> would say yes, but I can't test it on my current system (compilation already 
> fails at the first LLVM module without LSV).
It seems to work!


https://reviews.llvm.org/D47929



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47929: Add modules support for lldb headers in include/

2018-06-12 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor updated this revision to Diff 151004.
teemperor retitled this revision from "Add modulemap to lldb include directory" 
to "Add modules support for lldb headers in include/".
teemperor edited the summary of this revision.
teemperor added a comment.
This revision is now accepted and ready to land.
Herald added a subscriber: mgorny.

- All Obj-C files are now in their own subdirectory. This way we can filter out 
the modules flags for them.


https://reviews.llvm.org/D47929

Files:
  include/lldb/module.modulemap
  source/Host/CMakeLists.txt
  source/Host/common/Terminal.cpp
  source/Host/macosx/Host.mm
  source/Host/macosx/HostInfoMacOSX.mm
  source/Host/macosx/HostThreadMacOSX.mm
  source/Host/macosx/objc/CMakeLists.txt
  source/Host/macosx/objc/Host.mm
  source/Host/macosx/objc/HostInfoMacOSX.mm
  source/Host/macosx/objc/HostThreadMacOSX.mm
  source/Plugins/Platform/MacOSX/CMakeLists.txt
  source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.mm
  source/Plugins/Platform/MacOSX/objc/CMakeLists.txt
  
source/Plugins/Platform/MacOSX/objc/PlatformiOSSimulatorCoreSimulatorSupport.mm

Index: source/Plugins/Platform/MacOSX/objc/CMakeLists.txt
===
--- /dev/null
+++ source/Plugins/Platform/MacOSX/objc/CMakeLists.txt
@@ -0,0 +1,18 @@
+remove_module_flags()
+include_directories(..)
+
+add_lldb_library(lldbPluginPlatformMacOSXObjC
+  PlatformiOSSimulatorCoreSimulatorSupport.mm
+
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbUtility
+${LLDB_PLUGINS}
+${EXTRA_LIBS}
+
+  LINK_COMPONENTS
+Object
+Support
+  )
Index: source/Plugins/Platform/MacOSX/CMakeLists.txt
===
--- source/Plugins/Platform/MacOSX/CMakeLists.txt
+++ source/Plugins/Platform/MacOSX/CMakeLists.txt
@@ -11,13 +11,14 @@
 list(APPEND PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES
   PlatformAppleSimulator.cpp
   PlatformiOSSimulator.cpp
-  PlatformiOSSimulatorCoreSimulatorSupport.mm
   PlatformAppleTVSimulator.cpp
   PlatformAppleWatchSimulator.cpp
   )
 
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
   include_directories(${LIBXML2_INCLUDE_DIR})
+  add_subdirectory(objc)
+  set(OBJC_LIBS "lldbPluginPlatformMacOSXObjC")
   list(APPEND PLUGIN_PLATFORM_MACOSX_SOURCES
 ${PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES})
 else()
@@ -38,6 +39,7 @@
 lldbTarget
 lldbUtility
 lldbPluginPlatformPOSIX
+${OBJC_LIBS}
   LINK_COMPONENTS
 Support
 )
Index: source/Host/macosx/objc/CMakeLists.txt
===
--- /dev/null
+++ source/Host/macosx/objc/CMakeLists.txt
@@ -0,0 +1,21 @@
+
+remove_module_flags()
+include_directories(..)
+
+add_lldb_library(lldbHostMacOSXObjC
+  Host.mm
+  HostInfoMacOSX.mm
+  HostThreadMacOSX.mm
+
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbUtility
+${LLDB_PLUGINS}
+${EXTRA_LIBS}
+
+  LINK_COMPONENTS
+Object
+Support
+  )
Index: source/Host/common/Terminal.cpp
===
--- source/Host/common/Terminal.cpp
+++ source/Host/common/Terminal.cpp
@@ -9,6 +9,7 @@
 
 #include "lldb/Host/Terminal.h"
 
+#include "lldb/Host/Config.h"
 #include "lldb/Host/PosixApi.h"
 #include "llvm/ADT/STLExtras.h"
 
Index: source/Host/CMakeLists.txt
===
--- source/Host/CMakeLists.txt
+++ source/Host/CMakeLists.txt
@@ -3,6 +3,18 @@
   source_group(${group} FILES ${ARGN})
 endmacro()
 
+# Removes all module flags from the current CMAKE_CXX_FLAGS. Used for
+# the Obj-C++ code in lldb which we don't want to build with modules.
+# Reasons for this are that modules with Obj-C++ would require that all
+# LLVM/Clang modules are Obj-C++ compatible (which they are most likely
+# not) and we would have rebuild a second set of modules just for the few
+# Obj-C++ files in lldb (which slows down the build process).
+macro(remove_module_flags)
+  string(REGEX REPLACE "-fmodules-cache-path=[\\S]*" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-fmodules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-fcxx-modules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+endmacro()
+
 add_host_subdirectory(common
   common/File.cpp
   common/FileCache.cpp
@@ -92,10 +104,9 @@
 
   if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
 include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR})
-add_host_subdirectory(macosx
-  macosx/Host.mm
-  macosx/HostInfoMacOSX.mm
-  macosx/HostThreadMacOSX.mm
+add_subdirectory(macosx/objc)
+set(LLDBObjCLibs lldbHostMacOSXObjC)
+add_host_subdirectory(maqcosx
   macosx/Symbols.cpp
   macosx/cfcpp/CFCBundle.cpp
   macosx/cfcpp/CFCData.cpp
@@ -177,15 +188,16 @@
 
 add_lldb_library(lldbHost
   ${HOST_SOURCES}
-  
+
   LINK_LIBS
 lldbCore
 lldbSymbol
 lldbTarget
 lldbUtility
 ${L