Skip to content

Commit

Permalink
Merge pull request #20823 from JuliaLang/yyc/tests/llvm
Browse files Browse the repository at this point in the history
Fix compilation on LLVM svn
  • Loading branch information
yuyichao authored Feb 28, 2017
2 parents b59abda + b6cf195 commit bdef3b5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/jitlayers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ JL_DLLEXPORT void ORCNotifyObjectEmitted(JITEventListener *Listener,

// TODO: hook up RegisterJITEventListener, instead of hard-coding the GDB and JuliaListener targets
template <typename ObjSetT, typename LoadResult>
void JuliaOJIT::DebugObjectRegistrar::operator()(ObjectLinkingLayerBase::ObjSetHandleT H,
void JuliaOJIT::DebugObjectRegistrar::operator()(RTDyldObjectLinkingLayerBase::ObjSetHandleT H,
const ObjSetT &Objects, const LoadResult &LOS)
{
#if JL_LLVM_VERSION < 30800
Expand Down
18 changes: 15 additions & 3 deletions src/jitlayers.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
#include "llvm/ExecutionEngine/Orc/IRCompileLayer.h"
#include "llvm/ExecutionEngine/Orc/LambdaResolver.h"
#include "llvm/ExecutionEngine/Orc/LazyEmittingLayer.h"
#include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
#if JL_LLVM_VERSION >= 50000
# include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h"
#else
# include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
#endif
#include "llvm/ExecutionEngine/ObjectMemoryBuffer.h"
#elif defined(USE_MCJIT)
#include <llvm/ExecutionEngine/MCJIT.h>
Expand Down Expand Up @@ -164,6 +168,14 @@ typedef JITSymbol JL_SymbolInfo;
typedef orc::JITSymbol JL_JITSymbol;
typedef RuntimeDyld::SymbolInfo JL_SymbolInfo;
#endif
#if JL_LLVM_VERSION >= 50000
using orc::RTDyldObjectLinkingLayerBase;
using orc::RTDyldObjectLinkingLayer;
#else
using RTDyldObjectLinkingLayerBase = orc::ObjectLinkingLayerBase;
template <typename NotifyLoadedFtor>
using RTDyldObjectLinkingLayer = orc::ObjectLinkingLayer<NotifyLoadedFtor>;
#endif

class JuliaOJIT {
// Custom object emission notification handler for the JuliaOJIT
Expand All @@ -172,7 +184,7 @@ class JuliaOJIT {
public:
DebugObjectRegistrar(JuliaOJIT &JIT);
template <typename ObjSetT, typename LoadResult>
void operator()(orc::ObjectLinkingLayerBase::ObjSetHandleT H, const ObjSetT &Objects,
void operator()(RTDyldObjectLinkingLayerBase::ObjSetHandleT H, const ObjSetT &Objects,
const LoadResult &LOS);
private:
void NotifyGDB(object::OwningBinary<object::ObjectFile> &DebugObj);
Expand All @@ -182,7 +194,7 @@ class JuliaOJIT {
};

public:
typedef orc::ObjectLinkingLayer<DebugObjectRegistrar> ObjLayerT;
typedef RTDyldObjectLinkingLayer<DebugObjectRegistrar> ObjLayerT;
typedef orc::IRCompileLayer<ObjLayerT> CompileLayerT;
typedef CompileLayerT::ModuleSetHandleT ModuleHandleT;
typedef StringMap<void*> SymbolTableT;
Expand Down

0 comments on commit bdef3b5

Please sign in to comment.