bool runOnMachineFunction(MachineFunction &F);
bool doInitialization(Module &M);
bool doFinalization(Module &M);
- void SwitchSection(std::ostream &OS, const char *NewSection);
+ void switchSection(std::ostream &OS, const char *NewSection);
};
} // end of anonymous namespace
printConstantPool(MF.getConstantPool());
// Print out labels for the function.
- SwitchSection(O, "text");
+ switchSection(O, "text");
emitAlignment(4);
O << "\t.globl " << CurrentFnName << "\n";
O << "\t.ent " << CurrentFnName << "\n";
if (CP.empty()) return;
- SwitchSection(O, "rodata");
+ switchSection(O, "rodata");
for (unsigned i = 0, e = CP.size(); i != e; ++i) {
- // SwitchSection(O, "section .rodata, \"dr\"");
+ // switchSection(O, "section .rodata, \"dr\"");
emitAlignment(TD.getTypeAlignmentShift(CP[i]->getType()));
O << PrivateGlobalPrefix << "CPI" << CurrentFnName << "_" << i
<< ":\t\t\t\t\t" << CommentString << *CP[i] << "\n";
}
-// SwitchSection - Switch to the specified section of the executable if we are
+// switchSection - Switch to the specified section of the executable if we are
// not already in it!
//
-void AlphaAsmPrinter::SwitchSection(std::ostream &OS, const char *NewSection)
+void AlphaAsmPrinter::switchSection(std::ostream &OS, const char *NewSection)
{
if (CurSection != NewSection) {
CurSection = NewSection;
if (C->isNullValue() &&
(I->hasLinkOnceLinkage() || I->hasInternalLinkage() ||
I->hasWeakLinkage() /* FIXME: Verify correct */)) {
- SwitchSection(O, "data");
+ switchSection(O, "data");
if (I->hasInternalLinkage())
O << "\t.local " << name << "\n";
case GlobalValue::WeakLinkage: // FIXME: Verify correct for weak.
// Nonnull linkonce -> weak
O << "\t.weak " << name << "\n";
- SwitchSection(O, "");
+ switchSection(O, "");
O << "\t.section\t.llvm.linkonce.d." << name << ",\"aw\",@progbits\n";
break;
case GlobalValue::AppendingLinkage:
// FALL THROUGH
case GlobalValue::InternalLinkage:
if (C->isNullValue())
- SwitchSection(O, "bss");
+ switchSection(O, "bss");
else
- SwitchSection(O, "data");
+ switchSection(O, "data");
break;
case GlobalValue::GhostLinkage:
std::cerr << "GhostLinkage cannot appear in AlphaAsmPrinter!\n";
MI->getOperand(Op+3).isGlobalAddress());
}
-// SwitchSection - Switch to the specified section of the executable if we are
+// switchSection - Switch to the specified section of the executable if we are
// not already in it!
//
-static void SwitchSection(std::ostream &OS, std::string &CurSection,
+static void switchSection(std::ostream &OS, std::string &CurSection,
const char *NewSection) {
if (CurSection != NewSection) {
CurSection = NewSection;
if (C->isNullValue() &&
(I->hasLinkOnceLinkage() || I->hasInternalLinkage() ||
I->hasWeakLinkage() /* FIXME: Verify correct */)) {
- SwitchSection(O, CurSection, ".data");
+ switchSection(O, CurSection, ".data");
if (I->hasInternalLinkage()) {
O << "\t.lcomm " << name << "," << TD.getTypeSize(C->getType())
<< "," << (1 << Align);
case GlobalValue::WeakLinkage: // FIXME: Verify correct for weak.
// Nonnull linkonce -> weak
O << "\t.weak " << name << "\n";
- SwitchSection(O, CurSection, "");
+ switchSection(O, CurSection, "");
O << "\t.section\t.llvm.linkonce.d." << name
<< ", \"aw\", \"progbits\"\n";
break;
// FALL THROUGH
case GlobalValue::InternalLinkage:
if (C->isNullValue())
- SwitchSection(O, CurSection, ".bss");
+ switchSection(O, CurSection, ".bss");
else
- SwitchSection(O, CurSection, ".data");
+ switchSection(O, CurSection, ".data");
break;
case GlobalValue::GhostLinkage:
std::cerr << "GhostLinkage cannot appear in IA64AsmPrinter!\n";
if (C->isNullValue() &&
(I->hasLinkOnceLinkage() || I->hasInternalLinkage() ||
I->hasWeakLinkage() /* FIXME: Verify correct */)) {
- SwitchSection(O, CurSection, ".data");
+ switchSection(O, CurSection, ".data");
if (!forCygwin && !forDarwin && I->hasInternalLinkage())
O << "\t.local " << name << "\n";
if (forDarwin && I->hasInternalLinkage())
case GlobalValue::WeakLinkage: // FIXME: Verify correct for weak.
// Nonnull linkonce -> weak
O << "\t.weak " << name << "\n";
- SwitchSection(O, CurSection, "");
+ switchSection(O, CurSection, "");
O << "\t.section\t.llvm.linkonce.d." << name << ",\"aw\",@progbits\n";
break;
case GlobalValue::AppendingLinkage:
// FALL THROUGH
case GlobalValue::InternalLinkage:
if (C->isNullValue())
- SwitchSection(O, CurSection, ".bss");
+ switchSection(O, CurSection, ".bss");
else
- SwitchSection(O, CurSection, ".data");
+ switchSection(O, CurSection, ".data");
break;
}
MI->getOperand(Op+3).isGlobalAddress());
}
- // SwitchSection - Switch to the specified section of the executable if we are
+ // switchSection - Switch to the specified section of the executable if we are
// not already in it!
- inline static void SwitchSection(std::ostream &OS, std::string &CurSection,
+ inline static void switchSection(std::ostream &OS, std::string &CurSection,
const char *NewSection) {
if (CurSection != NewSection) {
CurSection = NewSection;