In newer versions of LLVM (from LLVM 14), there's no default AttrBuilder constructor, it's necessary to add a LLVMContext.
Modify:
|
llvm::AttrBuilder Attr; |
|
llvm::TypeSize Sz = |
|
CGM.getModule()->getDataLayout().getTypeStoreSize( |
|
CGM.convertType(FP->getType())); |
|
Attr.addDereferenceableAttr(Sz); |
|
Attr.addAttribute(llvm::Attribute::NoCapture); |
|
Arg->addAttrs(Attr); |
For:
llvm::AttrBuilder Attr(CGM.getLLVMCtx()); // add context here from CGM object
llvm::TypeSize Sz = CGM.getModule()->getDataLayout().getTypeStoreSize(CGM.convertType(FP->getType()));
Attr.addDereferenceableAttr(Sz);
Attr.addAttribute(llvm::Attribute::NoCapture);
Arg->addAttrs(Attr);
In newer versions of LLVM (from LLVM 14), there's no default AttrBuilder constructor, it's necessary to add a LLVMContext.
Modify:
Learn-LLVM-12/Chapter05/tinylang/lib/CodeGen/CGProcedure.cpp
Lines 201 to 207 in 8e94087
For: