[Hexagon] Removing static variable holding MCInstrInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229872 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Colin LeMahieu 2015-02-19 17:38:39 +00:00
parent c69bd70cd1
commit 5a71687970
4 changed files with 7 additions and 8 deletions

View File

@ -17,10 +17,9 @@
using namespace llvm; using namespace llvm;
std::unique_ptr <MCInstrInfo const> HexagonMCInst::MCII; HexagonMCInst::HexagonMCInst() : MCII (createHexagonMCInstrInfo ()) {}
HexagonMCInst::HexagonMCInst(MCInstrDesc const &mcid) :
HexagonMCInst::HexagonMCInst() : MCInst() {} MCII (createHexagonMCInstrInfo ()){}
HexagonMCInst::HexagonMCInst(MCInstrDesc const &mcid) : MCInst() {}
void HexagonMCInst::AppendImplicitOperands(MCInst &MCI) { void HexagonMCInst::AppendImplicitOperands(MCInst &MCI) {
MCI.addOperand(MCOperand::CreateImm(0)); MCI.addOperand(MCOperand::CreateImm(0));

View File

@ -23,9 +23,8 @@ namespace llvm {
class MCOperand; class MCOperand;
class HexagonMCInst : public MCInst { class HexagonMCInst : public MCInst {
friend void ::LLVMInitializeHexagonTargetMC();
// Used to access TSFlags // Used to access TSFlags
static std::unique_ptr <MCInstrInfo const> MCII; std::unique_ptr <MCInstrInfo const> MCII;
public: public:
explicit HexagonMCInst(); explicit HexagonMCInst();

View File

@ -36,7 +36,7 @@ using namespace llvm;
#define GET_REGINFO_MC_DESC #define GET_REGINFO_MC_DESC
#include "HexagonGenRegisterInfo.inc" #include "HexagonGenRegisterInfo.inc"
static MCInstrInfo *createHexagonMCInstrInfo() { MCInstrInfo *llvm::createHexagonMCInstrInfo() {
MCInstrInfo *X = new MCInstrInfo(); MCInstrInfo *X = new MCInstrInfo();
InitHexagonMCInstrInfo(X); InitHexagonMCInstrInfo(X);
return X; return X;
@ -116,7 +116,6 @@ extern "C" void LLVMInitializeHexagonTargetMC() {
// Register the MC instruction info. // Register the MC instruction info.
TargetRegistry::RegisterMCInstrInfo(TheHexagonTarget, TargetRegistry::RegisterMCInstrInfo(TheHexagonTarget,
createHexagonMCInstrInfo); createHexagonMCInstrInfo);
HexagonMCInst::MCII.reset (createHexagonMCInstrInfo());
// Register the MC register info. // Register the MC register info.
TargetRegistry::RegisterMCRegInfo(TheHexagonTarget, TargetRegistry::RegisterMCRegInfo(TheHexagonTarget,

View File

@ -30,6 +30,8 @@ class raw_ostream;
extern Target TheHexagonTarget; extern Target TheHexagonTarget;
MCInstrInfo *createHexagonMCInstrInfo();
MCCodeEmitter *createHexagonMCCodeEmitter(MCInstrInfo const &MCII, MCCodeEmitter *createHexagonMCCodeEmitter(MCInstrInfo const &MCII,
MCRegisterInfo const &MRI, MCRegisterInfo const &MRI,
MCSubtargetInfo const &MST, MCSubtargetInfo const &MST,