[llvm] r229872 - [Hexagon] Removing static variable holding MCInstrInfo.
Colin LeMahieu
colinl at codeaurora.org
Thu Feb 19 09:38:39 PST 2015
Author: colinl
Date: Thu Feb 19 11:38:39 2015
New Revision: 229872
URL: http://llvm.org/viewvc/llvm-project?rev=229872&view=rev
Log:
[Hexagon] Removing static variable holding MCInstrInfo.
Modified:
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.cpp
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.h
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.h
Modified: llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.cpp?rev=229872&r1=229871&r2=229872&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.cpp Thu Feb 19 11:38:39 2015
@@ -17,10 +17,9 @@
using namespace llvm;
-std::unique_ptr <MCInstrInfo const> HexagonMCInst::MCII;
-
-HexagonMCInst::HexagonMCInst() : MCInst() {}
-HexagonMCInst::HexagonMCInst(MCInstrDesc const &mcid) : MCInst() {}
+HexagonMCInst::HexagonMCInst() : MCII (createHexagonMCInstrInfo ()) {}
+HexagonMCInst::HexagonMCInst(MCInstrDesc const &mcid) :
+ MCII (createHexagonMCInstrInfo ()){}
void HexagonMCInst::AppendImplicitOperands(MCInst &MCI) {
MCI.addOperand(MCOperand::CreateImm(0));
Modified: llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.h?rev=229872&r1=229871&r2=229872&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.h (original)
+++ llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.h Thu Feb 19 11:38:39 2015
@@ -23,9 +23,8 @@ namespace llvm {
class MCOperand;
class HexagonMCInst : public MCInst {
- friend void ::LLVMInitializeHexagonTargetMC();
// Used to access TSFlags
- static std::unique_ptr <MCInstrInfo const> MCII;
+ std::unique_ptr <MCInstrInfo const> MCII;
public:
explicit HexagonMCInst();
Modified: llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp?rev=229872&r1=229871&r2=229872&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp Thu Feb 19 11:38:39 2015
@@ -36,7 +36,7 @@ using namespace llvm;
#define GET_REGINFO_MC_DESC
#include "HexagonGenRegisterInfo.inc"
-static MCInstrInfo *createHexagonMCInstrInfo() {
+MCInstrInfo *llvm::createHexagonMCInstrInfo() {
MCInstrInfo *X = new MCInstrInfo();
InitHexagonMCInstrInfo(X);
return X;
@@ -116,7 +116,6 @@ extern "C" void LLVMInitializeHexagonTar
// Register the MC instruction info.
TargetRegistry::RegisterMCInstrInfo(TheHexagonTarget,
createHexagonMCInstrInfo);
- HexagonMCInst::MCII.reset (createHexagonMCInstrInfo());
// Register the MC register info.
TargetRegistry::RegisterMCRegInfo(TheHexagonTarget,
Modified: llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.h?rev=229872&r1=229871&r2=229872&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.h (original)
+++ llvm/trunk/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.h Thu Feb 19 11:38:39 2015
@@ -30,6 +30,8 @@ class raw_ostream;
extern Target TheHexagonTarget;
+MCInstrInfo *createHexagonMCInstrInfo();
+
MCCodeEmitter *createHexagonMCCodeEmitter(MCInstrInfo const &MCII,
MCRegisterInfo const &MRI,
MCSubtargetInfo const &MST,
More information about the llvm-commits
mailing list