summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2008-08-07 09:52:13 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2008-08-07 09:52:13 +0000
commite0157465b7b0cf9134bc47fb373a9a512d82d8b6 (patch)
tree943763b27edc263fef904ac00f0f9c8d81e2e2a4 /llvm/lib
parent8ab2f4953661328d5d9bccdafb0b3db3a256d7d8 (diff)
downloadbcm5719-llvm-e0157465b7b0cf9134bc47fb373a9a512d82d8b6.tar.gz
bcm5719-llvm-e0157465b7b0cf9134bc47fb373a9a512d82d8b6.zip
Cleanup
llvm-svn: 54452
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/IA64/IA64AsmPrinter.cpp34
1 files changed, 16 insertions, 18 deletions
diff --git a/llvm/lib/Target/IA64/IA64AsmPrinter.cpp b/llvm/lib/Target/IA64/IA64AsmPrinter.cpp
index 037687cbe96..0f65105f711 100644
--- a/llvm/lib/Target/IA64/IA64AsmPrinter.cpp
+++ b/llvm/lib/Target/IA64/IA64AsmPrinter.cpp
@@ -84,12 +84,12 @@ namespace {
// 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;
+// 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.
+// 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.
+// not, we print it as a constant pool index.
if(MI->getOperand(OpNo).isImmediate()) {
O << (int64_t)MI->getOperand(OpNo).getImm();
} else { // this is a constant pool reference: FIXME: assert this
@@ -120,9 +120,9 @@ namespace {
#include "IA64GenAsmWriter.inc"
+// Substitute old hook with new one temporary
std::string IA64AsmPrinter::getSectionForFunction(const Function &F) const {
- // This means "Allocated instruXions in mem, initialized".
- return "\n\t.section .text, \"ax\", \"progbits\"\n";
+ return TAI->SectionForGlobal(&F);
}
/// runOnMachineFunction - This uses the printMachineInstruction()
@@ -210,7 +210,7 @@ void IA64AsmPrinter::printOp(const MachineOperand &MO,
if (Needfptr)
O << "@fptr(";
O << Mang->getValueName(MO.getGlobal());
-
+
if (Needfptr && !isBRCALLinsn)
O << "#))"; // close both fptr( and ltoff(
else {
@@ -219,7 +219,7 @@ void IA64AsmPrinter::printOp(const MachineOperand &MO,
if (!isBRCALLinsn)
O << "#)"; // close only ltoff(
}
-
+
int Offset = MO.getOffset();
if (Offset > 0)
O << " + " << Offset;
@@ -258,7 +258,7 @@ bool IA64AsmPrinter::doInitialization(Module &M) {
bool IA64AsmPrinter::doFinalization(Module &M) {
const TargetData *TD = TM.getTargetData();
-
+
// Print out module-level global variables here.
for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
I != E; ++I)
@@ -266,7 +266,7 @@ bool IA64AsmPrinter::doFinalization(Module &M) {
// Check to see if this is a special global used by LLVM, if so, emit it.
if (EmitSpecialLLVMGlobal(I))
continue;
-
+
O << "\n\n";
std::string name = Mang->getValueName(I);
Constant *C = I->getInitializer();
@@ -318,9 +318,9 @@ bool IA64AsmPrinter::doFinalization(Module &M) {
cerr << "DLLExport linkage is not supported by this target!\n";
abort();
default:
- assert(0 && "Unknown linkage type!");
+ assert(0 && "Unknown linkage type!");
}
-
+
EmitAlignment(Align);
O << "\t.type " << name << ",@object\n";
O << "\t.size " << name << "," << Size << "\n";
@@ -328,15 +328,15 @@ bool IA64AsmPrinter::doFinalization(Module &M) {
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";
+
+ // 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(),
@@ -344,7 +344,7 @@ bool IA64AsmPrinter::doFinalization(Module &M) {
O << "\t.global " << *i << "\n\t.type " << *i << ", @object\n";
}
O << "\n\n";
-
+
return AsmPrinter::doFinalization(M);
}
@@ -356,5 +356,3 @@ FunctionPass *llvm::createIA64CodePrinterPass(std::ostream &o,
IA64TargetMachine &tm) {
return new IA64AsmPrinter(o, tm, tm.getTargetAsmInfo());
}
-
-
OpenPOWER on IntegriCloud