Recommit "[RISCV] Remove include of RISCVRegisterInfo.h from RISCVBaseInfo.h. NFCI"

This reverts 781917254d and recommits
781917254d.

I've changed getRegForInlineAsmConstraint to not use a std::pair
of Register in a previous commit. Hopefully that fixes the reported
issue with expensive checks on Windows. I'm still not sure exactly
why this commit removing an include affected a different file.

Original message:

RISCVRegisterInfo.h is part of the CodeGen layer. The Utils library
is intended to be shared with the MC layer so shouldn't use files
from the CodeGen layer.

The register enum names are already available from
RISCVMCTargetDesc.h. It appears what was coming from this include
was a transitive include of the Register class which I've replaced
with MCRegister. Register has a constructor from MCRegister so it
should be convertible.
This commit is contained in:
Craig Topper 2020-11-01 10:31:59 -08:00
parent a76cd10fcd
commit e57237f198
2 changed files with 4 additions and 5 deletions

View File

@ -65,10 +65,10 @@ ABI getTargetABI(StringRef ABIName) {
// To avoid the BP value clobbered by a function call, we need to choose a
// callee saved register to save the value. RV32E only has X8 and X9 as callee
// saved registers and X8 will be used as fp. So we choose X9 as bp.
Register getBPReg() { return RISCV::X9; }
MCRegister getBPReg() { return RISCV::X9; }
// Returns the register holding shadow call stack pointer.
Register getSCSPReg() { return RISCV::X18; }
MCRegister getSCSPReg() { return RISCV::X18; }
} // namespace RISCVABI

View File

@ -13,7 +13,6 @@
#ifndef LLVM_LIB_TARGET_RISCV_MCTARGETDESC_RISCVBASEINFO_H
#define LLVM_LIB_TARGET_RISCV_MCTARGETDESC_RISCVBASEINFO_H
#include "RISCVRegisterInfo.h"
#include "MCTargetDesc/RISCVMCTargetDesc.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
@ -206,10 +205,10 @@ ABI computeTargetABI(const Triple &TT, FeatureBitset FeatureBits,
ABI getTargetABI(StringRef ABIName);
// Returns the register used to hold the stack pointer after realignment.
Register getBPReg();
MCRegister getBPReg();
// Returns the register holding shadow call stack pointer.
Register getSCSPReg();
MCRegister getSCSPReg();
} // namespace RISCVABI