Skip to content

Commit 5c635ad

Browse files
authored
Merge pull request #34313 from JuliaLang/vc/llvm10
Support LLVM 10 changes
2 parents c9940ed + 38675f8 commit 5c635ad

File tree

4 files changed

+9
-18
lines changed

4 files changed

+9
-18
lines changed

src/disasm.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,9 @@ static void jl_dump_asm_internal(
914914
MCDisassembler::DecodeStatus S;
915915
FuncMCView view = memoryObject.slice(Index);
916916
S = DisAsm->getInstruction(Inst, insSize, view, 0,
917+
#if JL_LLVM_VERSION < 100000
917918
/*VStream*/ nulls(),
919+
#endif
918920
/*CStream*/ pass != 0 ? Streamer->GetCommentOS() : nulls());
919921
if (pass != 0 && Streamer->GetCommentOS().tell() > 0)
920922
Streamer->GetCommentOS() << '\n';

src/jitlayers.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ void JuliaOJIT::addModule(std::unique_ptr<Module> M)
460460
{
461461
#ifndef JL_NDEBUG
462462
// validate the relocations for M
463-
for (Module::global_object_iterator I = M->global_object_begin(), E = M->global_object_end(); I != E; ) {
463+
for (Module::global_object_iterator I = M->global_objects().begin(), E = M->global_objects().end(); I != E; ) {
464464
GlobalObject *F = &*I;
465465
++I;
466466
if (F->isDeclaration()) {
@@ -771,7 +771,7 @@ static void jl_merge_recursive(Module *m, Module *collector)
771771
// since the declarations may get destroyed by the jl_merge_module call.
772772
// this is also why we copy the Name string, rather than save a StringRef
773773
SmallVector<std::string, 8> to_finalize;
774-
for (Module::global_object_iterator I = m->global_object_begin(), E = m->global_object_end(); I != E; ++I) {
774+
for (Module::global_object_iterator I = m->global_objects().begin(), E = m->global_objects().end(); I != E; ++I) {
775775
GlobalObject *F = &*I;
776776
if (!F->isDeclaration()) {
777777
module_for_fname.erase(F->getName());
@@ -846,7 +846,7 @@ void jl_finalize_module(Module *m, bool shadow)
846846
{
847847
// record the function names that are part of this Module
848848
// so it can be added to the JIT when needed
849-
for (Module::global_object_iterator I = m->global_object_begin(), E = m->global_object_end(); I != E; ++I) {
849+
for (Module::global_object_iterator I = m->global_objects().begin(), E = m->global_objects().end(); I != E; ++I) {
850850
GlobalObject *F = &*I;
851851
if (!F->isDeclaration()) {
852852
if (isa<Function>(F)) {

src/llvm-alloc-opt.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,11 @@ void Optimizer::splitOnStack(CallInst *orig_inst)
13601360
offset - slot.offset);
13611361
auto sub_size = std::min(slot.offset + slot.size, offset + size) -
13621362
std::max(offset, slot.offset);
1363+
#if JL_LLVM_VERSION >= 100000
1364+
builder.CreateMemSet(ptr8, val_arg, sub_size, MaybeAlign(0));
1365+
#else
13631366
builder.CreateMemSet(ptr8, val_arg, sub_size, 0);
1367+
#endif
13641368
}
13651369
call->eraseFromParent();
13661370
return;

src/llvm-api.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -189,21 +189,6 @@ extern "C" JL_DLLEXPORT LLVMContextRef LLVMExtraGetValueContext(LLVMValueRef V)
189189
return wrap(&unwrap(V)->getContext());
190190
}
191191

192-
193-
#if JL_LLVM_VERSION < 80000
194-
extern ModulePass *createNVVMReflectPass();
195-
extern "C" JL_DLLEXPORT void LLVMExtraAddNVVMReflectPass(LLVMPassManagerRef PM)
196-
{
197-
unwrap(PM)->add(createNVVMReflectPass());
198-
}
199-
#else
200-
FunctionPass *createNVVMReflectPass(unsigned int SmVersion);
201-
extern "C" JL_DLLEXPORT void LLVMExtraAddNVVMReflectFunctionPass(LLVMPassManagerRef PM, unsigned int SmVersion)
202-
{
203-
unwrap(PM)->add(createNVVMReflectPass(SmVersion));
204-
}
205-
#endif
206-
207192
extern "C" JL_DLLEXPORT void
208193
LLVMExtraAddTargetLibraryInfoByTiple(const char *T, LLVMPassManagerRef PM)
209194
{

0 commit comments

Comments
 (0)