[Hexagon] Factoring bundle creation in to a utility function.
[oota-llvm.git] / lib / Target / Hexagon / MCTargetDesc / HexagonAsmBackend.cpp
index dae0654ef4805fe52b59b48b36ecb3d8cd16a6a5..b97d616eb49a449c49fe789360f1347bd7c26dbb 100644 (file)
@@ -281,8 +281,7 @@ public:
     assert(HexagonMCInstrInfo::isBundle(Inst) &&
            "Hexagon relaxInstruction only works on bundles");
 
-    Res.setOpcode(Hexagon::BUNDLE);
-    Res.addOperand(MCOperand::createImm(0));
+    Res = HexagonMCInstrInfo::createBundle();
     // Copy the results into the bundle.
     bool Update = false;
     for (auto &I : HexagonMCInstrInfo::bundleInstructions(Inst)) {