<div dir="ltr">There are always pretty big, and incompatible, changes between major LLVM versions. Ideally, the publisher of your book would provide a site with updates to their code.<div><br></div><div>The easiest thing for you to do is to get LLVM 3.5 and use that.</div><div><br></div><div>Or, you could do a diff between the 3.5 and 3.8 versions of the headers for the classes you're inheriting from and see if there's been something like an obvious simple renaming of methods.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 26, 2016 at 9:00 AM, Wolfgang McSneed via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-size:12.8px">Hi,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I am trying to write my own backend using LLVM and I downloaded the support files from the book titled "LLVM Cookbook" for the "Toy" architecture described in the book.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I made the changes described in the book to register the TOY architecture but am seeing compile errors. I am not sure if I set this up correctly. The code that I am compiling for the backend was downloaded from the publisher and should be tested? (I think they used 3.5 whereas I am using 3.8.0)</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Any help would be much appreciated!</div><div style="font-size:12.8px"><br>Wolf</div><div style="font-size:12.8px"><br></div><div><div><span style="font-size:12.8px">[ 59%] Built target LLVMXCoreInfo</span></div><div><span style="font-size:12.8px">[ 59%] Built target LLVMXCoreDesc</span></div><div><span style="font-size:12.8px">[ 59%] Updating TOYGenRegisterInfo.inc...</span></div><div><span style="font-size:12.8px">[ 59%] Updating TOYGenInstrInfo.inc...</span></div><div><span style="font-size:12.8px">[ 60%] Updating TOYGenAsmWriter.inc...</span></div><div><span style="font-size:12.8px">[ 60%] Updating TOYGenDAGISel.inc...</span></div><div><span style="font-size:12.8px">[ 60%] Updating TOYGenCallingConv.inc...</span></div><div><span style="font-size:12.8px">[ 60%] Updating TOYGenSubtargetInfo.inc...</span></div><div><span style="font-size:12.8px">[ 60%] Updating TOYGenMCCodeEmitter.inc...</span></div><div><span style="font-size:12.8px">[ 60%] Built target TOYCommonTableGen</span></div><div><span style="font-size:12.8px">Scanning dependencies of target LLVMTOYCodeGen</span></div><div><span style="font-size:12.8px">[ 60%] Building CXX object lib/Target/TOY/CMakeFiles/LLVMTOYCodeGen.dir/TOYSubtarget.cpp.o</span></div><div><span style="font-size:12.8px">In file included from /home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYInstrInfo.h:17:0,</span></div><div><span style="font-size:12.8px"> from /home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.h:20,</span></div><div><span style="font-size:12.8px"> from /home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.cpp:14:</span></div><div><span style="font-size:12.8px">/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYRegisterInfo.h:34:19: error: ‘const uint32_t* llvm::TOYRegisterInfo::getCallPreservedMask(llvm::CallingConv::ID) const’ marked override, but does not override</span></div><div><span style="font-size:12.8px"> const uint32_t *getCallPreservedMask(CallingConv::ID) const override;</span></div><div><span style="font-size:12.8px"> ^</span></div><div><span style="font-size:12.8px">In file included from /home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.cpp:14:0:</span></div><div><span style="font-size:12.8px">/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.h:69:21: error: ‘const llvm::DataLayout* llvm::TOYSubtarget::getDataLayout() const’ marked override, but does not override</span></div><div><span style="font-size:12.8px"> const DataLayout *getDataLayout() const override { return &DL; }</span></div><div><span style="font-size:12.8px"> ^</span></div><div><span style="font-size:12.8px">/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.h:41:20: error: cannot declare field ‘llvm::TOYSubtarget::FrameLowering’ to be of abstract type ‘llvm::TOYFrameLowering’</span></div><div><span style="font-size:12.8px"> TOYFrameLowering FrameLowering;</span></div><div><span style="font-size:12.8px"> ^</span></div><div><span style="font-size:12.8px">In file included from /home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.h:18:0,</span></div><div><span style="font-size:12.8px"> from /home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.cpp:14:</span></div><div><span style="font-size:12.8px">/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYFrameLowering.h:24:7: note: because the following virtual functions are pure within ‘llvm::TOYFrameLowering’:</span></div><div><span style="font-size:12.8px"> class TOYFrameLowering : public TargetFrameLowering {</span></div><div><span style="font-size:12.8px"> ^</span></div><div><span style="font-size:12.8px">In file included from /home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYFrameLowering.h:18:0,</span></div><div><span style="font-size:12.8px"> from /home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.h:18,</span></div><div><span style="font-size:12.8px"> from /home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.cpp:14:</span></div><div><span style="font-size:12.8px">/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/include/llvm/Target/TargetFrameLowering.h:156:16: note: <span style="white-space:pre-wrap"> </span>virtual void llvm::TargetFrameLowering::emitPrologue(llvm::MachineFunction&, llvm::MachineBasicBlock&) const</span></div><div><span style="font-size:12.8px"> virtual void emitPrologue(MachineFunction &MF,</span></div><div><span style="font-size:12.8px"> ^</span></div><div><span style="font-size:12.8px">/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.cpp: In constructor ‘llvm::TOYSubtarget::TOYSubtarget(const string&, const string&, const string&, llvm::TOYTargetMachine&)’:</span></div><div><span style="font-size:12.8px">/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.cpp:32:58: error: no matching function for call to ‘llvm::TOYGenSubtargetInfo::TOYGenSubtargetInfo(const string&, const string&, const string&)’</span></div><div><span style="font-size:12.8px"> InstrInfo(), TLInfo(TM), TSInfo(DL), FrameLowering() {}</span></div><div><span style="font-size:12.8px"> ^</span></div><div><span style="font-size:12.8px">/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.cpp:32:58: note: candidate is:</span></div><div><span style="font-size:12.8px">In file included from /home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.cpp:22:0:</span></div><div><span style="font-size:12.8px">/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/build/lib/Target/TOY/TOYGenSubtargetInfo.inc:117:1: note: llvm::TOYGenSubtargetInfo::TOYGenSubtargetInfo(const llvm::Triple&, llvm::StringRef, llvm::StringRef)</span></div><div><span style="font-size:12.8px"> TOYGenSubtargetInfo::TOYGenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)</span></div><div><span style="font-size:12.8px"> ^</span></div><div><span style="font-size:12.8px">/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/build/lib/Target/TOY/TOYGenSubtargetInfo.inc:117:1: note: no known conversion for argument 1 from ‘const string {aka const std::basic_string<char>}’ to ‘const llvm::Triple&’</span></div><div><span style="font-size:12.8px">make[2]: *** [lib/Target/TOY/CMakeFiles/LLVMTOYCodeGen.dir/TOYSubtarget.cpp.o] Error 1</span></div><div><span style="font-size:12.8px">make[1]: *** [lib/Target/TOY/CMakeFiles/LLVMTOYCodeGen.dir/all] Error 2</span></div><div><span style="font-size:12.8px">make: *** [all] Error 2</span></div></div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>