This code doesn't modify the LLVM structure, keep stuff const
authorChris Lattner <sabre@nondot.org>
Sat, 26 Jul 2003 23:04:00 +0000 (23:04 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 26 Jul 2003 23:04:00 +0000 (23:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7343 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SparcV9/SparcV9CodeEmitter.cpp
lib/Target/SparcV9/SparcV9CodeEmitter.h
lib/Target/SparcV9/SparcV9PrologEpilogInserter.cpp

index d7ca70c2effbbbb60d2fadc97d6ac12c78e87103..c82d33d3851008564972db0afe67aafe908b3cc2 100644 (file)
@@ -571,7 +571,7 @@ int64_t SparcV9CodeEmitter::getMachineOpValue(MachineInstr &MI,
     // Duplicate code of the above case for VirtualRegister, BasicBlock... 
     // It should really hit this case, but Sparc backend uses VRegs instead
     DEBUG(std::cerr << "Saving reference to MBB\n");
-    BasicBlock *BB = MO.getMachineBasicBlock()->getBasicBlock();
+    const BasicBlock *BB = MO.getMachineBasicBlock()->getBasicBlock();
     unsigned* CurrPC = (unsigned*)(intptr_t)MCE.getCurrentPCValue();
     BBRefs.push_back(std::make_pair(BB, std::make_pair(CurrPC, &MI)));
   } else if (MO.isExternalSymbol()) {
index ebadc379d9fe2bccf4b2c57364adc05c10c2df1b..9e3b5bd5bf52b2d94a77e6199fdb585bf1633177 100644 (file)
@@ -18,13 +18,13 @@ class MachineOperand;
 class SparcV9CodeEmitter : public MachineFunctionPass {
   TargetMachine &TM;
   MachineCodeEmitter &MCE;
-  BasicBlock *currBB;
+  const BasicBlock *currBB;
 
   // Tracks which instruction references which BasicBlock
-  std::vector<std::pair<BasicBlock*,
+  std::vector<std::pair<const BasicBlock*,
                         std::pair<unsigned*,MachineInstr*> > > BBRefs;
   // Tracks where each BasicBlock starts
-  std::map<BasicBlock*, long> BBLocations;
+  std::map<const BasicBlock*, long> BBLocations;
 
   // Tracks locations of Constants which are laid out in memory (e.g. FP)
   // But we also need to map Constants to ConstantPool indices
index babb4709db025871230d29287af6319cc904a352..de04cb651759ffa22cdb4d048d4cf4e2a1997284 100644 (file)
@@ -133,8 +133,8 @@ void InsertPrologEpilogCode::InsertEpilogCode(MachineFunction &MF)
 
   for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E; ++I) {
     MachineBasicBlock &MBB = *I;
-    BasicBlock &BB = *I->getBasicBlock();
-    Instruction *TermInst = (Instruction*)BB.getTerminator();
+    const BasicBlock &BB = *I->getBasicBlock();
+    const Instruction *TermInst = (Instruction*)BB.getTerminator();
     if (TermInst->getOpcode() == Instruction::Ret)
     {
       int ZR = TM.getRegInfo().getZeroRegNum();