mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-28 06:24:57 +00:00
Fix bugs with attribute weak emission
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9678 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -653,6 +653,7 @@ void CWriter::printModule(Module *M) {
|
|||||||
if ((I->hasInternalLinkage() || !MangledGlobals.count(I)) &&
|
if ((I->hasInternalLinkage() || !MangledGlobals.count(I)) &&
|
||||||
!I->getIntrinsicID()) {
|
!I->getIntrinsicID()) {
|
||||||
printFunctionSignature(I, true);
|
printFunctionSignature(I, true);
|
||||||
|
if (I->hasWeakLinkage()) Out << " __attribute__((weak))";
|
||||||
Out << ";\n";
|
Out << ";\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -672,6 +673,10 @@ void CWriter::printModule(Module *M) {
|
|||||||
Out << "extern ";
|
Out << "extern ";
|
||||||
printType(Out, I->getType()->getElementType(), Mang->getValueName(I));
|
printType(Out, I->getType()->getElementType(), Mang->getValueName(I));
|
||||||
|
|
||||||
|
if (I->hasLinkOnceLinkage())
|
||||||
|
Out << " __attribute__((common))";
|
||||||
|
else if (I->hasWeakLinkage())
|
||||||
|
Out << " __attribute__((weak))";
|
||||||
Out << ";\n";
|
Out << ";\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -903,8 +908,6 @@ void CWriter::printFunctionSignature(const Function *F, bool Prototype) {
|
|||||||
FunctionInnards << ")";
|
FunctionInnards << ")";
|
||||||
// Print out the return type and the entire signature for that matter
|
// Print out the return type and the entire signature for that matter
|
||||||
printType(Out, F->getReturnType(), FunctionInnards.str());
|
printType(Out, F->getReturnType(), FunctionInnards.str());
|
||||||
|
|
||||||
if (F->hasWeakLinkage()) Out << " __attribute((weak))";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWriter::printFunction(Function *F) {
|
void CWriter::printFunction(Function *F) {
|
||||||
|
@ -653,6 +653,7 @@ void CWriter::printModule(Module *M) {
|
|||||||
if ((I->hasInternalLinkage() || !MangledGlobals.count(I)) &&
|
if ((I->hasInternalLinkage() || !MangledGlobals.count(I)) &&
|
||||||
!I->getIntrinsicID()) {
|
!I->getIntrinsicID()) {
|
||||||
printFunctionSignature(I, true);
|
printFunctionSignature(I, true);
|
||||||
|
if (I->hasWeakLinkage()) Out << " __attribute__((weak))";
|
||||||
Out << ";\n";
|
Out << ";\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -672,6 +673,10 @@ void CWriter::printModule(Module *M) {
|
|||||||
Out << "extern ";
|
Out << "extern ";
|
||||||
printType(Out, I->getType()->getElementType(), Mang->getValueName(I));
|
printType(Out, I->getType()->getElementType(), Mang->getValueName(I));
|
||||||
|
|
||||||
|
if (I->hasLinkOnceLinkage())
|
||||||
|
Out << " __attribute__((common))";
|
||||||
|
else if (I->hasWeakLinkage())
|
||||||
|
Out << " __attribute__((weak))";
|
||||||
Out << ";\n";
|
Out << ";\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -903,8 +908,6 @@ void CWriter::printFunctionSignature(const Function *F, bool Prototype) {
|
|||||||
FunctionInnards << ")";
|
FunctionInnards << ")";
|
||||||
// Print out the return type and the entire signature for that matter
|
// Print out the return type and the entire signature for that matter
|
||||||
printType(Out, F->getReturnType(), FunctionInnards.str());
|
printType(Out, F->getReturnType(), FunctionInnards.str());
|
||||||
|
|
||||||
if (F->hasWeakLinkage()) Out << " __attribute((weak))";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWriter::printFunction(Function *F) {
|
void CWriter::printFunction(Function *F) {
|
||||||
|
Reference in New Issue
Block a user