if ((I->hasInternalLinkage() || !MangledGlobals.count(I)) &&
!I->getIntrinsicID()) {
printFunctionSignature(I, true);
+ if (I->hasWeakLinkage()) Out << " __attribute__((weak))";
Out << ";\n";
}
}
if (!I->isExternal()) {
Out << "extern ";
printType(Out, I->getType()->getElementType(), Mang->getValueName(I));
-
+
+ if (I->hasLinkOnceLinkage())
+ Out << " __attribute__((common))";
+ else if (I->hasWeakLinkage())
+ Out << " __attribute__((weak))";
Out << ";\n";
}
}
FunctionInnards << ")";
// Print out the return type and the entire signature for that matter
printType(Out, F->getReturnType(), FunctionInnards.str());
-
- if (F->hasWeakLinkage()) Out << " __attribute((weak))";
}
void CWriter::printFunction(Function *F) {
if ((I->hasInternalLinkage() || !MangledGlobals.count(I)) &&
!I->getIntrinsicID()) {
printFunctionSignature(I, true);
+ if (I->hasWeakLinkage()) Out << " __attribute__((weak))";
Out << ";\n";
}
}
if (!I->isExternal()) {
Out << "extern ";
printType(Out, I->getType()->getElementType(), Mang->getValueName(I));
-
+
+ if (I->hasLinkOnceLinkage())
+ Out << " __attribute__((common))";
+ else if (I->hasWeakLinkage())
+ Out << " __attribute__((weak))";
Out << ";\n";
}
}
FunctionInnards << ")";
// Print out the return type and the entire signature for that matter
printType(Out, F->getReturnType(), FunctionInnards.str());
-
- if (F->hasWeakLinkage()) Out << " __attribute((weak))";
}
void CWriter::printFunction(Function *F) {