diff options
author | Dale Johannesen <dalej@apple.com> | 2007-11-05 21:20:28 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2007-11-05 21:20:28 +0000 |
commit | eb57ea7ea2378b77bc995371c1888193b960cd03 (patch) | |
tree | b09932726b145c3501614679561c699708a4dc48 /lib/CodeGen/AsmPrinter.cpp | |
parent | 14ac17e2dfa9cf66dec0da3618badf87163c9bf9 (diff) |
Make labels work in asm blocks; allow labels as
parameters. Rename ValueRefList to ParamList
in AsmParser, since its only use is for parameters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43734 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index e7c7448f9b..3500d1245a 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -1188,13 +1188,18 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const { unsigned OpFlags = MI->getOperand(OpNo).getImmedValue(); ++OpNo; // Skip over the ID number. - AsmPrinter *AP = const_cast<AsmPrinter*>(this); - if ((OpFlags & 7) == 4 /*ADDR MODE*/) { - Error = AP->PrintAsmMemoryOperand(MI, OpNo, AsmPrinterVariant, - Modifier[0] ? Modifier : 0); - } else { - Error = AP->PrintAsmOperand(MI, OpNo, AsmPrinterVariant, - Modifier[0] ? Modifier : 0); + if (Modifier[0]=='l') // labels are target independent + printBasicBlockLabel(MI->getOperand(OpNo).getMachineBasicBlock(), + false, false); + else { + AsmPrinter *AP = const_cast<AsmPrinter*>(this); + if ((OpFlags & 7) == 4 /*ADDR MODE*/) { + Error = AP->PrintAsmMemoryOperand(MI, OpNo, AsmPrinterVariant, + Modifier[0] ? Modifier : 0); + } else { + Error = AP->PrintAsmOperand(MI, OpNo, AsmPrinterVariant, + Modifier[0] ? Modifier : 0); + } } } if (Error) { |