leaningtech / cheerp-meta

Cheerp - a C/C++ compiler for Web applications - compiles to WebAssembly and JavaScript
https://labs.leaningtech.com/cheerp
Other
1.02k stars 50 forks source link

cheerp-llvm doesn't compile on linux #78

Closed Plaristote closed 6 years ago

Plaristote commented 6 years ago

Using archlinux with clang 6.0.0, cheerp-llvm fails to compile... but don't panic, it's an easy issue to fix !

It just appears like std::unique_ptr can't always be implicitly converted to bool. In the file include/llvm/IR/ValueMap.h, line 104, such a thing happen, and my compiler didn't like it.

Perhaps return MDMap.get() instead of directly returning MDMap.

yuri91 commented 6 years ago

Hi, thanks for reporting this.

I am trying to reproduce your issue, but I can't. You are right that the method at line 104 is wrong, but It gives no error to me, because the class is a template, and the method itself is never used. Could you try to comment it out and see if you have any errors, and in that case report here where they are? Thanks

Plaristote commented 6 years ago

Indeed, commenting out the line doesn't break the compilation. It completed without reporting any errors.

yuri91 commented 6 years ago

Ok thanks. I fixed the method with https://github.com/leaningtech/cheerp-llvm/commit/e23baecf17193a800365f975f754008c87467b9a