Split SwitchSection into SwitchTo{Text|Data}Section methods.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28184 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2006-05-09 04:59:56 +00:00
parent f668ffc4c2
commit 4632d7a570
9 changed files with 131 additions and 86 deletions

View File

@@ -142,7 +142,8 @@ bool IA64AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
EmitConstantPool(MF.getConstantPool());
// Print out labels for the function.
SwitchSection("\n\t.section .text, \"ax\", \"progbits\"\n", MF.getFunction());
SwitchToTextSection("\n\t.section .text, \"ax\", \"progbits\"\n",
MF.getFunction());
// ^^ means "Allocated instruXions in mem, initialized"
EmitAlignment(5);
O << "\t.global\t" << CurrentFnName << "\n";
@@ -282,7 +283,7 @@ bool IA64AsmPrinter::doFinalization(Module &M) {
if (C->isNullValue() &&
(I->hasLinkOnceLinkage() || I->hasInternalLinkage() ||
I->hasWeakLinkage() /* FIXME: Verify correct */)) {
SwitchSection(".data", I);
SwitchToDataSection(".data", I);
if (I->hasInternalLinkage()) {
O << "\t.lcomm " << name << "#," << TD->getTypeSize(C->getType())
<< "," << (1 << Align);
@@ -302,7 +303,7 @@ bool IA64AsmPrinter::doFinalization(Module &M) {
O << "\t.weak " << name << "\n";
O << "\t.section\t.llvm.linkonce.d." << name
<< ", \"aw\", \"progbits\"\n";
SwitchSection("", I);
SwitchToDataSection("", I);
break;
case GlobalValue::AppendingLinkage:
// FIXME: appending linkage variables should go into a section of
@@ -312,7 +313,7 @@ bool IA64AsmPrinter::doFinalization(Module &M) {
O << "\t.global " << name << "\n";
// FALL THROUGH
case GlobalValue::InternalLinkage:
SwitchSection(C->isNullValue() ? ".bss" : ".data", I);
SwitchToDataSection(C->isNullValue() ? ".bss" : ".data", I);
break;
case GlobalValue::GhostLinkage:
std::cerr << "GhostLinkage cannot appear in IA64AsmPrinter!\n";