This is an archive of the discontinued LLVM Phabricator instance.

Fix LLVMDumpType() #ifdefed
ClosedPublic

Authored by brenton on Mar 17 2018, 11:34 AM.

Details

Summary

Getting this error when using the LLVM C API and linking to a Release build

"Undefined symbols for architecture x86_64:
  \"_LLVMDumpType\", referenced from:
      _LLVMLink_LLVMDumpType_Wrapper in llvmc60.cpp.o
     (maybe you meant: _LLVMLink_LLVMDumpType_Wrapper)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see \
invocation)
make[2]: *** [LLVMLink.dylib] Error 1
make[1]: *** [CMakeFiles/LLVMLink.dir/all] Error 2
make: *** [all] Error 2
"

This fixes 34633

https://bugs.llvm.org/show_bug.cgi?id=34633

Diff Detail

Repository
rL LLVM

Event Timeline

brenton created this revision.Mar 17 2018, 11:34 AM
brenton edited the summary of this revision. (Show Details)Mar 17 2018, 11:38 AM
brenton updated this revision to Diff 138899.Mar 19 2018, 5:35 AM

dump() method seems to have been removed.

Use LLVMDumpValue() as a model

sammccall accepted this revision.Mar 23 2018, 7:43 AM

This makes sense to me, though I'm not an expert here so @MatzeB might want to confirm.

My r293460 was just unbreaking our build by reverting part of r293359, I don't know whether these functions *should* be exposed or not.

This revision is now accepted and ready to land.Mar 23 2018, 7:43 AM

I just wanted to follow suit with what other functions are doing, e.g., LLVMDumpModule.

I cannot merge this. I do not have permissions.

I was also wondering about getting this into 6.0.1 ?

@sammccall Could you merge this?

brenton added a subscriber: whitequark.

@whitequark It looks like you may be taking over the C API? I was wondering if you could look at this and merge it. This has stalled a bit and I'd like to wrap this up.

Thanks for the patch! Can you also remove LLVM_DUMP_METHOD here and elsewhere in the C API? It doesn't do anything useful.

brenton updated this revision to Diff 142769.Apr 17 2018, 7:06 AM

Also remove LLVM_DUMP_METHOD at the request of whitequark

@whitequark I've removed LLVM_DUMP_METHOD. Let me know if there is anything else that should be done. I'm keen on getting this into 6.0.1

Um, sorry, I mean only in the C API (extern "C" LLVM* methods). LLVM_DUMP_METHOD *does* serve a function in the C++ API.

brenton updated this revision to Diff 142778.Apr 17 2018, 7:51 AM

Only remove LLVM_DUMP_METHOD from C API functions

@whitequark Sorry about that. I believe that LLVMDumpType and LLVMDumpValue are the only C API functions

This revision was automatically updated to reflect the committed changes.
nhaehnle removed a subscriber: nhaehnle.Apr 18 2018, 2:26 AM