summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/cmake/modules/HandleLLVMOptions.cmake38
-rw-r--r--llvm/lib/AsmParser/module.modulemap1
-rw-r--r--llvm/lib/Bitcode/module.modulemap1
-rw-r--r--llvm/lib/CodeGen/module.modulemap1
-rw-r--r--llvm/lib/DebugInfo/DWARF/module.modulemap1
-rw-r--r--llvm/lib/IR/module.modulemap1
-rw-r--r--llvm/lib/TableGen/module.modulemap1
-rw-r--r--llvm/utils/TableGen/module.modulemap4
8 files changed, 19 insertions, 29 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index f66e3ae47e6..9b9e4bf5422 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -139,6 +139,25 @@ function(add_flag_or_print_warning flag name)
endif()
endfunction()
+if (LLVM_ENABLE_MODULES)
+ set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fmodules -Xclang -fmodules-local-submodule-visibility")
+ # Check that we can build code with modules enabled, and that repeatedly
+ # including <cassert> still manages to respect NDEBUG properly.
+ CHECK_CXX_SOURCE_COMPILES("#undef NDEBUG
+ #include <cassert>
+ #define NDEBUG
+ #include <cassert>
+ int main() { assert(this code is not compiled); }"
+ CXX_SUPPORTS_MODULES)
+ set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
+ if (CXX_SUPPORTS_MODULES)
+ append_if(CXX_SUPPORTS_MODULES "-fmodules -Xclang -fmodules-local-submodule-visibility" CMAKE_CXX_FLAGS)
+ else()
+ message(FATAL_ERROR "LLVM_ENABLE_MODULES is not supported by this compiler")
+ endif()
+endif(LLVM_ENABLE_MODULES)
+
if( LLVM_ENABLE_PIC )
if( XCODE )
# Xcode has -mdynamic-no-pic on by default, which overrides -fPIC. I don't
@@ -471,25 +490,6 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
message(FATAL_ERROR "LLVM requires C++11 support but the '-std=c++11' flag isn't supported.")
endif()
endif()
- if (LLVM_ENABLE_MODULES)
- set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
- set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fmodules")
- # Check that we can build code with modules enabled, and that repeatedly
- # including <cassert> still manages to respect NDEBUG properly.
- CHECK_CXX_SOURCE_COMPILES("#undef NDEBUG
- #include <cassert>
- #define NDEBUG
- #include <cassert>
- int main() { assert(this code is not compiled); }"
- CXX_SUPPORTS_MODULES)
- set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
- if (CXX_SUPPORTS_MODULES)
- append_if(CXX_SUPPORTS_MODULES "-fmodules" CMAKE_C_FLAGS)
- append_if(CXX_SUPPORTS_MODULES "-fmodules -fcxx-modules" CMAKE_CXX_FLAGS)
- else()
- message(FATAL_ERROR "LLVM_ENABLE_MODULES is not supported by this compiler")
- endif()
- endif(LLVM_ENABLE_MODULES)
endif( MSVC )
macro(append_common_sanitizer_flags)
diff --git a/llvm/lib/AsmParser/module.modulemap b/llvm/lib/AsmParser/module.modulemap
deleted file mode 100644
index cc300060b3f..00000000000
--- a/llvm/lib/AsmParser/module.modulemap
+++ /dev/null
@@ -1 +0,0 @@
-module AsmParser { requires cplusplus umbrella "." module * { export * } }
diff --git a/llvm/lib/Bitcode/module.modulemap b/llvm/lib/Bitcode/module.modulemap
deleted file mode 100644
index 7df1a0a3c72..00000000000
--- a/llvm/lib/Bitcode/module.modulemap
+++ /dev/null
@@ -1 +0,0 @@
-module Bitcode { requires cplusplus umbrella "." module * { export * } }
diff --git a/llvm/lib/CodeGen/module.modulemap b/llvm/lib/CodeGen/module.modulemap
deleted file mode 100644
index d4f68bcc6ee..00000000000
--- a/llvm/lib/CodeGen/module.modulemap
+++ /dev/null
@@ -1 +0,0 @@
-module CodeGen { requires cplusplus umbrella "." module * { export * } }
diff --git a/llvm/lib/DebugInfo/DWARF/module.modulemap b/llvm/lib/DebugInfo/DWARF/module.modulemap
deleted file mode 100644
index c2f624fd4b6..00000000000
--- a/llvm/lib/DebugInfo/DWARF/module.modulemap
+++ /dev/null
@@ -1 +0,0 @@
-module DebugInfoDWARF { requires cplusplus umbrella "." module * { export * } }
diff --git a/llvm/lib/IR/module.modulemap b/llvm/lib/IR/module.modulemap
deleted file mode 100644
index 9698e917834..00000000000
--- a/llvm/lib/IR/module.modulemap
+++ /dev/null
@@ -1 +0,0 @@
-module IR { requires cplusplus umbrella "." module * { export * } }
diff --git a/llvm/lib/TableGen/module.modulemap b/llvm/lib/TableGen/module.modulemap
deleted file mode 100644
index 8dac0a22c14..00000000000
--- a/llvm/lib/TableGen/module.modulemap
+++ /dev/null
@@ -1 +0,0 @@
-module TableGen { requires cplusplus umbrella "." module * { export * } }
diff --git a/llvm/utils/TableGen/module.modulemap b/llvm/utils/TableGen/module.modulemap
deleted file mode 100644
index 8871bbfd4a2..00000000000
--- a/llvm/utils/TableGen/module.modulemap
+++ /dev/null
@@ -1,4 +0,0 @@
-module TableGen {
- umbrella "."
- module * { export * }
-}
OpenPOWER on IntegriCloud