Update clang to r339409.
Change-Id: I800772d2d838223be1f6b40d490c4591b937fca2
diff --git a/linux-x64/clang/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h b/linux-x64/clang/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
index a7f9416..ad64815 100644
--- a/linux-x64/clang/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
+++ b/linux-x64/clang/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
@@ -16,8 +16,9 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/ExecutionEngine/JITSymbol.h"
-#include "llvm/ExecutionEngine/Orc/Core.h"
+#include "llvm/ExecutionEngine/Orc/Layer.h"
#include "llvm/Support/Error.h"
+#include "llvm/Support/MemoryBuffer.h"
#include <memory>
#include <string>
@@ -27,7 +28,30 @@
namespace orc {
-/// @brief Eager IR compiling layer.
+class IRCompileLayer2 : public IRLayer {
+public:
+ using CompileFunction =
+ std::function<Expected<std::unique_ptr<MemoryBuffer>>(Module &)>;
+
+ using NotifyCompiledFunction =
+ std::function<void(VModuleKey K, std::unique_ptr<Module>)>;
+
+ IRCompileLayer2(ExecutionSession &ES, ObjectLayer &BaseLayer,
+ CompileFunction Compile);
+
+ void setNotifyCompiled(NotifyCompiledFunction NotifyCompiled);
+
+ void emit(MaterializationResponsibility R, VModuleKey K,
+ std::unique_ptr<Module> M) override;
+
+private:
+ mutable std::mutex IRLayerMutex;
+ ObjectLayer &BaseLayer;
+ CompileFunction Compile;
+ NotifyCompiledFunction NotifyCompiled = NotifyCompiledFunction();
+};
+
+/// Eager IR compiling layer.
///
/// This layer immediately compiles each IR module added via addModule to an
/// object file and adds this module file to the layer below, which must
@@ -35,11 +59,11 @@
template <typename BaseLayerT, typename CompileFtor>
class IRCompileLayer {
public:
- /// @brief Callback type for notifications when modules are compiled.
+ /// Callback type for notifications when modules are compiled.
using NotifyCompiledCallback =
std::function<void(VModuleKey K, std::unique_ptr<Module>)>;
- /// @brief Construct an IRCompileLayer with the given BaseLayer, which must
+ /// Construct an IRCompileLayer with the given BaseLayer, which must
/// implement the ObjectLayer concept.
IRCompileLayer(
BaseLayerT &BaseLayer, CompileFtor Compile,
@@ -47,15 +71,15 @@
: BaseLayer(BaseLayer), Compile(std::move(Compile)),
NotifyCompiled(std::move(NotifyCompiled)) {}
- /// @brief Get a reference to the compiler functor.
+ /// Get a reference to the compiler functor.
CompileFtor& getCompiler() { return Compile; }
- /// @brief (Re)set the NotifyCompiled callback.
+ /// (Re)set the NotifyCompiled callback.
void setNotifyCompiled(NotifyCompiledCallback NotifyCompiled) {
this->NotifyCompiled = std::move(NotifyCompiled);
}
- /// @brief Compile the module, and add the resulting object to the base layer
+ /// Compile the module, and add the resulting object to the base layer
/// along with the given memory manager and symbol resolver.
Error addModule(VModuleKey K, std::unique_ptr<Module> M) {
if (auto Err = BaseLayer.addObject(std::move(K), Compile(*M)))
@@ -65,10 +89,10 @@
return Error::success();
}
- /// @brief Remove the module associated with the VModuleKey K.
+ /// Remove the module associated with the VModuleKey K.
Error removeModule(VModuleKey K) { return BaseLayer.removeObject(K); }
- /// @brief Search for the given named symbol.
+ /// Search for the given named symbol.
/// @param Name The name of the symbol to search for.
/// @param ExportedSymbolsOnly If true, search only for exported symbols.
/// @return A handle for the given named symbol, if it exists.
@@ -76,7 +100,7 @@
return BaseLayer.findSymbol(Name, ExportedSymbolsOnly);
}
- /// @brief Get the address of the given symbol in compiled module represented
+ /// Get the address of the given symbol in compiled module represented
/// by the handle H. This call is forwarded to the base layer's
/// implementation.
/// @param K The VModuleKey for the module to search in.
@@ -89,7 +113,7 @@
return BaseLayer.findSymbolIn(K, Name, ExportedSymbolsOnly);
}
- /// @brief Immediately emit and finalize the module represented by the given
+ /// Immediately emit and finalize the module represented by the given
/// handle.
/// @param K The VModuleKey for the module to emit/finalize.
Error emitAndFinalize(VModuleKey K) { return BaseLayer.emitAndFinalize(K); }