[llvm-commits] [llvm] r78363 - in /llvm/trunk: include/llvm/PassManagers.h lib/Analysis/IPA/Andersens.cpp lib/Analysis/ValueTracking.cpp lib/CodeGen/VirtRegRewriter.cpp lib/ExecutionEngine/JIT/Intercept.cpp lib/System/Unix/Alarm.inc lib/Target/ARM/Thumb2ITBlockPass.cpp lib/Target/CellSPU/SPUISelLowering.cpp lib/Target/Sparc/SparcISelLowering.cpp lib/Transforms/IPO/StripSymbols.cpp lib/Transforms/Utils/PromoteMemoryToRegister.cpp lib/VMCore/PassManager.cpp

Dan Gohman gohman at apple.com
Thu Aug 6 18:32:21 PDT 2009


Author: djg
Date: Thu Aug  6 20:32:21 2009
New Revision: 78363

URL: http://llvm.org/viewvc/llvm-project?rev=78363&view=rev
Log:
Fix a bunch of namespace pollution.

Modified:
    llvm/trunk/include/llvm/PassManagers.h
    llvm/trunk/lib/Analysis/IPA/Andersens.cpp
    llvm/trunk/lib/Analysis/ValueTracking.cpp
    llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp
    llvm/trunk/lib/ExecutionEngine/JIT/Intercept.cpp
    llvm/trunk/lib/System/Unix/Alarm.inc
    llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp
    llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
    llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp
    llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp
    llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
    llvm/trunk/lib/VMCore/PassManager.cpp

Modified: llvm/trunk/include/llvm/PassManagers.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/PassManagers.h?rev=78363&r1=78362&r2=78363&view=diff

==============================================================================
--- llvm/trunk/include/llvm/PassManagers.h (original)
+++ llvm/trunk/include/llvm/PassManagers.h Thu Aug  6 20:32:21 2009
@@ -451,9 +451,9 @@
   }
 };
 
-}
-
 extern void StartPassTimer(llvm::Pass *);
 extern void StopPassTimer(llvm::Pass *);
 
+}
+
 #endif

Modified: llvm/trunk/lib/Analysis/IPA/Andersens.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/Andersens.cpp?rev=78363&r1=78362&r2=78363&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/IPA/Andersens.cpp (original)
+++ llvm/trunk/lib/Analysis/IPA/Andersens.cpp Thu Aug  6 20:32:21 2009
@@ -1396,7 +1396,7 @@
   return Result;
 }
 
-void dumpToDOUT(SparseBitVector<> *bitmap) {
+static void dumpToDOUT(SparseBitVector<> *bitmap) {
 #ifndef NDEBUG
   raw_os_ostream OS(*DOUT);
   dump(*bitmap, OS);

Modified: llvm/trunk/lib/Analysis/ValueTracking.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ValueTracking.cpp?rev=78363&r1=78362&r2=78363&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/ValueTracking.cpp (original)
+++ llvm/trunk/lib/Analysis/ValueTracking.cpp Thu Aug  6 20:32:21 2009
@@ -817,11 +817,11 @@
 // indices from Idxs that should be left out when inserting into the resulting
 // struct. To is the result struct built so far, new insertvalue instructions
 // build on that.
-Value *BuildSubAggregate(Value *From, Value* To, const Type *IndexedType,
-                                 SmallVector<unsigned, 10> &Idxs,
-                                 unsigned IdxSkip,
-                                 LLVMContext &Context,
-                                 Instruction *InsertBefore) {
+static Value *BuildSubAggregate(Value *From, Value* To, const Type *IndexedType,
+                                SmallVector<unsigned, 10> &Idxs,
+                                unsigned IdxSkip,
+                                LLVMContext &Context,
+                                Instruction *InsertBefore) {
   const llvm::StructType *STy = llvm::dyn_cast<llvm::StructType>(IndexedType);
   if (STy) {
     // Save the original To argument so we can modify it
@@ -877,9 +877,9 @@
 // insertvalue instruction somewhere).
 //
 // All inserted insertvalue instructions are inserted before InsertBefore
-Value *BuildSubAggregate(Value *From, const unsigned *idx_begin,
-                         const unsigned *idx_end, LLVMContext &Context,
-                         Instruction *InsertBefore) {
+static Value *BuildSubAggregate(Value *From, const unsigned *idx_begin,
+                                const unsigned *idx_end, LLVMContext &Context,
+                                Instruction *InsertBefore) {
   assert(InsertBefore && "Must have someplace to insert!");
   const Type *IndexedType = ExtractValueInst::getIndexedType(From->getType(),
                                                              idx_begin,

Modified: llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp?rev=78363&r1=78362&r2=78363&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp (original)
+++ llvm/trunk/lib/CodeGen/VirtRegRewriter.cpp Thu Aug  6 20:32:21 2009
@@ -48,13 +48,14 @@
                        clEnumValEnd),
             cl::init(local));
 
-cl::opt<bool>
+static cl::opt<bool>
 ScheduleSpills("schedule-spills",
                cl::desc("Schedule spill code"),
                cl::init(false));
 
 VirtRegRewriter::~VirtRegRewriter() {}
 
+namespace {
 
 /// This class is intended for use with the new spilling framework only. It
 /// rewrites vreg def/uses to use the assigned preg, but does not insert any
@@ -101,8 +102,12 @@
 
 };
 
+}
+
 // ************************************************************************ //
 
+namespace {
+
 /// AvailableSpills - As the local rewriter is scanning and rewriting an MBB
 /// from top down, keep track of which spill slots or remat are available in
 /// each register.
@@ -225,6 +230,8 @@
                                 std::vector<MachineOperand*> &KillOps);
 };
 
+}
+
 // ************************************************************************ //
 
 // Given a location where a reload of a spilled register or a remat of
@@ -296,7 +303,9 @@
 
   return NewInsertLoc;
 }
- 
+
+namespace {
+
 // ReusedOp - For each reused operand, we keep track of a bit of information,
 // in case we need to rollback upon processing a new operand.  See comments
 // below.
@@ -396,6 +405,7 @@
   }
 };
 
+}
 
 // ****************** //
 // Utility Functions  //
@@ -962,6 +972,8 @@
 // Local Spiller Implementation  //
 // ***************************** //
 
+namespace {
+
 class VISIBILITY_HIDDEN LocalRewriter : public VirtRegRewriter {
   MachineRegisterInfo *RegInfo;
   const TargetRegisterInfo *TRI;
@@ -2320,6 +2332,8 @@
 
 };
 
+}
+
 llvm::VirtRegRewriter* llvm::createVirtRegRewriter() {
   switch (RewriterOpt) {
   default: llvm_unreachable("Unreachable!");

Modified: llvm/trunk/lib/ExecutionEngine/JIT/Intercept.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/Intercept.cpp?rev=78363&r1=78362&r2=78363&view=diff

==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/Intercept.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/Intercept.cpp Thu Aug  6 20:32:21 2009
@@ -57,6 +57,7 @@
  * linking with libc_nonshared.a and -Wl,--export-dynamic doesn't make 'stat' 
  * available as an exported symbol, so we have to add it explicitly.
  */
+namespace {
 class StatSymbols {
 public:
   StatSymbols() {
@@ -73,6 +74,7 @@
     sys::DynamicLibrary::AddSymbol("mknod", (void*)(intptr_t)mknod);
   }
 };
+}
 static StatSymbols initStatSymbols;
 #endif // __linux__
 

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

==============================================================================
--- llvm/trunk/lib/System/Unix/Alarm.inc (original)
+++ llvm/trunk/lib/System/Unix/Alarm.inc Thu Aug  6 20:32:21 2009
@@ -67,6 +67,6 @@
   return 0;
 }
 
-void Sleep(unsigned n) {
+void sys::Sleep(unsigned n) {
   ::sleep(n);
 }

Modified: llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp?rev=78363&r1=78362&r2=78363&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp (original)
+++ llvm/trunk/lib/Target/ARM/Thumb2ITBlockPass.cpp Thu Aug  6 20:32:21 2009
@@ -40,8 +40,8 @@
   char Thumb2ITBlockPass::ID = 0;
 }
 
-ARMCC::CondCodes getPredicate(const MachineInstr *MI,
-                              const Thumb2InstrInfo *TII) {
+static ARMCC::CondCodes getPredicate(const MachineInstr *MI,
+                                     const Thumb2InstrInfo *TII) {
   unsigned Opc = MI->getOpcode();
   if (Opc == ARM::tBcc || Opc == ARM::t2Bcc)
     return ARMCC::AL;

Modified: llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp?rev=78363&r1=78362&r2=78363&view=diff

==============================================================================
--- llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/SPUISelLowering.cpp Thu Aug  6 20:32:21 2009
@@ -898,7 +898,7 @@
 }
 
 //! Generate the address of a constant pool entry.
-SDValue
+static SDValue
 LowerConstantPool(SDValue Op, SelectionDAG &DAG, const SPUSubtarget *ST) {
   MVT PtrVT = Op.getValueType();
   ConstantPoolSDNode *CP = cast<ConstantPoolSDNode>(Op);
@@ -1550,7 +1550,7 @@
 }
 
 //! Lower a BUILD_VECTOR instruction creatively:
-SDValue
+static SDValue
 LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) {
   MVT VT = Op.getValueType();
   MVT EltVT = VT.getVectorElementType();

Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=78363&r1=78362&r2=78363&view=diff

==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Thu Aug  6 20:32:21 2009
@@ -549,6 +549,8 @@
   }
 }
 
+namespace {
+
 class TargetLoweringObjectFileSparc : public TargetLoweringObjectFileELF {
 public:
   void getSectionFlagsAsString(SectionKind Kind,
@@ -571,6 +573,7 @@
   }
 };
 
+}
 
 SparcTargetLowering::SparcTargetLowering(TargetMachine &TM)
   : TargetLowering(TM, new TargetLoweringObjectFileSparc()) {

Modified: llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp?rev=78363&r1=78362&r2=78363&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp Thu Aug  6 20:32:21 2009
@@ -172,7 +172,7 @@
 }
 
 /// StripSymbolNames - Strip symbol names.
-bool StripSymbolNames(Module &M, bool PreserveDbgInfo) {
+static bool StripSymbolNames(Module &M, bool PreserveDbgInfo) {
 
   SmallPtrSet<const GlobalValue*, 8> llvmUsedValues;
   findUsedValues(M.getGlobalVariable("llvm.used"), llvmUsedValues);
@@ -201,7 +201,7 @@
 // StripDebugInfo - Strip debug info in the module if it exists.  
 // To do this, we remove llvm.dbg.func.start, llvm.dbg.stoppoint, and 
 // llvm.dbg.region.end calls, and any globals they point to if now dead.
-bool StripDebugInfo(Module &M) {
+static bool StripDebugInfo(Module &M) {
 
   SmallPtrSet<const GlobalValue*, 8> llvmUsedValues;
   findUsedValues(M.getGlobalVariable("llvm.used"), llvmUsedValues);

Modified: llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp?rev=78363&r1=78362&r2=78363&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/PromoteMemoryToRegister.cpp Thu Aug  6 20:32:21 2009
@@ -760,6 +760,7 @@
   }
 }
 
+namespace {
 
 /// StoreIndexSearchPredicate - This is a helper predicate used to search by the
 /// first element of a pair.
@@ -770,6 +771,8 @@
   }
 };
 
+}
+
 /// PromoteSingleBlockAlloca - Many allocas are only used within a single basic
 /// block.  If this is the case, avoid traversing the CFG and inserting a lot of
 /// potentially useless PHI nodes by just performing a single linear pass over

Modified: llvm/trunk/lib/VMCore/PassManager.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/PassManager.cpp?rev=78363&r1=78362&r2=78363&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/PassManager.cpp (original)
+++ llvm/trunk/lib/VMCore/PassManager.cpp Thu Aug  6 20:32:21 2009
@@ -1582,13 +1582,13 @@
 }
 
 /// If TimingInfo is enabled then start pass timer.
-void StartPassTimer(Pass *P) {
+void llvm::StartPassTimer(Pass *P) {
   if (TheTimeInfo) 
     TheTimeInfo->passStarted(P);
 }
 
 /// If TimingInfo is enabled then stop pass timer.
-void StopPassTimer(Pass *P) {
+void llvm::StopPassTimer(Pass *P) {
   if (TheTimeInfo) 
     TheTimeInfo->passEnded(P);
 }





More information about the llvm-commits mailing list