2005-03-17 18:17:03 +00:00
|
|
|
//===-- IA64AsmPrinter.cpp - Print out IA64 LLVM as assembly --------------===//
|
2005-04-21 23:13:11 +00:00
|
|
|
//
|
2005-03-17 18:17:03 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by Duraid Madina and is distributed under the
|
|
|
|
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
2005-04-21 23:13:11 +00:00
|
|
|
//
|
2005-03-17 18:17:03 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains a printer that converts from our internal representation
|
|
|
|
// of machine-dependent LLVM code to assembly accepted by the GNU binutils 'gas'
|
|
|
|
// assembler. The Intel 'ias' and HP-UX 'as' assemblers *may* choke on this
|
|
|
|
// output, but if so that's a bug I'd like to hear about: please file a bug
|
2005-10-28 17:46:35 +00:00
|
|
|
// report in bugzilla. FYI, the not too bad 'ias' assembler is bundled with
|
2005-03-17 18:17:03 +00:00
|
|
|
// the Intel C/C++ compiler for Itanium Linux.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2006-12-19 22:59:26 +00:00
|
|
|
#define DEBUG_TYPE "asm-printer"
|
2005-03-17 18:17:03 +00:00
|
|
|
#include "IA64.h"
|
|
|
|
#include "IA64TargetMachine.h"
|
|
|
|
#include "llvm/Module.h"
|
2005-03-24 05:12:48 +00:00
|
|
|
#include "llvm/Type.h"
|
2005-03-17 18:17:03 +00:00
|
|
|
#include "llvm/CodeGen/AsmPrinter.h"
|
|
|
|
#include "llvm/CodeGen/MachineFunctionPass.h"
|
2006-09-06 18:34:40 +00:00
|
|
|
#include "llvm/Target/TargetAsmInfo.h"
|
2006-09-07 22:06:40 +00:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2005-03-17 18:17:03 +00:00
|
|
|
#include "llvm/Support/Mangler.h"
|
|
|
|
#include "llvm/ADT/Statistic.h"
|
|
|
|
using namespace llvm;
|
|
|
|
|
2006-12-19 22:59:26 +00:00
|
|
|
STATISTIC(EmittedInsts, "Number of machine instrs printed");
|
|
|
|
|
2005-03-17 18:17:03 +00:00
|
|
|
namespace {
|
2006-09-06 18:34:40 +00:00
|
|
|
struct IA64AsmPrinter : public AsmPrinter {
|
|
|
|
std::set<std::string> ExternalFunctionNames, ExternalObjectNames;
|
|
|
|
|
2006-09-07 22:06:40 +00:00
|
|
|
IA64AsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
|
2006-09-06 18:34:40 +00:00
|
|
|
: AsmPrinter(O, TM, T) {
|
|
|
|
}
|
2005-03-17 18:17:03 +00:00
|
|
|
|
|
|
|
virtual const char *getPassName() const {
|
|
|
|
return "IA64 Assembly Printer";
|
|
|
|
}
|
|
|
|
|
|
|
|
/// printInstruction - This method is automatically generated by tablegen
|
|
|
|
/// from the instruction set description. This method returns true if the
|
|
|
|
/// machine instruction was sufficiently described to print it, otherwise it
|
|
|
|
/// returns false.
|
|
|
|
bool printInstruction(const MachineInstr *MI);
|
|
|
|
|
|
|
|
// This method is used by the tablegen'erated instruction printer.
|
2005-11-30 18:54:35 +00:00
|
|
|
void printOperand(const MachineInstr *MI, unsigned OpNo){
|
2005-03-17 18:17:03 +00:00
|
|
|
const MachineOperand &MO = MI->getOperand(OpNo);
|
2006-05-04 18:05:43 +00:00
|
|
|
if (MO.getType() == MachineOperand::MO_Register) {
|
2005-03-17 18:17:03 +00:00
|
|
|
assert(MRegisterInfo::isPhysicalRegister(MO.getReg())&&"Not physref??");
|
|
|
|
//XXX Bug Workaround: See note in Printer::doInitialization about %.
|
|
|
|
O << TM.getRegisterInfo()->get(MO.getReg()).Name;
|
|
|
|
} else {
|
|
|
|
printOp(MO);
|
|
|
|
}
|
|
|
|
}
|
2005-04-21 23:13:11 +00:00
|
|
|
|
2005-11-30 18:54:35 +00:00
|
|
|
void printS8ImmOperand(const MachineInstr *MI, unsigned OpNo) {
|
2005-04-07 12:34:36 +00:00
|
|
|
int val=(unsigned int)MI->getOperand(OpNo).getImmedValue();
|
|
|
|
if(val>=128) val=val-256; // if negative, flip sign
|
|
|
|
O << val;
|
|
|
|
}
|
2005-11-30 18:54:35 +00:00
|
|
|
void printS14ImmOperand(const MachineInstr *MI, unsigned OpNo) {
|
2005-04-07 12:34:36 +00:00
|
|
|
int val=(unsigned int)MI->getOperand(OpNo).getImmedValue();
|
|
|
|
if(val>=8192) val=val-16384; // if negative, flip sign
|
|
|
|
O << val;
|
|
|
|
}
|
2005-11-30 18:54:35 +00:00
|
|
|
void printS22ImmOperand(const MachineInstr *MI, unsigned OpNo) {
|
2005-04-11 05:55:56 +00:00
|
|
|
int val=(unsigned int)MI->getOperand(OpNo).getImmedValue();
|
|
|
|
if(val>=2097152) val=val-4194304; // if negative, flip sign
|
|
|
|
O << val;
|
2005-03-17 18:17:03 +00:00
|
|
|
}
|
2005-11-30 18:54:35 +00:00
|
|
|
void printU64ImmOperand(const MachineInstr *MI, unsigned OpNo) {
|
2005-03-17 18:17:03 +00:00
|
|
|
O << (uint64_t)MI->getOperand(OpNo).getImmedValue();
|
|
|
|
}
|
2005-11-30 18:54:35 +00:00
|
|
|
void printS64ImmOperand(const MachineInstr *MI, unsigned OpNo) {
|
2005-10-28 17:46:35 +00:00
|
|
|
// XXX : nasty hack to avoid GPREL22 "relocation truncated to fit" linker
|
|
|
|
// errors - instead of add rX = @gprel(CPI<whatever>), r1;; we now
|
|
|
|
// emit movl rX = @gprel(CPI<whatever);;
|
|
|
|
// add rX = rX, r1;
|
|
|
|
// this gives us 64 bits instead of 22 (for the add long imm) to play
|
|
|
|
// with, which shuts up the linker. The problem is that the constant
|
|
|
|
// pool entries aren't immediates at this stage, so we check here.
|
|
|
|
// If it's an immediate, print it the old fashioned way. If it's
|
|
|
|
// not, we print it as a constant pool index.
|
|
|
|
if(MI->getOperand(OpNo).isImmediate()) {
|
|
|
|
O << (int64_t)MI->getOperand(OpNo).getImmedValue();
|
|
|
|
} else { // this is a constant pool reference: FIXME: assert this
|
|
|
|
printOp(MI->getOperand(OpNo));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-11-30 18:54:35 +00:00
|
|
|
void printGlobalOperand(const MachineInstr *MI, unsigned OpNo) {
|
2005-10-28 17:46:35 +00:00
|
|
|
printOp(MI->getOperand(OpNo), false); // this is NOT a br.call instruction
|
2005-04-14 10:08:01 +00:00
|
|
|
}
|
2005-04-21 23:13:11 +00:00
|
|
|
|
2005-11-30 18:54:35 +00:00
|
|
|
void printCallOperand(const MachineInstr *MI, unsigned OpNo) {
|
2005-04-21 23:13:11 +00:00
|
|
|
printOp(MI->getOperand(OpNo), true); // this is a br.call instruction
|
2005-03-17 18:17:03 +00:00
|
|
|
}
|
|
|
|
|
2006-10-05 02:51:36 +00:00
|
|
|
std::string getSectionForFunction(const Function &F) const;
|
|
|
|
|
2005-03-17 18:17:03 +00:00
|
|
|
void printMachineInstruction(const MachineInstr *MI);
|
|
|
|
void printOp(const MachineOperand &MO, bool isBRCALLinsn= false);
|
2005-04-21 23:13:11 +00:00
|
|
|
bool runOnMachineFunction(MachineFunction &F);
|
2005-03-17 18:17:03 +00:00
|
|
|
bool doInitialization(Module &M);
|
2005-11-21 08:40:17 +00:00
|
|
|
bool doFinalization(Module &M);
|
2005-03-17 18:17:03 +00:00
|
|
|
};
|
|
|
|
} // end of anonymous namespace
|
|
|
|
|
|
|
|
|
|
|
|
// Include the auto-generated portion of the assembly writer.
|
|
|
|
#include "IA64GenAsmWriter.inc"
|
|
|
|
|
|
|
|
|
2006-10-05 02:51:36 +00:00
|
|
|
std::string IA64AsmPrinter::getSectionForFunction(const Function &F) const {
|
|
|
|
// This means "Allocated instruXions in mem, initialized".
|
|
|
|
return "\n\t.section .text, \"ax\", \"progbits\"\n";
|
|
|
|
}
|
|
|
|
|
2005-03-17 18:17:03 +00:00
|
|
|
/// runOnMachineFunction - This uses the printMachineInstruction()
|
|
|
|
/// method to print assembly for each instruction.
|
|
|
|
///
|
|
|
|
bool IA64AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
|
2005-11-21 07:51:23 +00:00
|
|
|
SetupMachineFunction(MF);
|
2005-03-17 18:17:03 +00:00
|
|
|
O << "\n\n";
|
|
|
|
|
|
|
|
// Print out constants referenced by the function
|
2005-11-21 08:38:26 +00:00
|
|
|
EmitConstantPool(MF.getConstantPool());
|
2005-03-17 18:17:03 +00:00
|
|
|
|
2006-10-05 02:51:36 +00:00
|
|
|
const Function *F = MF.getFunction();
|
|
|
|
SwitchToTextSection(getSectionForFunction(*F).c_str(), F);
|
|
|
|
|
2005-03-17 18:17:03 +00:00
|
|
|
// Print out labels for the function.
|
2005-11-21 07:51:23 +00:00
|
|
|
EmitAlignment(5);
|
2005-03-17 18:17:03 +00:00
|
|
|
O << "\t.global\t" << CurrentFnName << "\n";
|
|
|
|
O << "\t.type\t" << CurrentFnName << ", @function\n";
|
|
|
|
O << CurrentFnName << ":\n";
|
|
|
|
|
|
|
|
// Print out code for the function.
|
|
|
|
for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
|
|
|
|
I != E; ++I) {
|
|
|
|
// Print a label for the basic block if there are any predecessors.
|
2007-10-03 19:26:29 +00:00
|
|
|
if (!I->pred_empty()) {
|
2006-05-02 05:37:32 +00:00
|
|
|
printBasicBlockLabel(I, true);
|
|
|
|
O << '\n';
|
|
|
|
}
|
2005-03-17 18:17:03 +00:00
|
|
|
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
|
|
|
|
II != E; ++II) {
|
|
|
|
// Print the assembly for the instruction.
|
|
|
|
O << "\t";
|
|
|
|
printMachineInstruction(II);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// We didn't modify anything.
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void IA64AsmPrinter::printOp(const MachineOperand &MO,
|
2006-05-04 17:21:20 +00:00
|
|
|
bool isBRCALLinsn /* = false */) {
|
2005-03-17 18:17:03 +00:00
|
|
|
const MRegisterInfo &RI = *TM.getRegisterInfo();
|
|
|
|
switch (MO.getType()) {
|
2006-05-04 18:05:43 +00:00
|
|
|
case MachineOperand::MO_Register:
|
2005-03-17 18:17:03 +00:00
|
|
|
O << RI.get(MO.getReg()).Name;
|
|
|
|
return;
|
|
|
|
|
2006-05-04 17:21:20 +00:00
|
|
|
case MachineOperand::MO_Immediate:
|
|
|
|
O << MO.getImmedValue();
|
2005-03-17 18:17:03 +00:00
|
|
|
return;
|
2006-04-22 18:53:45 +00:00
|
|
|
case MachineOperand::MO_MachineBasicBlock:
|
|
|
|
printBasicBlockLabel(MO.getMachineBasicBlock());
|
2005-03-17 18:17:03 +00:00
|
|
|
return;
|
|
|
|
case MachineOperand::MO_ConstantPoolIndex: {
|
2006-09-06 18:34:40 +00:00
|
|
|
O << "@gprel(" << TAI->getPrivateGlobalPrefix()
|
2007-10-14 05:57:21 +00:00
|
|
|
<< "CPI" << getFunctionNumber() << "_"
|
|
|
|
<< MO.getConstantPoolIndex() << ")";
|
2005-03-17 18:17:03 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
case MachineOperand::MO_GlobalAddress: {
|
|
|
|
|
|
|
|
// functions need @ltoff(@fptr(fn_name)) form
|
|
|
|
GlobalValue *GV = MO.getGlobal();
|
|
|
|
Function *F = dyn_cast<Function>(GV);
|
|
|
|
|
|
|
|
bool Needfptr=false; // if we're computing an address @ltoff(X), do
|
|
|
|
// we need to decorate it so it becomes
|
2005-04-22 17:54:37 +00:00
|
|
|
// @ltoff(@fptr(X)) ?
|
2007-01-30 20:08:39 +00:00
|
|
|
if (F && !isBRCALLinsn /*&& F->isDeclaration()*/)
|
2005-03-17 18:17:03 +00:00
|
|
|
Needfptr=true;
|
2005-04-21 23:13:11 +00:00
|
|
|
|
2005-03-17 18:17:03 +00:00
|
|
|
// if this is the target of a call instruction, we should define
|
|
|
|
// the function somewhere (GNU gas has no problem without this, but
|
|
|
|
// Intel ias rightly complains of an 'undefined symbol')
|
2005-04-21 23:13:11 +00:00
|
|
|
|
2007-01-30 20:08:39 +00:00
|
|
|
if (F /*&& isBRCALLinsn*/ && F->isDeclaration())
|
2005-03-17 18:17:03 +00:00
|
|
|
ExternalFunctionNames.insert(Mang->getValueName(MO.getGlobal()));
|
2005-03-28 15:21:43 +00:00
|
|
|
else
|
2007-01-30 20:08:39 +00:00
|
|
|
if (GV->isDeclaration()) // e.g. stuff like 'stdin'
|
2005-04-22 17:54:37 +00:00
|
|
|
ExternalObjectNames.insert(Mang->getValueName(MO.getGlobal()));
|
2005-03-28 15:21:43 +00:00
|
|
|
|
2005-03-17 18:17:03 +00:00
|
|
|
if (!isBRCALLinsn)
|
|
|
|
O << "@ltoff(";
|
|
|
|
if (Needfptr)
|
|
|
|
O << "@fptr(";
|
|
|
|
O << Mang->getValueName(MO.getGlobal());
|
2006-02-16 13:12:57 +00:00
|
|
|
|
|
|
|
if (Needfptr && !isBRCALLinsn)
|
|
|
|
O << "#))"; // close both fptr( and ltoff(
|
|
|
|
else {
|
|
|
|
if (Needfptr)
|
|
|
|
O << "#)"; // close only fptr(
|
|
|
|
if (!isBRCALLinsn)
|
|
|
|
O << "#)"; // close only ltoff(
|
|
|
|
}
|
|
|
|
|
2005-03-17 18:17:03 +00:00
|
|
|
int Offset = MO.getOffset();
|
|
|
|
if (Offset > 0)
|
|
|
|
O << " + " << Offset;
|
|
|
|
else if (Offset < 0)
|
|
|
|
O << " - " << -Offset;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
case MachineOperand::MO_ExternalSymbol:
|
|
|
|
O << MO.getSymbolName();
|
2005-03-28 15:21:43 +00:00
|
|
|
ExternalFunctionNames.insert(MO.getSymbolName());
|
2005-03-17 18:17:03 +00:00
|
|
|
return;
|
|
|
|
default:
|
2005-04-21 23:13:11 +00:00
|
|
|
O << "<AsmPrinter: unknown operand type: " << MO.getType() << " >"; return;
|
2005-03-17 18:17:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// printMachineInstruction -- Print out a single IA64 LLVM instruction
|
|
|
|
/// MI to the current output stream.
|
|
|
|
///
|
|
|
|
void IA64AsmPrinter::printMachineInstruction(const MachineInstr *MI) {
|
|
|
|
++EmittedInsts;
|
2005-04-21 23:13:11 +00:00
|
|
|
|
2005-03-17 18:17:03 +00:00
|
|
|
// Call the autogenerated instruction printer routines.
|
|
|
|
printInstruction(MI);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IA64AsmPrinter::doInitialization(Module &M) {
|
2007-07-25 19:33:14 +00:00
|
|
|
bool Result = AsmPrinter::doInitialization(M);
|
2005-04-21 23:13:11 +00:00
|
|
|
|
2005-03-28 15:21:43 +00:00
|
|
|
O << "\n.ident \"LLVM-ia64\"\n\n"
|
2005-04-22 17:54:37 +00:00
|
|
|
<< "\t.psr lsb\n" // should be "msb" on HP-UX, for starters
|
2005-03-17 18:17:03 +00:00
|
|
|
<< "\t.radix C\n"
|
2005-04-22 17:54:37 +00:00
|
|
|
<< "\t.psr abi64\n"; // we only support 64 bits for now
|
2007-07-25 19:33:14 +00:00
|
|
|
return Result;
|
2005-03-17 18:17:03 +00:00
|
|
|
}
|
|
|
|
|
2005-11-21 08:40:17 +00:00
|
|
|
bool IA64AsmPrinter::doFinalization(Module &M) {
|
2006-05-03 01:29:57 +00:00
|
|
|
const TargetData *TD = TM.getTargetData();
|
2005-11-21 08:40:17 +00:00
|
|
|
|
|
|
|
// Print out module-level global variables here.
|
|
|
|
for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
|
|
|
|
I != E; ++I)
|
|
|
|
if (I->hasInitializer()) { // External global require no code
|
2006-03-09 06:14:35 +00:00
|
|
|
// Check to see if this is a special global used by LLVM, if so, emit it.
|
|
|
|
if (EmitSpecialLLVMGlobal(I))
|
|
|
|
continue;
|
|
|
|
|
2005-11-21 08:40:17 +00:00
|
|
|
O << "\n\n";
|
|
|
|
std::string name = Mang->getValueName(I);
|
|
|
|
Constant *C = I->getInitializer();
|
2006-05-03 01:29:57 +00:00
|
|
|
unsigned Size = TD->getTypeSize(C->getType());
|
2007-01-24 07:03:39 +00:00
|
|
|
unsigned Align = TD->getPreferredTypeAlignmentShift(C->getType());
|
2005-11-21 08:40:17 +00:00
|
|
|
|
|
|
|
if (C->isNullValue() &&
|
|
|
|
(I->hasLinkOnceLinkage() || I->hasInternalLinkage() ||
|
|
|
|
I->hasWeakLinkage() /* FIXME: Verify correct */)) {
|
2006-05-09 04:59:56 +00:00
|
|
|
SwitchToDataSection(".data", I);
|
2005-11-21 08:40:17 +00:00
|
|
|
if (I->hasInternalLinkage()) {
|
2006-05-03 01:29:57 +00:00
|
|
|
O << "\t.lcomm " << name << "#," << TD->getTypeSize(C->getType())
|
2005-11-21 08:40:17 +00:00
|
|
|
<< "," << (1 << Align);
|
2006-12-06 06:13:25 +00:00
|
|
|
O << "\n";
|
2005-11-21 08:40:17 +00:00
|
|
|
} else {
|
2006-05-03 01:29:57 +00:00
|
|
|
O << "\t.common " << name << "#," << TD->getTypeSize(C->getType())
|
2005-11-21 08:40:17 +00:00
|
|
|
<< "," << (1 << Align);
|
2006-12-06 06:13:25 +00:00
|
|
|
O << "\n";
|
2005-11-21 08:40:17 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
switch (I->getLinkage()) {
|
|
|
|
case GlobalValue::LinkOnceLinkage:
|
|
|
|
case GlobalValue::WeakLinkage: // FIXME: Verify correct for weak.
|
|
|
|
// Nonnull linkonce -> weak
|
|
|
|
O << "\t.weak " << name << "\n";
|
|
|
|
O << "\t.section\t.llvm.linkonce.d." << name
|
|
|
|
<< ", \"aw\", \"progbits\"\n";
|
2006-05-09 04:59:56 +00:00
|
|
|
SwitchToDataSection("", I);
|
2005-11-21 08:40:17 +00:00
|
|
|
break;
|
|
|
|
case GlobalValue::AppendingLinkage:
|
|
|
|
// FIXME: appending linkage variables should go into a section of
|
|
|
|
// their name or something. For now, just emit them as external.
|
|
|
|
case GlobalValue::ExternalLinkage:
|
|
|
|
// If external or appending, declare as a global symbol
|
|
|
|
O << "\t.global " << name << "\n";
|
|
|
|
// FALL THROUGH
|
|
|
|
case GlobalValue::InternalLinkage:
|
2006-05-09 04:59:56 +00:00
|
|
|
SwitchToDataSection(C->isNullValue() ? ".bss" : ".data", I);
|
2005-11-21 08:40:17 +00:00
|
|
|
break;
|
|
|
|
case GlobalValue::GhostLinkage:
|
2006-12-07 22:21:48 +00:00
|
|
|
cerr << "GhostLinkage cannot appear in IA64AsmPrinter!\n";
|
2005-11-21 08:40:17 +00:00
|
|
|
abort();
|
2006-09-14 18:23:27 +00:00
|
|
|
case GlobalValue::DLLImportLinkage:
|
2006-12-07 22:21:48 +00:00
|
|
|
cerr << "DLLImport linkage is not supported by this target!\n";
|
2006-09-14 18:23:27 +00:00
|
|
|
abort();
|
|
|
|
case GlobalValue::DLLExportLinkage:
|
2006-12-07 22:21:48 +00:00
|
|
|
cerr << "DLLExport linkage is not supported by this target!\n";
|
2006-09-14 18:23:27 +00:00
|
|
|
abort();
|
|
|
|
default:
|
|
|
|
assert(0 && "Unknown linkage type!");
|
2005-11-21 08:40:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
EmitAlignment(Align);
|
|
|
|
O << "\t.type " << name << ",@object\n";
|
|
|
|
O << "\t.size " << name << "," << Size << "\n";
|
2006-12-06 06:13:25 +00:00
|
|
|
O << name << ":\t\t\t\t// " << *C << "\n";
|
2005-11-21 08:40:17 +00:00
|
|
|
EmitGlobalConstant(C);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// we print out ".global X \n .type X, @function" for each external function
|
|
|
|
O << "\n\n// br.call targets referenced (and not defined) above: \n";
|
|
|
|
for (std::set<std::string>::iterator i = ExternalFunctionNames.begin(),
|
|
|
|
e = ExternalFunctionNames.end(); i!=e; ++i) {
|
|
|
|
O << "\t.global " << *i << "\n\t.type " << *i << ", @function\n";
|
|
|
|
}
|
|
|
|
O << "\n\n";
|
|
|
|
|
|
|
|
// we print out ".global X \n .type X, @object" for each external object
|
|
|
|
O << "\n\n// (external) symbols referenced (and not defined) above: \n";
|
|
|
|
for (std::set<std::string>::iterator i = ExternalObjectNames.begin(),
|
|
|
|
e = ExternalObjectNames.end(); i!=e; ++i) {
|
|
|
|
O << "\t.global " << *i << "\n\t.type " << *i << ", @object\n";
|
|
|
|
}
|
|
|
|
O << "\n\n";
|
|
|
|
|
2007-07-25 19:33:14 +00:00
|
|
|
return AsmPrinter::doFinalization(M);
|
2005-11-21 08:40:17 +00:00
|
|
|
}
|
|
|
|
|
2005-03-17 18:17:03 +00:00
|
|
|
/// createIA64CodePrinterPass - Returns a pass that prints the IA64
|
|
|
|
/// assembly code for a MachineFunction to the given output stream, using
|
|
|
|
/// the given target machine description.
|
|
|
|
///
|
2006-03-13 23:20:37 +00:00
|
|
|
FunctionPass *llvm::createIA64CodePrinterPass(std::ostream &o,
|
|
|
|
IA64TargetMachine &tm) {
|
2006-09-07 22:06:40 +00:00
|
|
|
return new IA64AsmPrinter(o, tm, tm.getTargetAsmInfo());
|
2005-03-17 18:17:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|