JuliaHubOSS / llvm-cbe

resurrected LLVM "C Backend", with improvements
Other
826 stars 141 forks source link

no matching constructor for initialization of `llvm::TargetSubtargetInfo` when building with LLVM 12 #116

Closed XAMPPRocky closed 1 year ago

XAMPPRocky commented 3 years ago

When trying to build with LLVM 12, I ran into the following build error. It seems like there was just an extra argument added that isn't handled.

Command

cmake -S .. -DLLVM_DIR=/usr/local/Cellar/llvm/12.0.0/lib/cmake/llvm
LLVM_DIR=/usr/local/Cellar/llvm/12.0.0/lib/cmake/llvm make llvm-cbe
/Users/src/llvm-cbe/lib/Target/CBackend/TargetInfo/../CTargetMachine.h:36:9: error: no matching constructor for initialization of 'llvm::TargetSubtargetInfo'
      : TargetSubtargetInfo(TT, CPU, FS, ArrayRef<SubtargetFeatureKV>(),
        ^                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/llvm/12.0.0/include/llvm/CodeGen/TargetSubtargetInfo.h:61:3: note: candidate constructor not viable: requires 12 arguments, but 11 were provided
  TargetSubtargetInfo(const Triple &TT, StringRef CPU, StringRef TuneCPU,
  ^
/usr/local/Cellar/llvm/12.0.0/include/llvm/CodeGen/TargetSubtargetInfo.h:76:3: note: candidate constructor not viable: requires 1 argument, but 11 were provided
  TargetSubtargetInfo(const TargetSubtargetInfo &) = delete;
  ^
/usr/local/Cellar/llvm/12.0.0/include/llvm/CodeGen/TargetSubtargetInfo.h:75:3: note: candidate constructor not viable: requires 0 arguments, but 11 were provided
  TargetSubtargetInfo() = delete;
  ^
hikari-no-yume commented 3 years ago

We only just got LLVM 11 support (https://github.com/JuliaComputingOSS/llvm-cbe/pull/91), there's no LLVM 12 support yet unfortunately.

If this is the only problem, it might be easy to fix.

jfm535 commented 3 years ago

this is also handled by my pull req #140 The reason for its failure is a missing field called TuneCPU

dpaoliello commented 1 year ago

LLVM 16 is now supported #164