case StdCall:
// "Pure" variadic functions do not receive @0 suffix.
if (!FT->isVarArg() || (FT->getNumParams() == 0) ||
- (FT->getNumParams() == 1 && F->isStructReturn()))
+ (FT->getNumParams() == 1 && F->hasStructRetAttr()))
Name += '@' + utostr_32(Info->getBytesToPopOnReturn());
break;
case FastCall:
// "Pure" variadic functions do not receive @0 suffix.
if (!FT->isVarArg() || (FT->getNumParams() == 0) ||
- (FT->getNumParams() == 1 && F->isStructReturn()))
+ (FT->getNumParams() == 1 && F->hasStructRetAttr()))
Name += '@' + utostr_32(Info->getBytesToPopOnReturn());
if (Name[0] == '_') {
if (!I->isThreadLocal() &&
(I->hasInternalLinkage() || I->hasWeakLinkage() ||
- I->hasLinkOnceLinkage())) {
+ I->hasLinkOnceLinkage() || I->hasCommonLinkage())) {
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
if (!NoZerosInBSS && TAI->getBSSSection())
SwitchToDataSection(TAI->getBSSSection(), I);
O << TAI->getLCOMMDirective() << name << "," << Size;
if (Subtarget->isTargetDarwin())
O << "," << Align;
+ } else if (Subtarget->isTargetDarwin() && !I->hasCommonLinkage()) {
+ O << "\t.globl " << name << "\n"
+ << TAI->getWeakDefDirective() << name << "\n";
+ SwitchToDataSection("\t.section __DATA,__datacoal_nt,coalesced", I);
+ EmitAlignment(Align, I);
+ O << name << ":\t\t\t\t" << TAI->getCommentString() << " ";
+ PrintUnmangledNameSafely(I, O);
+ O << "\n";
+ EmitGlobalConstant(C);
+ continue;
} else {
O << TAI->getCOMMDirective() << name << "," << Size;
}
switch (I->getLinkage()) {
+ case GlobalValue::CommonLinkage:
case GlobalValue::LinkOnceLinkage:
case GlobalValue::WeakLinkage:
if (Subtarget->isTargetDarwin()) {
i != e; ++i, ++j) {
SwitchToDataSection("\t.section __IMPORT,__jump_table,symbol_stubs,"
"self_modifying_code+pure_instructions,5", 0);
- O << "L" << *i << "$stub:\n";
- O << "\t.indirect_symbol " << *i << "\n";
+ std::string p = *i;
+ printSuffixedName(p, "$stub");
+ O << ":\n";
+ O << "\t.indirect_symbol " << p << "\n";
O << "\thlt ; hlt ; hlt ; hlt ; hlt\n";
}
O << "\n";
- if (ExceptionHandling && TAI->doesSupportExceptionHandling() && MMI &&
- !Subtarget->is64Bit()) {
+ if (TAI->doesSupportExceptionHandling() && MMI && !Subtarget->is64Bit()) {
// Add the (possibly multiple) personalities to the set of global values.
+ // Only referenced functions get into the Personalities list.
const std::vector<Function *>& Personalities = MMI->getPersonalities();
for (std::vector<Function *>::const_iterator I = Personalities.begin(),
"\t.section __IMPORT,__pointers,non_lazy_symbol_pointers");
for (std::set<std::string>::iterator i = GVStubs.begin(), e = GVStubs.end();
i != e; ++i) {
- O << "L" << *i << "$non_lazy_ptr:\n";
- O << "\t.indirect_symbol " << *i << "\n";
+ std::string p = *i;
+ printSuffixedName(p, "$non_lazy_ptr");
+ O << ":\n";
+ O << "\t.indirect_symbol " << p << "\n";
O << "\t.long\t0\n";
}