cmu-db / peloton

The Self-Driving Database Management System
http://pelotondb.io
Apache License 2.0
2.03k stars 624 forks source link

Unable to build master #1438

Closed pervazea closed 6 years ago

pervazea commented 6 years ago

On my laptop.

[  1%] Built target capnp
[ 12%] Built target pg_query
[ 14%] Built target peloton-proto
[ 14%] Built target peloton-capnp
[ 14%] Building CXX object src/CMakeFiles/peloton.dir/codegen/interpreter/bytecode_builder.cpp.o
/home/pakhtar/proj/master_bin/peloton/src/codegen/interpreter/bytecode_builder.cpp: In member function ‘void peloton::codegen::interpreter::BytecodeBuilder::AnalyseFunction()’:
/home/pakhtar/proj/master_bin/peloton/src/codegen/interpreter/bytecode_builder.cpp:491:46: error: cannot convert ‘llvm::BasicBlock::const_iterator {aka llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, false, false, void>, false, true>}’ to ‘const llvm::Instruction*’ in initialization
       const llvm::Instruction *instruction = instr_iterator;
                                              ^
/home/pakhtar/proj/master_bin/peloton/src/codegen/interpreter/bytecode_builder.cpp: In member function ‘void peloton::codegen::interpreter::BytecodeBuilder::TranslateFunction()’:
/home/pakhtar/proj/master_bin/peloton/src/codegen/interpreter/bytecode_builder.cpp:831:46: error: cannot convert ‘llvm::BasicBlock::const_iterator {aka llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, false, false, void>, false, true>}’ to ‘const llvm::Instruction*’ in initialization
       const llvm::Instruction *instruction = instr_iterator;
                                              ^
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-implicit-fallthrough’ [-Werror]
cc1plus: all warnings being treated as errors
src/CMakeFiles/peloton.dir/build.make:8798: recipe for target 'src/CMakeFiles/peloton.dir/codegen/interpreter/bytecode_builder.cpp.o' failed
make[2]: *** [src/CMakeFiles/peloton.dir/codegen/interpreter/bytecode_builder.cpp.o] Error 1
CMakeFiles/Makefile2:1130: recipe for target 'src/CMakeFiles/peloton.dir/all' failed
make[1]: *** [src/CMakeFiles/peloton.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Environment:

tcm-marcel commented 6 years ago

Changing the line to const llvm::Instruction *instruction = &(*instr_iterator); makes it work.

The problem: &(* ... ) is technically the identity. In this case however, the *operator in the iterator is overloaded to return an object reference, from which we want the pointer. Most compiler understand what to do because of the requested destination type. For some compiler configurations however this doesn't seem to work.