Hi! I failed to build gollvm following the instructions. Which LLVM version should I use? Thank you in advance!
Right now I'm using the LLVM main branch (6f253e87). Below is the build error:
[444/4666] Building CXX object tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/GoStatepoints.cpp.o
FAILED: tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/GoStatepoints.cpp.o
/usr/bin/c++ -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/qiling/llvm-project/build-debug/tools/gollvm/passes -I/home/qiling/llvm-project/llvm/tools/gollvm/passes -I/home/qiling/llvm-project/build-debug/include -I/home/qiling/llvm-project/llvm/include -I/home/qiling/llvm-project/llvm/tools/gollvm/driver -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-dangling-reference -Wno-redundant-move -Wno-pessimizing-move -Wno-array-bounds -Wno-stringop-overread -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -g -std=c++17 -Wno-suggest-override -fcf-protection=none -fno-exceptions -funwind-tables -fno-rtti -MD -MT tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/GoStatepoints.cpp.o -MF tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/GoStatepoints.cpp.o.d -o tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/GoStatepoints.cpp.o -c /home/qiling/llvm-project/llvm/tools/gollvm/passes/GoStatepoints.cpp
/home/qiling/llvm-project/llvm/tools/gollvm/passes/GoStatepoints.cpp: In function ‘void zeroAmbiguouslyLiveSlots(llvm::Function&, llvm::SetVector<llvm::Value*>&, llvm::SetVector<llvm::Value*>&)’:
/home/qiling/llvm-project/llvm/tools/gollvm/passes/GoStatepoints.cpp:1772:36: error: no matching function for call to ‘llvm::IRBuilder<>::CreateLifetimeStart(llvm::Instruction*, llvm::ConstantInt*)’
1772 | Builder.CreateLifetimeStart(&I, ConstantInt::get(Int64Ty, Size));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/qiling/llvm-project/llvm/tools/gollvm/passes/GoStatepoints.cpp:44:
/home/qiling/llvm-project/llvm/include/llvm/IR/IRBuilder.h:814:22: note: candidate: ‘llvm::CallInst* llvm::IRBuilderBase::CreateLifetimeStart(llvm::Value*)’
814 | LLVM_ABI CallInst *CreateLifetimeStart(Value *Ptr);
| ^~~~~~~~~~~~~~~~~~~
/home/qiling/llvm-project/llvm/include/llvm/IR/IRBuilder.h:814:22: note: candidate expects 1 argument, 2 provided
/home/qiling/llvm-project/llvm/tools/gollvm/passes/GoStatepoints.cpp: In member function ‘bool llvm::GoStatepoints::runOnFunction(llvm::Function&, llvm::DominatorTree&, llvm::TargetTransformInfo&, const llvm::TargetLibraryInfo&)’:
/home/qiling/llvm-project/llvm/tools/gollvm/passes/GoStatepoints.cpp:2278:25: warning: ‘void llvm::Instruction::moveBefore(llvm::Instruction*)’ is deprecated: Use iterators as instruction positions [-Wdeprecated-declarations]
2278 | Cond->moveBefore(TI);
| ~~~~~~~~~~~~~~~~^~~~
In file included from /home/qiling/llvm-project/llvm/include/llvm/IR/DebugProgramInstruction.h:55,
from /home/qiling/llvm-project/llvm/include/llvm/IR/BasicBlock.h:23,
from /home/qiling/llvm-project/llvm/include/llvm/IR/Dominators.h:26,
from /home/qiling/llvm-project/llvm/include/llvm/Analysis/DomTreeUpdater.h:18,
from /home/qiling/llvm-project/llvm/tools/gollvm/passes/GoStatepoints.cpp:31:
/home/qiling/llvm-project/llvm/include/llvm/IR/Instruction.h:246:37: note: declared here
246 | "") void moveBefore(Instruction *MovePos);
| ^~~~~~~~~~
/home/qiling/llvm-project/llvm/tools/gollvm/passes/GoStatepoints.cpp: In function ‘void fixStackWriteBarriers(llvm::Function&, {anonymous}::DefiningValueMapTy&)’:
/home/qiling/llvm-project/llvm/tools/gollvm/passes/GoStatepoints.cpp:3006:55: warning: ‘static llvm::PointerType* llvm::PointerType::get(llvm::Type*, unsigned int)’ is deprecated: PointerType::get with pointee type is pending removal. Use Context overload. [-Wdeprecated-declarations]
3006 | PointerType::get(Val->getType(), AS));
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /home/qiling/llvm-project/llvm/include/llvm/IR/DataLayout.h:28,
from /home/qiling/llvm-project/llvm/tools/gollvm/passes/RemoveAddrSpace.h:18,
from /home/qiling/llvm-project/llvm/tools/gollvm/passes/GollvmPasses.h:16,
from /home/qiling/llvm-project/llvm/tools/gollvm/passes/GoStatepoints.cpp:18:
/home/qiling/llvm-project/llvm/include/llvm/IR/DerivedTypes.h:713:32: note: declared here
713 | LLVM_ABI static PointerType *get(Type *ElementType, unsigned AddressSpace);
| ^~~