[llvm-dev] LLVM Newbie

Wolfgang McSneed via llvm-dev llvm-dev at lists.llvm.org
Mon Apr 25 14:00:10 PDT 2016


Hi,

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.

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)

Any help would be much appreciated!

Wolf

[ 59%] Built target LLVMXCoreInfo
[ 59%] Built target LLVMXCoreDesc
[ 59%] Updating TOYGenRegisterInfo.inc...
[ 59%] Updating TOYGenInstrInfo.inc...
[ 60%] Updating TOYGenAsmWriter.inc...
[ 60%] Updating TOYGenDAGISel.inc...
[ 60%] Updating TOYGenCallingConv.inc...
[ 60%] Updating TOYGenSubtargetInfo.inc...
[ 60%] Updating TOYGenMCCodeEmitter.inc...
[ 60%] Built target TOYCommonTableGen
Scanning dependencies of target LLVMTOYCodeGen
[ 60%] Building CXX object
lib/Target/TOY/CMakeFiles/LLVMTOYCodeGen.dir/TOYSubtarget.cpp.o
In file included from
/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYInstrInfo.h:17:0,
                 from
/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.h:20,
                 from
/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.cpp:14:
/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
   const uint32_t *getCallPreservedMask(CallingConv::ID) const override;
                   ^
In file included from
/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.cpp:14:0:
/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
   const DataLayout *getDataLayout() const override { return &DL; }
                     ^
/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’
   TOYFrameLowering FrameLowering;
                    ^
In file included from
/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.h:18:0,
                 from
/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.cpp:14:
/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’:
 class TOYFrameLowering : public TargetFrameLowering {
       ^
In file included from
/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYFrameLowering.h:18:0,
                 from
/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.h:18,
                 from
/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.cpp:14:
/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/include/llvm/Target/TargetFrameLowering.h:156:16:
note: virtual void
llvm::TargetFrameLowering::emitPrologue(llvm::MachineFunction&,
llvm::MachineBasicBlock&) const
   virtual void emitPrologue(MachineFunction &MF,
                ^
/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&)’:
/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&)’
       InstrInfo(), TLInfo(TM), TSInfo(DL), FrameLowering() {}
                                                          ^
/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.cpp:32:58:
note: candidate is:
In file included from
/home/wolf/gang/llvm/llvm_build/llvm-3.8.0.src/lib/Target/TOY/TOYSubtarget.cpp:22:0:
/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)
 TOYGenSubtargetInfo::TOYGenSubtargetInfo(const Triple &TT, StringRef CPU,
StringRef FS)
 ^
/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&’
make[2]: ***
[lib/Target/TOY/CMakeFiles/LLVMTOYCodeGen.dir/TOYSubtarget.cpp.o] Error 1
make[1]: *** [lib/Target/TOY/CMakeFiles/LLVMTOYCodeGen.dir/all] Error 2
make: *** [all] Error 2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160425/70fb9e95/attachment.html>


More information about the llvm-dev mailing list