From 4e27343eec284d9028617171a82a5816420fe4c7 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Thu, 4 Dec 2014 00:06:57 +0000 Subject: Allow target to specify prefix for labels Use the MCAsmInfo instead of the DataLayout, and allow specifying a custom prefix for labels specifically. HSAIL requires that labels begin with @, but global symbols with &. llvm-svn: 223323 --- llvm/lib/CodeGen/MachineBasicBlock.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp') diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 3058b1a4b9b7..36ae30940fa8 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -54,9 +54,7 @@ MCSymbol *MachineBasicBlock::getSymbol() const { if (!CachedMCSymbol) { const MachineFunction *MF = getParent(); MCContext &Ctx = MF->getContext(); - const TargetMachine &TM = MF->getTarget(); - const char *Prefix = - TM.getSubtargetImpl()->getDataLayout()->getPrivateGlobalPrefix(); + const char *Prefix = Ctx.getAsmInfo()->getPrivateLabelPrefix(); CachedMCSymbol = Ctx.GetOrCreateSymbol(Twine(Prefix) + "BB" + Twine(MF->getFunctionNumber()) + "_" + Twine(getNumber())); -- cgit v1.2.3