[llvm] 76bcbaa - [Orc][Modules] Fix Modules build fallout from a34680a33eb.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 20 17:34:47 PST 2019


Author: Lang Hames
Date: 2019-11-20T17:34:34-08:00
New Revision: 76bcbaafab2db9ee1fa0813463016afb64c5fb41

URL: https://github.com/llvm/llvm-project/commit/76bcbaafab2db9ee1fa0813463016afb64c5fb41
DIFF: https://github.com/llvm/llvm-project/commit/76bcbaafab2db9ee1fa0813463016afb64c5fb41.diff

LOG: [Orc][Modules] Fix Modules build fallout from a34680a33eb.

In a34680a33eb OrcError.h and Orc/RPC/*.h were split out from the rest of
ExecutionEngine in order to eliminate false dependencies for remote JIT
targets (see https://reviews.llvm.org/D68732), however this broke modules
builds (see https://reviews.llvm.org/D69817).

This patch splits these headers out into a separate module, LLVM_OrcSupport,
in order to fix the modules build.

Fixes <rdar://56377508>.

Added: 
    

Modified: 
    llvm/include/llvm/ExecutionEngine/Orc/OrcError.h
    llvm/include/llvm/module.modulemap
    llvm/lib/ExecutionEngine/OrcError/OrcError.cpp
    llvm/lib/ExecutionEngine/OrcError/RPCError.cpp
    llvm/lib/Support/Error.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ExecutionEngine/Orc/OrcError.h b/llvm/include/llvm/ExecutionEngine/Orc/OrcError.h
index e5d6a3eca85f..61e2e49a872a 100644
--- a/llvm/include/llvm/ExecutionEngine/Orc/OrcError.h
+++ b/llvm/include/llvm/ExecutionEngine/Orc/OrcError.h
@@ -14,6 +14,8 @@
 #define LLVM_EXECUTIONENGINE_ORC_ORCERROR_H
 
 #include "llvm/Support/Error.h"
+#include "llvm/Support/raw_ostream.h"
+#include <string>
 #include <system_error>
 
 namespace llvm {

diff  --git a/llvm/include/llvm/module.modulemap b/llvm/include/llvm/module.modulemap
index ecb3b37004fd..856cd96bba0a 100644
--- a/llvm/include/llvm/module.modulemap
+++ b/llvm/include/llvm/module.modulemap
@@ -169,12 +169,31 @@ module LLVM_ExecutionEngine {
 
   // FIXME: These exclude directives were added as a workaround for
   //        <rdar://problem/29247092> and should be removed once it is fixed.
-  exclude header "ExecutionEngine/Orc/RawByteChannel.h"
-  exclude header "ExecutionEngine/Orc/RPCUtils.h"
   exclude header "ExecutionEngine/Orc/OrcRemoteTargetRPCAPI.h"
   exclude header "ExecutionEngine/Orc/OrcRemoteTargetClient.h"
   exclude header "ExecutionEngine/Orc/OrcRemoteTargetServer.h"
   exclude header "ExecutionEngine/Orc/RemoteObjectLayer.h"
+
+  // Exclude headers from LLVM_OrcSupport.
+  exclude header "ExecutionEngine/Orc/OrcError.h"
+  exclude header "ExecutionEngine/Orc/RPC/RPCUtils.h"
+  exclude header "ExecutionEngine/Orc/RPC/RPCSerialization.h"
+  exclude header "ExecutionEngine/Orc/RPC/RawByteChannel.h"
+
+}
+
+// Orc utilities that don't depend only on Support (not ExecutionEngine or
+// IR). This is a workaround for ExecutionEngine's broken layering, and will
+// be removed in the future.
+module LLVM_OrcSupport {
+  requires cplusplus
+
+  header "ExecutionEngine/Orc/OrcError.h"
+  header "ExecutionEngine/Orc/RPC/RPCUtils.h"
+  header "ExecutionEngine/Orc/RPC/RPCSerialization.h"
+  header "ExecutionEngine/Orc/RPC/RawByteChannel.h"
+
+  export *
 }
 
 module LLVM_Pass {

diff  --git a/llvm/lib/ExecutionEngine/OrcError/OrcError.cpp b/llvm/lib/ExecutionEngine/OrcError/OrcError.cpp
index e6e9a095319c..5eab246d4b48 100644
--- a/llvm/lib/ExecutionEngine/OrcError/OrcError.cpp
+++ b/llvm/lib/ExecutionEngine/OrcError/OrcError.cpp
@@ -14,6 +14,8 @@
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/ManagedStatic.h"
 
+#include <type_traits>
+
 using namespace llvm;
 using namespace llvm::orc;
 

diff  --git a/llvm/lib/ExecutionEngine/OrcError/RPCError.cpp b/llvm/lib/ExecutionEngine/OrcError/RPCError.cpp
index b77a526f5718..3cf78fd9f7ba 100644
--- a/llvm/lib/ExecutionEngine/OrcError/RPCError.cpp
+++ b/llvm/lib/ExecutionEngine/OrcError/RPCError.cpp
@@ -11,6 +11,11 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/ExecutionEngine/Orc/RPC/RPCUtils.h"
+#include "llvm/Support/Error.h"
+#include "llvm/Support/raw_ostream.h"
+
+#include <system_error>
+#include <string>
 
 char llvm::orc::rpc::RPCFatalError::ID = 0;
 char llvm::orc::rpc::ConnectionClosed::ID = 0;

diff  --git a/llvm/lib/Support/Error.cpp b/llvm/lib/Support/Error.cpp
index 9ea08c37478e..27e0a49e9b80 100644
--- a/llvm/lib/Support/Error.cpp
+++ b/llvm/lib/Support/Error.cpp
@@ -10,6 +10,7 @@
 #include "llvm/ADT/Twine.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/ManagedStatic.h"
+#include "llvm/Support/Signals.h"
 #include <system_error>
 
 using namespace llvm;
@@ -103,11 +104,13 @@ std::error_code errorToErrorCode(Error Err) {
 #if LLVM_ENABLE_ABI_BREAKING_CHECKS
 void Error::fatalUncheckedError() const {
   dbgs() << "Program aborted due to an unhandled Error:\n";
-  if (getPtr())
+  if (getPtr()) {
     getPtr()->log(dbgs());
-  else
+    dbgs() << "\n";
+  }else
     dbgs() << "Error value was Success. (Note: Success values must still be "
               "checked prior to being destroyed).\n";
+  PrintStackTrace();
   abort();
 }
 #endif


        


More information about the llvm-commits mailing list