[llvm-commits] CVS: llvm/lib/Target/CBackend/Writer.cpp

John Criswell criswell at cs.uiuc.edu
Thu Feb 26 16:22:00 PST 2004


Changes in directory llvm/lib/Target/CBackend:

Writer.cpp updated: 1.164 -> 1.165

---
Log message:

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.



---
Diffs of the changes:  (+3 -3)

Index: llvm/lib/Target/CBackend/Writer.cpp
diff -u llvm/lib/Target/CBackend/Writer.cpp:1.164 llvm/lib/Target/CBackend/Writer.cpp:1.165
--- llvm/lib/Target/CBackend/Writer.cpp:1.164	Tue Feb 24 12:34:10 2004
+++ llvm/lib/Target/CBackend/Writer.cpp	Thu Feb 26 16:20:58 2004
@@ -690,6 +690,7 @@
       if (!I->getIntrinsicID()) {
         printFunctionSignature(I, true);
         if (I->hasWeakLinkage()) Out << " __ATTRIBUTE_WEAK__";
+        if (I->hasLinkOnceLinkage()) Out << " __ATTRIBUTE_WEAK__";
         Out << ";\n";
       }
     }
@@ -788,12 +789,12 @@
           
           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::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());





More information about the llvm-commits mailing list