diff options
| author | John Criswell <criswell@uiuc.edu> | 2004-02-26 22:20:58 +0000 |
|---|---|---|
| committer | John Criswell <criswell@uiuc.edu> | 2004-02-26 22:20:58 +0000 |
| commit | feb7c49ce432f9a78c217648a4644ade20e57cad (patch) | |
| tree | bf6f1b6deb8e6f2e6b4836818e9736265f4f15ec /llvm/lib/Target/CBackend/Writer.cpp | |
| parent | 5ef1638da25ae168632ecaac0cef7f6b80167a01 (diff) | |
| download | bcm5719-llvm-feb7c49ce432f9a78c217648a4644ade20e57cad.tar.gz bcm5719-llvm-feb7c49ce432f9a78c217648a4644ade20e57cad.zip | |
Fixes for PR258 and PR259.
Functions with linkonce linkage are declared with weak linkage.
Global floating point constants used to represent unprintable values
(such as NaN and infinity) are declared static so that they don't interfere
with other CBE generated translation units.
llvm-svn: 11884
Diffstat (limited to 'llvm/lib/Target/CBackend/Writer.cpp')
| -rw-r--r-- | llvm/lib/Target/CBackend/Writer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/CBackend/Writer.cpp b/llvm/lib/Target/CBackend/Writer.cpp index 89819dace3b..396cc694da6 100644 --- a/llvm/lib/Target/CBackend/Writer.cpp +++ b/llvm/lib/Target/CBackend/Writer.cpp @@ -690,6 +690,7 @@ bool CWriter::doInitialization(Module &M) { if (!I->getIntrinsicID()) { printFunctionSignature(I, true); if (I->hasWeakLinkage()) Out << " __ATTRIBUTE_WEAK__"; + if (I->hasLinkOnceLinkage()) Out << " __ATTRIBUTE_WEAK__"; Out << ";\n"; } } @@ -788,12 +789,12 @@ void CWriter::printFloatingPointConstants(Module &M) { if (FPC->getType() == Type::DoubleTy) { DBLUnion.D = Val; - Out << "const ConstantDoubleTy FPConstant" << FPCounter++ + Out << "static const ConstantDoubleTy FPConstant" << FPCounter++ << " = 0x" << std::hex << DBLUnion.U << std::dec << "ULL; /* " << Val << " */\n"; } else if (FPC->getType() == Type::FloatTy) { FLTUnion.F = Val; - Out << "const ConstantFloatTy FPConstant" << FPCounter++ + Out << "static const ConstantFloatTy FPConstant" << FPCounter++ << " = 0x" << std::hex << FLTUnion.U << std::dec << "U; /* " << Val << " */\n"; } else @@ -890,7 +891,6 @@ void CWriter::printContainedStructs(const Type *Ty, void CWriter::printFunctionSignature(const Function *F, bool Prototype) { if (F->hasInternalLinkage()) Out << "static "; - if (F->hasLinkOnceLinkage()) Out << "inline "; // Loop over the arguments, printing them... const FunctionType *FT = cast<FunctionType>(F->getFunctionType()); |

