Skip to content

Commit

Permalink
Adapt to LLVM3.6 API change
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno committed Nov 2, 2014
1 parent 81742ce commit 2414a86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/cgutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,11 @@ static jl_value_t *julia_type_of(Value *v)
MDNode *mdn;
assert(v != NULL);
if (dyn_cast<Instruction>(v) == NULL ||
#ifdef LLVM36
(mdn = ((Instruction*)v)->getMDNode("julia_type")) == NULL) {
#else
(mdn = ((Instruction*)v)->getMetadata("julia_type")) == NULL) {
#endif
return julia_type_of_without_metadata(v, true);
}
MDString *md = (MDString*)mdn->getOperand(0);
Expand Down
5 changes: 3 additions & 2 deletions src/debuginfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,9 @@ void jl_getDylibFunctionInfo(const char **name, size_t *line, const char **filen
#endif
#ifdef LLVM36
if (errorobj) {
obj = errorobj.get().getBinary().release();
errorobj.get().getBuffer().release();
auto binary = errorobj.get().takeBinary();
obj = binary.first.release();
binary.second.release();
#elif LLVM35
if (errorobj) {
obj = errorobj.get();
Expand Down

2 comments on commit 2414a86

@staticfloat
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This caused the LLVM SVN builds to die:

In file included from codegen.cpp:543:0:
cgutils.cpp: In function ‘jl_value_t* julia_type_of(llvm::Value*)’:
cgutils.cpp:633:35: error: ‘class llvm::Instruction’ has no member named ‘getMDNode’
         (mdn = ((Instruction*)v)->getMDNode("julia_type")) == NULL) {
                                   ^
In file included from codegen.cpp:788:0:
debuginfo.cpp: In function ‘void jl_getDylibFunctionInfo(const char**, size_t*, const char**, size_t, int*, int)’:
debuginfo.cpp:367:46: error: ‘std::remove_reference<llvm::object::OwningBinary<llvm::object::ObjectFile> >::type’ has no member named ‘takeBinary’
                 auto binary = errorobj.get().takeBinary();
                                              ^
make[2]: *** [codegen.o] Error 1
make[1]: *** [julia-release] Error 2
make: *** [release] Error 2

Does this mean that just running make LLVM_VER=svn is not enough to update the LLVM dep in julia? Do I need to manually go into the dep and update it on my buildbot?

@Keno
Copy link
Member Author

@Keno Keno commented on 2414a86 Nov 4, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not actually quite sure when julia decides to update the LLVM dependency, but yes, it seems you'll need to update it manually.

Please sign in to comment.