mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
add a new MachineBasicBlock::getSymbol method, replacing
the AsmPrinter::GetMBBSymbol. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94515 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -14,15 +14,18 @@
|
||||
#include "llvm/CodeGen/MachineBasicBlock.h"
|
||||
#include "llvm/BasicBlock.h"
|
||||
#include "llvm/CodeGen/MachineFunction.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCContext.h"
|
||||
#include "llvm/Target/TargetRegisterInfo.h"
|
||||
#include "llvm/Target/TargetData.h"
|
||||
#include "llvm/Target/TargetInstrDesc.h"
|
||||
#include "llvm/Target/TargetInstrInfo.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/Assembly/Writer.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/LeakDetector.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/Assembly/Writer.h"
|
||||
#include <algorithm>
|
||||
using namespace llvm;
|
||||
|
||||
@ -36,6 +39,18 @@ MachineBasicBlock::~MachineBasicBlock() {
|
||||
LeakDetector::removeGarbageObject(this);
|
||||
}
|
||||
|
||||
/// getSymbol - Return the MCSymbol for this basic block.
|
||||
///
|
||||
MCSymbol *MachineBasicBlock::getSymbol(MCContext &Ctx) const {
|
||||
SmallString<60> Name;
|
||||
const MachineFunction *MF = getParent();
|
||||
raw_svector_ostream(Name)
|
||||
<< MF->getTarget().getMCAsmInfo()->getPrivateGlobalPrefix() << "BB"
|
||||
<< MF->getFunctionNumber() << '_' << getNumber();
|
||||
return Ctx.GetOrCreateSymbol(Name.str());
|
||||
}
|
||||
|
||||
|
||||
raw_ostream &llvm::operator<<(raw_ostream &OS, const MachineBasicBlock &MBB) {
|
||||
MBB.print(OS);
|
||||
return OS;
|
||||
|
Reference in New Issue
Block a user