[llvm-commits] [llvm] r84579 - in /llvm/trunk/lib/Target/ARM/AsmPrinter: ARMAsmPrinter.cpp ARMMCInstLower.cpp ARMMCInstLower.h
Chris Lattner
sabre at nondot.org
Mon Oct 19 17:52:47 PDT 2009
Author: lattner
Date: Mon Oct 19 19:52:47 2009
New Revision: 84579
URL: http://llvm.org/viewvc/llvm-project?rev=84579&view=rev
Log:
get fancy: support basic block operands. Yay for jumps.
Modified:
llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.cpp
llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.h
Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=84579&r1=84578&r2=84579&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Mon Oct 19 19:52:47 2009
@@ -1311,7 +1311,7 @@
//===----------------------------------------------------------------------===//
void ARMAsmPrinter::printInstructionThroughMCStreamer(const MachineInstr *MI) {
- ARMMCInstLower MCInstLowering(OutContext, *Mang, getFunctionNumber(), *MAI);
+ ARMMCInstLower MCInstLowering(OutContext, *Mang, *this);
switch (MI->getOpcode()) {
default: break;
case TargetInstrInfo::DBG_LABEL:
Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.cpp?rev=84579&r1=84578&r2=84579&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.cpp Mon Oct 19 19:52:47 2009
@@ -14,7 +14,8 @@
#include "ARMMCInstLower.h"
//#include "llvm/CodeGen/MachineModuleInfoImpls.h"
-#include "llvm/CodeGen/MachineInstr.h"
+#include "llvm/CodeGen/AsmPrinter.h"
+#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
@@ -57,8 +58,8 @@
MCSymbol *ARMMCInstLower::
GetJumpTableSymbol(const MachineOperand &MO) const {
SmallString<256> Name;
- raw_svector_ostream(Name) << MAI.getPrivateGlobalPrefix() << "JTI"
- << CurFunctionNumber << '_' << MO.getIndex();
+ raw_svector_ostream(Name) << Printer.MAI->getPrivateGlobalPrefix() << "JTI"
+ << Printer.getFunctionNumber() << '_' << MO.getIndex();
#if 0
switch (MO.getTargetFlags()) {
@@ -73,8 +74,8 @@
MCSymbol *ARMMCInstLower::
GetConstantPoolIndexSymbol(const MachineOperand &MO) const {
SmallString<256> Name;
- raw_svector_ostream(Name) << MAI.getPrivateGlobalPrefix() << "CPI"
- << CurFunctionNumber << '_' << MO.getIndex();
+ raw_svector_ostream(Name) << Printer.MAI->getPrivateGlobalPrefix() << "CPI"
+ << Printer.getFunctionNumber() << '_' << MO.getIndex();
#if 0
switch (MO.getTargetFlags()) {
@@ -125,12 +126,10 @@
case MachineOperand::MO_Immediate:
MCOp = MCOperand::CreateImm(MO.getImm());
break;
-#if 0
case MachineOperand::MO_MachineBasicBlock:
MCOp = MCOperand::CreateExpr(MCSymbolRefExpr::Create(
- AsmPrinter.GetMBBSymbol(MO.getMBB()->getNumber()), Ctx));
+ Printer.GetMBBSymbol(MO.getMBB()->getNumber()), Ctx));
break;
-#endif
case MachineOperand::MO_GlobalAddress:
MCOp = LowerSymbolOperand(MO, GetGlobalAddressSymbol(MO));
break;
Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.h?rev=84579&r1=84578&r2=84579&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.h (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMMCInstLower.h Mon Oct 19 19:52:47 2009
@@ -13,6 +13,7 @@
#include "llvm/Support/Compiler.h"
namespace llvm {
+ class AsmPrinter;
class MCAsmInfo;
class MCContext;
class MCInst;
@@ -28,15 +29,12 @@
class VISIBILITY_HIDDEN ARMMCInstLower {
MCContext &Ctx;
Mangler &Mang;
-
- const unsigned CurFunctionNumber;
- const MCAsmInfo &MAI;
+ AsmPrinter &Printer;
//const ARMSubtarget &getSubtarget() const;
public:
- ARMMCInstLower(MCContext &ctx, Mangler &mang, unsigned FuncNum,
- const MCAsmInfo &mai)
- : Ctx(ctx), Mang(mang), CurFunctionNumber(FuncNum), MAI(mai) {}
+ ARMMCInstLower(MCContext &ctx, Mangler &mang, AsmPrinter &printer)
+ : Ctx(ctx), Mang(mang), Printer(printer) {}
void Lower(const MachineInstr *MI, MCInst &OutMI) const;
More information about the llvm-commits
mailing list