[PATCH] D90322: [RISCV] Remove include of RISCVRegisterInfo.h from RISCVBaseInfo.h

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 30 10:37:44 PDT 2020


craig.topper added a comment.

In D90322#2364239 <https://reviews.llvm.org/D90322#2364239>, @RKSimon wrote:

> @craig.topper This is causing a MSVC build failure in RISCVTargetLowering::getRegForInlineAsmConstraint
>
>   if (Subtarget.hasStdExtF() || Subtarget.hasStdExtD()) {
>     std::pair<Register, Register> FReg =
>         StringSwitch<std::pair<Register, Register>>(Constraint.lower())
>             .Cases("{f0}", "{ft0}", {RISCV::F0_F, RISCV::F0_D})
>             .Cases("{f1}", "{ft1}", {RISCV::F1_F, RISCV::F1_D})
>
> with this build failure:
>
>   E:\llvm\llvm-project\llvm\include\llvm/Support/type_traits.h(180): error C2338: inconsistent behavior between llvm:: and std:: implementation of is_trivially_copyable
>   E:\llvm\llvm-project\llvm\include\llvm/ADT/Optional.h(216): note: see reference to class template instantiation 'llvm::is_trivially_copyable<T>' being compiled
>           with
>           [
>               T=std::pair<llvm::Register,llvm::Register>
>           ]
>   E:\llvm\llvm-project\llvm\include\llvm/ADT/StringSwitch.h(48): note: see reference to class template instantiation 'llvm::Optional<T>' being compiled
>           with
>           [
>               T=std::pair<llvm::Register,llvm::Register>
>           ]
>   E:\llvm\llvm-project\llvm\lib\Target\RISCV\RISCVISelLowering.cpp(2725): note: see reference to class template instantiation 'llvm::StringSwitch<std::pair<llvm::Register,llvm::Register>,T>' being compiled
>           with
>           [
>               T=std::pair<llvm::Register,llvm::Register>
>           ]
>   E:\llvm\llvm-project\llvm\include\llvm/ADT/Optional.h(216): error C2976: 'llvm::optional_detail::OptionalStorage': too few template arguments
>   E:\llvm\llvm-project\llvm\include\llvm/ADT/Optional.h(36): note: see declaration of 'llvm::optional_detail::OptionalStorage'

I'm having trouble finding the connect to my patch. RISCVISelLowering.cpp has its own include of RISCVRegisterInfo.h. And it doesn't appear to call either getSCSPReg() or getBPReg().


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90322/new/

https://reviews.llvm.org/D90322



More information about the llvm-commits mailing list