Create a machine basic block in the constant pool and retrieve the symbol for an...
authorBill Wendling <isanbard@gmail.com>
Thu, 29 Sep 2011 23:50:42 +0000 (23:50 +0000)
committerBill Wendling <isanbard@gmail.com>
Thu, 29 Sep 2011 23:50:42 +0000 (23:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140824 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMAsmPrinter.cpp
lib/Target/ARM/ARMBaseInstrInfo.cpp

index fe8a65e700f4215eadb591e9a194bad2f2c29705..f5d5248d36a28078c6cb8760b1083b2f38b30cf5 100644 (file)
@@ -853,6 +853,9 @@ EmitMachineConstantPoolValue(MachineConstantPoolValue *MCPV) {
   } else if (ACPV->isGlobalValue()) {
     const GlobalValue *GV = ACPV->getGV();
     MCSym = GetARMGVSymbol(GV);
+  } else if (ACPV->isMachineBasicBlock()) {
+    const MachineBasicBlock *MBB = ACPV->getMBB();
+    MCSym = MBB->getSymbol();
   } else {
     assert(ACPV->isExtSymbol() && "unrecognized constant pool value");
     MCSym = GetExternalSymbolSymbol(ACPV->getSymbol());
index 30830974355c3c436ea9c6eeef0de0953aaaf459..ffa9958592008b3d919101c13c354f509b7a5e5e 100644 (file)
@@ -1065,6 +1065,10 @@ static unsigned duplicateCPV(MachineFunction &MF, unsigned &CPI) {
   else if (ACPV->isLSDA())
     NewCPV = new ARMConstantPoolValue(MF.getFunction(), PCLabelId,
                                       ARMCP::CPLSDA, 4);
+  else if (ACPV->isMachineBasicBlock())
+    NewCPV = new ARMConstantPoolValue(MF.getFunction()->getContext(),
+                                      ACPV->getMBB(), PCLabelId,
+                                      ARMCP::CPMachineBasicBlock, 4);
   else
     llvm_unreachable("Unexpected ARM constantpool value type!!");
   CPI = MCP->getConstantPoolIndex(NewCPV, MCPE.getAlignment());