1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

Fix bugs with attribute weak emission

llvm-svn: 9678
This commit is contained in:
Chris Lattner 2003-11-03 17:32:38 +00:00
parent dc9da3878f
commit 8e65bbe451

View File

@ -653,6 +653,7 @@ void CWriter::printModule(Module *M) {
if ((I->hasInternalLinkage() || !MangledGlobals.count(I)) &&
!I->getIntrinsicID()) {
printFunctionSignature(I, true);
if (I->hasWeakLinkage()) Out << " __attribute__((weak))";
Out << ";\n";
}
}
@ -671,7 +672,11 @@ void CWriter::printModule(Module *M) {
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";
}
}
@ -903,8 +908,6 @@ void CWriter::printFunctionSignature(const Function *F, bool Prototype) {
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) {