[llvm-commits] [llvm] r49496 - in /llvm/trunk/lib: Support/APFloat.cpp Support/APInt.cpp System/Unix/Signals.inc VMCore/LeakDetector.cpp

Dan Gohman gohman at apple.com
Thu Apr 10 14:11:47 PDT 2008


Author: djg
Date: Thu Apr 10 16:11:47 2008
New Revision: 49496

URL: http://llvm.org/viewvc/llvm-project?rev=49496&view=rev
Log:
Make several symbols static.

Modified:
    llvm/trunk/lib/Support/APFloat.cpp
    llvm/trunk/lib/Support/APInt.cpp
    llvm/trunk/lib/System/Unix/Signals.inc
    llvm/trunk/lib/VMCore/LeakDetector.cpp

Modified: llvm/trunk/lib/Support/APFloat.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APFloat.cpp?rev=49496&r1=49495&r2=49496&view=diff

==============================================================================
--- llvm/trunk/lib/Support/APFloat.cpp (original)
+++ llvm/trunk/lib/Support/APFloat.cpp Thu Apr 10 16:11:47 2008
@@ -78,20 +78,20 @@
 /* Put a bunch of private, handy routines in an anonymous namespace.  */
 namespace {
 
-  inline unsigned int
+  static inline unsigned int
   partCountForBits(unsigned int bits)
   {
     return ((bits) + integerPartWidth - 1) / integerPartWidth;
   }
 
   /* Returns 0U-9U.  Return values >= 10U are not digits.  */
-  inline unsigned int
+  static inline unsigned int
   decDigitValue(unsigned int c)
   {
     return c - '0';
   }
 
-  unsigned int
+  static unsigned int
   hexDigitValue(unsigned int c)
   {
     unsigned int r;
@@ -111,7 +111,7 @@
     return -1U;
   }
 
-  inline void
+  static inline void
   assertArithmeticOK(const llvm::fltSemantics &semantics) {
     assert(semantics.arithmeticOK
            && "Compile-time arithmetic does not support these semantics");
@@ -122,7 +122,7 @@
 
      If the exponent overflows, returns a large exponent with the
      appropriate sign.  */
-  int
+  static int
   readExponent(const char *p)
   {
     bool isNegative;
@@ -160,7 +160,7 @@
 
   /* This is ugly and needs cleaning up, but I don't immediately see
      how whilst remaining safe.  */
-  int
+  static int
   totalExponent(const char *p, int exponentAdjustment)
   {
     integerPart unsignedExponent;
@@ -206,7 +206,7 @@
     return exponent;
   }
 
-  const char *
+  static const char *
   skipLeadingZeroesAndAnyDot(const char *p, const char **dot)
   {
     *dot = 0;
@@ -242,7 +242,7 @@
     int normalizedExponent;
   };
 
-  void
+  static void
   interpretDecimal(const char *p, decimalInfo *D)
   {
     const char *dot;
@@ -291,7 +291,7 @@
   /* Return the trailing fraction of a hexadecimal number.
      DIGITVALUE is the first hex digit of the fraction, P points to
      the next digit.  */
-  lostFraction
+  static lostFraction
   trailingHexadecimalFraction(const char *p, unsigned int digitValue)
   {
     unsigned int hexDigit;
@@ -319,7 +319,7 @@
 
   /* Return the fraction lost were a bignum truncated losing the least
      significant BITS bits.  */
-  lostFraction
+  static lostFraction
   lostFractionThroughTruncation(const integerPart *parts,
                                 unsigned int partCount,
                                 unsigned int bits)
@@ -341,7 +341,7 @@
   }
 
   /* Shift DST right BITS bits noting lost fraction.  */
-  lostFraction
+  static lostFraction
   shiftRight(integerPart *dst, unsigned int parts, unsigned int bits)
   {
     lostFraction lost_fraction;
@@ -354,7 +354,7 @@
   }
 
   /* Combine the effect of two lost fractions.  */
-  lostFraction
+  static lostFraction
   combineLostFractions(lostFraction moreSignificant,
                        lostFraction lessSignificant)
   {
@@ -375,7 +375,7 @@
 
      See "How to Read Floating Point Numbers Accurately" by William D
      Clinger.  */
-  unsigned int
+  static unsigned int
   HUerrBound(bool inexactMultiply, unsigned int HUerr1, unsigned int HUerr2)
   {
     assert(HUerr1 < 2 || HUerr2 < 2 || (HUerr1 + HUerr2 < 8));
@@ -389,7 +389,7 @@
   /* The number of ulps from the boundary (zero, or half if ISNEAREST)
      when the least significant BITS are truncated.  BITS cannot be
      zero.  */
-  integerPart
+  static integerPart
   ulpsFromBoundary(const integerPart *parts, unsigned int bits, bool isNearest)
   {
     unsigned int count, partBits;
@@ -434,7 +434,7 @@
 
   /* Place pow(5, power) in DST, and return the number of parts used.
      DST must be at least one part larger than size of the answer.  */
-  unsigned int
+  static unsigned int
   powerOf5(integerPart *dst, unsigned int power)
   {
     static integerPart firstEightPowers[] = { 1, 5, 25, 125, 625, 3125,
@@ -505,7 +505,7 @@
   /* Write out an integerPart in hexadecimal, starting with the most
      significant nibble.  Write out exactly COUNT hexdigits, return
      COUNT.  */
-  unsigned int
+  static unsigned int
   partAsHex (char *dst, integerPart part, unsigned int count,
              const char *hexDigitChars)
   {
@@ -523,7 +523,7 @@
   }
 
   /* Write out an unsigned decimal integer.  */
-  char *
+  static char *
   writeUnsignedDecimal (char *dst, unsigned int n)
   {
     char buff[40], *p;
@@ -541,7 +541,7 @@
   }
 
   /* Write out a signed decimal integer.  */
-  char *
+  static char *
   writeSignedDecimal (char *dst, int value)
   {
     if (value < 0) {

Modified: llvm/trunk/lib/Support/APInt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=49496&r1=49495&r2=49496&view=diff

==============================================================================
--- llvm/trunk/lib/Support/APInt.cpp (original)
+++ llvm/trunk/lib/Support/APInt.cpp Thu Apr 10 16:11:47 2008
@@ -2087,7 +2087,7 @@
 
   /* Returns the integer part with the least significant BITS set.
      BITS cannot be zero.  */
-  inline integerPart
+  static inline integerPart
   lowBitMask(unsigned int bits)
   {
     assert (bits != 0 && bits <= integerPartWidth);
@@ -2096,14 +2096,14 @@
   }
 
   /* Returns the value of the lower half of PART.  */
-  inline integerPart
+  static inline integerPart
   lowHalf(integerPart part)
   {
     return part & lowBitMask(integerPartWidth / 2);
   }
 
   /* Returns the value of the upper half of PART.  */
-  inline integerPart
+  static inline integerPart
   highHalf(integerPart part)
   {
     return part >> (integerPartWidth / 2);
@@ -2111,7 +2111,7 @@
 
   /* Returns the bit number of the most significant set bit of a part.
      If the input number has no bits set -1U is returned.  */
-  unsigned int
+  static unsigned int
   partMSB(integerPart value)
   {
     unsigned int n, msb;
@@ -2136,7 +2136,7 @@
 
   /* Returns the bit number of the least significant set bit of a
      part.  If the input number has no bits set -1U is returned.  */
-  unsigned int
+  static unsigned int
   partLSB(integerPart value)
   {
     unsigned int n, lsb;

Modified: llvm/trunk/lib/System/Unix/Signals.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Unix/Signals.inc?rev=49496&r1=49495&r2=49496&view=diff

==============================================================================
--- llvm/trunk/lib/System/Unix/Signals.inc (original)
+++ llvm/trunk/lib/System/Unix/Signals.inc Thu Apr 10 16:11:47 2008
@@ -29,32 +29,32 @@
 
 namespace {
 
-bool StackTraceRequested = false; 
+static bool StackTraceRequested = false; 
 
 /// InterruptFunction - The function to call if ctrl-c is pressed.
-void (*InterruptFunction)() = 0;
+static void (*InterruptFunction)() = 0;
 
-std::vector<sys::Path> *FilesToRemove = 0 ;
-std::vector<sys::Path> *DirectoriesToRemove = 0;
+static std::vector<sys::Path> *FilesToRemove = 0 ;
+static std::vector<sys::Path> *DirectoriesToRemove = 0;
 
 // IntSigs - Signals that may interrupt the program at any time.
-const int IntSigs[] = {
+static const int IntSigs[] = {
   SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGTERM, SIGUSR1, SIGUSR2
 };
-const int *IntSigsEnd = IntSigs + sizeof(IntSigs) / sizeof(IntSigs[0]);
+static const int *IntSigsEnd = IntSigs + sizeof(IntSigs) / sizeof(IntSigs[0]);
 
 // KillSigs - Signals that are synchronous with the program that will cause it
 // to die.
-const int KillSigs[] = {
+static const int KillSigs[] = {
   SIGILL, SIGTRAP, SIGABRT, SIGFPE, SIGBUS, SIGSEGV, SIGSYS, SIGXCPU, SIGXFSZ
 #ifdef SIGEMT
   , SIGEMT
 #endif
 };
-const int *KillSigsEnd = KillSigs + sizeof(KillSigs) / sizeof(KillSigs[0]);
+static const int *KillSigsEnd = KillSigs + sizeof(KillSigs) / sizeof(KillSigs[0]);
 
 #ifdef HAVE_BACKTRACE
-void* StackTrace[256];
+static void* StackTrace[256];
 #endif
 
 // PrintStackTrace - In the case of a program crash or fault, print out a stack
@@ -62,7 +62,7 @@
 //
 // On glibc systems we have the 'backtrace' function, which works nicely, but
 // doesn't demangle symbols.  
-void PrintStackTrace() {
+static void PrintStackTrace() {
 #ifdef HAVE_BACKTRACE
   // Use backtrace() to output a backtrace on Linux systems with glibc.
   int depth = backtrace(StackTrace, array_lengthof(StackTrace));
@@ -71,7 +71,7 @@
 }
 
 // SignalHandler - The signal handler that runs...
-RETSIGTYPE SignalHandler(int Sig) {
+static RETSIGTYPE SignalHandler(int Sig) {
   if (FilesToRemove != 0)
     while (!FilesToRemove->empty()) {
       FilesToRemove->back().eraseFromDisk(true);
@@ -103,7 +103,7 @@
 }
 
 // Just call signal
-void RegisterHandler(int Signal) { 
+static void RegisterHandler(int Signal) { 
   signal(Signal, SignalHandler); 
 }
 

Modified: llvm/trunk/lib/VMCore/LeakDetector.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/LeakDetector.cpp?rev=49496&r1=49495&r2=49496&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/LeakDetector.cpp (original)
+++ llvm/trunk/lib/VMCore/LeakDetector.cpp Thu Apr 10 16:11:47 2008
@@ -79,22 +79,22 @@
     const char* const Name;
   };
 
-  LeakDetectorImpl<void>  *Objects;
-  LeakDetectorImpl<Value> *LLVMObjects;
+  static LeakDetectorImpl<void>  *Objects;
+  static LeakDetectorImpl<Value> *LLVMObjects;
 
-  LeakDetectorImpl<void> &getObjects() {
+  static LeakDetectorImpl<void> &getObjects() {
     if (Objects == 0)
       Objects = new LeakDetectorImpl<void>("GENERIC");
     return *Objects;
   }
 
-  LeakDetectorImpl<Value> &getLLVMObjects() {
+  static LeakDetectorImpl<Value> &getLLVMObjects() {
     if (LLVMObjects == 0)
       LLVMObjects = new LeakDetectorImpl<Value>("LLVM");
     return *LLVMObjects;
   }
 
-  void clearGarbage() {
+  static void clearGarbage() {
     delete Objects;
     delete LLVMObjects;
     Objects = 0;





More information about the llvm-commits mailing list