[llvm-commits] CVS: llvm/lib/CWriter/Writer.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Oct 16 13:31:58 PDT 2003
Changes in directory llvm/lib/CWriter:
Writer.cpp updated: 1.133 -> 1.134
---
Log message:
Add support for 'weak' linkage.
---
Diffs of the changes: (+4 -0)
Index: llvm/lib/CWriter/Writer.cpp
diff -u llvm/lib/CWriter/Writer.cpp:1.133 llvm/lib/CWriter/Writer.cpp:1.134
--- llvm/lib/CWriter/Writer.cpp:1.133 Wed Oct 15 11:48:26 2003
+++ llvm/lib/CWriter/Writer.cpp Thu Oct 16 13:28:54 2003
@@ -684,6 +684,8 @@
printType(Out, I->getType()->getElementType(), Mang->getValueName(I));
if (I->hasLinkOnceLinkage())
Out << " __attribute__((common))";
+ else if (I->hasWeakLinkage())
+ Out << " __attribute__((weak))";
if (!I->getInitializer()->isNullValue()) {
Out << " = " ;
writeOperand(I->getInitializer());
@@ -893,6 +895,8 @@
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) {
More information about the llvm-commits
mailing list