[llvm-commits] CVS: llvm/lib/Analysis/IPA/Andersens.cpp CallGraph.cpp CallGraphSCCPass.cpp FindUnsafePointerTypes.cpp FindUsedTypes.cpp GlobalsModRef.cpp PrintSCC.cpp

Misha Brukman brukman at cs.uiuc.edu
Thu Apr 21 14:08:55 PDT 2005



Changes in directory llvm/lib/Analysis/IPA:

Andersens.cpp updated: 1.23 -> 1.24
CallGraph.cpp updated: 1.47 -> 1.48
CallGraphSCCPass.cpp updated: 1.9 -> 1.10
FindUnsafePointerTypes.cpp updated: 1.27 -> 1.28
FindUsedTypes.cpp updated: 1.31 -> 1.32
GlobalsModRef.cpp updated: 1.15 -> 1.16
PrintSCC.cpp updated: 1.13 -> 1.14
---
Log message:

Remove trailing whitespace


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

 Andersens.cpp              |   32 ++++++++++++++++----------------
 CallGraph.cpp              |   10 +++++-----
 CallGraphSCCPass.cpp       |    4 ++--
 FindUnsafePointerTypes.cpp |   14 +++++++-------
 FindUsedTypes.cpp          |   16 ++++++++--------
 GlobalsModRef.cpp          |   22 +++++++++++-----------
 PrintSCC.cpp               |    8 ++++----
 7 files changed, 53 insertions(+), 53 deletions(-)


Index: llvm/lib/Analysis/IPA/Andersens.cpp
diff -u llvm/lib/Analysis/IPA/Andersens.cpp:1.23 llvm/lib/Analysis/IPA/Andersens.cpp:1.24
--- llvm/lib/Analysis/IPA/Andersens.cpp:1.23	Mon Apr  4 20:12:03 2005
+++ llvm/lib/Analysis/IPA/Andersens.cpp	Thu Apr 21 16:08:44 2005
@@ -1,10 +1,10 @@
 //===- Andersens.cpp - Andersen's Interprocedural Alias Analysis ----------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This file defines a very simple implementation of Andersen's interprocedural
@@ -43,8 +43,8 @@
 //
 // Future Improvements:
 //   This implementation of Andersen's algorithm is extremely slow.  To make it
-//   scale reasonably well, the inclusion constraints could be sorted (easy), 
-//   offline variable substitution would be a huge win (straight-forward), and 
+//   scale reasonably well, the inclusion constraints could be sorted (easy),
+//   offline variable substitution would be a huge win (straight-forward), and
 //   online cycle elimination (trickier) might help as well.
 //
 //===----------------------------------------------------------------------===//
@@ -137,7 +137,7 @@
     std::map<Value*, unsigned> ValueNodes;
 
     /// ObjectNodes - This map contains entries for each memory object in the
-    /// program: globals, alloca's and mallocs.  
+    /// program: globals, alloca's and mallocs.
     std::map<Value*, unsigned> ObjectNodes;
 
     /// ReturnNodes - This map contains an entry for each function in the
@@ -161,7 +161,7 @@
       Constraint(ConstraintType Ty, Node *D, Node *S)
         : Type(Ty), Dest(D), Src(S) {}
     };
-    
+
     /// Constraints - This vector contains a list of all of the constraints
     /// identified by the program.
     std::vector<Constraint> Constraints;
@@ -193,7 +193,7 @@
       NullPtr      = 1,
       NullObject   = 2,
     };
-    
+
   public:
     bool runOnModule(Module &M) {
       InitializeAliasAnalysis(this);
@@ -209,7 +209,7 @@
       ReturnNodes.clear();
       VarargNodes.clear();
       EscapingInternalFunctions.clear();
-      std::vector<Constraint>().swap(Constraints);      
+      std::vector<Constraint>().swap(Constraints);
       return false;
     }
 
@@ -232,7 +232,7 @@
 
     //------------------------------------------------
     // Implement the AliasAnalysis API
-    //  
+    //
     AliasResult alias(const Value *V1, unsigned V1Size,
                       const Value *V2, unsigned V2Size);
     ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size);
@@ -265,7 +265,7 @@
       }
       return &GraphNodes[I->second];
     }
-    
+
     /// getObject - Return the node corresponding to the memory object for the
     /// specified global or allocation instruction.
     Node *getObject(Value *V) {
@@ -415,7 +415,7 @@
       }
     }
   }
-  
+
   AliasAnalysis::getMustAliases(P, RetVals);
 }
 
@@ -572,7 +572,7 @@
   if (C->getType()->isFirstClassType()) {
     if (isa<PointerType>(C->getType()))
       N->copyFrom(getNodeForConstantPointer(C));
-                                       
+
   } else if (C->isNullValue()) {
     N->addPointerTo(&GraphNodes[NullObject]);
     return;
@@ -607,7 +607,7 @@
       F->getName() == "atol" || F->getName() == "atoll" ||
       F->getName() == "remove" || F->getName() == "unlink" ||
       F->getName() == "rename" || F->getName() == "memcmp" ||
-      F->getName() == "llvm.memset" || 
+      F->getName() == "llvm.memset" ||
       F->getName() == "strcmp" || F->getName() == "strncmp" ||
       F->getName() == "execl" || F->getName() == "execlp" ||
       F->getName() == "execle" || F->getName() == "execv" ||
@@ -703,7 +703,7 @@
                                        &GraphNodes[UniversalSet]));
     }
   }
-  
+
   for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) {
     // Make the function address point to the function object.
     getNodeValue(*F)->addPointerTo(getObject(F)->setValue(F));
@@ -902,7 +902,7 @@
                                      &GraphNodes[UniversalSet],
                                      getReturnNode(F)));
   }
-  
+
   Function::arg_iterator AI = F->arg_begin(), AE = F->arg_end();
   CallSite::arg_iterator ArgI = CS.arg_begin(), ArgE = CS.arg_end();
   for (; AI != AE && ArgI != ArgE; ++AI, ++ArgI)
@@ -920,7 +920,7 @@
                                        &GraphNodes[UniversalSet],
                                        getNode(*ArgI)));
     }
-  
+
   // Copy all pointers passed through the varargs section to the varargs node.
   if (F->getFunctionType()->isVarArg())
     for (; ArgI != ArgE; ++ArgI)


Index: llvm/lib/Analysis/IPA/CallGraph.cpp
diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.47 llvm/lib/Analysis/IPA/CallGraph.cpp:1.48
--- llvm/lib/Analysis/IPA/CallGraph.cpp:1.47	Fri Nov 19 10:22:24 2004
+++ llvm/lib/Analysis/IPA/CallGraph.cpp	Thu Apr 21 16:08:44 2005
@@ -1,10 +1,10 @@
 //===- CallGraph.cpp - Build a Module's call graph ------------------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 //  This file implements the CallGraph class.
@@ -57,7 +57,7 @@
         Root = Node;          // Found a main, keep track of it!
     }
   }
-  
+
   // If this function is not defined in this translation unit, it could call
   // anything.
   if (F->isExternal() && !F->getIntrinsicID())
@@ -113,7 +113,7 @@
 
   // If we didn't find a main function, use the external call graph node
   if (Root == 0) Root = ExternalCallingNode;
-  
+
   return false;
 }
 
@@ -148,7 +148,7 @@
     OS << F->getName() << "\n";
   else
     OS << "<<null function: 0x" << getRoot() << ">>\n";
-  
+
   for (CallGraph::const_iterator I = begin(), E = end(); I != E; ++I)
     I->second->print(OS);
 }


Index: llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
diff -u llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.9 llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.10
--- llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp:1.9	Sun Sep 19 23:45:09 2004
+++ llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp	Thu Apr 21 16:08:44 2005
@@ -1,10 +1,10 @@
 //===- CallGraphSCCPass.cpp - Pass that operates BU on call graph ---------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This file implements the CallGraphSCCPass class, which is used for passes


Index: llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp
diff -u llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp:1.27 llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp:1.28
--- llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp:1.27	Sun Sep 19 23:45:09 2004
+++ llvm/lib/Analysis/IPA/FindUnsafePointerTypes.cpp	Thu Apr 21 16:08:44 2005
@@ -1,13 +1,13 @@
 //===- FindUnsafePointerTypes.cpp - Check pointer usage safety ------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
-// This file defines a pass that can be used to determine, interprocedurally, 
+// This file defines a pass that can be used to determine, interprocedurally,
 // which pointer types are accessed unsafely in a program.  If there is an
 // "unsafe" access to a specific pointer type, transformations that depend on
 // type safety cannot be permitted.
@@ -20,7 +20,7 @@
 //
 // Currently, the only allowed operations on pointer types are:
 //   alloca, malloc, free, getelementptr, load, and store
-// 
+//
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Analysis/FindUnsafePointerTypes.h"
@@ -37,7 +37,7 @@
 // Provide a command line option to turn on printing of which instructions cause
 // a type to become invalid
 //
-static cl::opt<bool> 
+static cl::opt<bool>
 PrintFailures("printunsafeptrinst", cl::Hidden,
               cl::desc("Print Unsafe Pointer Access Instructions"));
 
@@ -96,9 +96,9 @@
 
   o << "SafePointerAccess Analysis: Found these unsafe types:\n";
   unsigned Counter = 1;
-  for (std::set<PointerType*>::const_iterator I = getUnsafeTypes().begin(), 
+  for (std::set<PointerType*>::const_iterator I = getUnsafeTypes().begin(),
          E = getUnsafeTypes().end(); I != E; ++I, ++Counter) {
-    
+
     o << " #" << Counter << ". ";
     CW << **I << "\n";
   }


Index: llvm/lib/Analysis/IPA/FindUsedTypes.cpp
diff -u llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.31 llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.32
--- llvm/lib/Analysis/IPA/FindUsedTypes.cpp:1.31	Mon Mar 14 22:54:18 2005
+++ llvm/lib/Analysis/IPA/FindUsedTypes.cpp	Thu Apr 21 16:08:44 2005
@@ -1,10 +1,10 @@
 //===- FindUsedTypes.cpp - Find all Types used by a module ----------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This pass is used to seek out all of the types in use by the program.  Note
@@ -32,10 +32,10 @@
 // collection of used types.
 //
 void FindUsedTypes::IncorporateType(const Type *Ty) {
-  // If ty doesn't already exist in the used types map, add it now, otherwise 
+  // If ty doesn't already exist in the used types map, add it now, otherwise
   // return.
   if (!UsedTypes.insert(Ty).second) return;  // Already contain Ty.
-                             
+
   // Make sure to add any types this type references now.
   //
   for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end();
@@ -45,7 +45,7 @@
 
 void FindUsedTypes::IncorporateValue(const Value *V) {
   IncorporateType(V->getType());
-  
+
   // If this is a constant, it could be using other types...
   if (const Constant *C = dyn_cast<Constant>(V)) {
     if (!isa<GlobalValue>(C))
@@ -71,21 +71,21 @@
   for (Module::iterator MI = m.begin(), ME = m.end(); MI != ME; ++MI) {
     IncorporateType(MI->getType());
     const Function &F = *MI;
-  
+
     // Loop over all of the instructions in the function, adding their return
     // type as well as the types of their operands.
     //
     for (const_inst_iterator II = inst_begin(F), IE = inst_end(F);
          II != IE; ++II) {
       const Instruction &I = *II;
-    
+
       IncorporateType(I.getType());  // Incorporate the type of the instruction
       for (User::const_op_iterator OI = I.op_begin(), OE = I.op_end();
            OI != OE; ++OI)
         IncorporateValue(*OI);  // Insert inst operand types as well
     }
   }
- 
+
   return false;
 }
 


Index: llvm/lib/Analysis/IPA/GlobalsModRef.cpp
diff -u llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.15 llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.16
--- llvm/lib/Analysis/IPA/GlobalsModRef.cpp:1.15	Wed Mar 23 20:41:19 2005
+++ llvm/lib/Analysis/IPA/GlobalsModRef.cpp	Thu Apr 21 16:08:44 2005
@@ -1,10 +1,10 @@
 //===- GlobalsModRef.cpp - Simple Mod/Ref Analysis for Globals ------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This simple pass provides alias and mod/ref information for global values
@@ -58,7 +58,7 @@
         return I->second;
       return 0;
     }
-    
+
     /// FunctionEffect - Capture whether or not this function reads or writes to
     /// ANY memory.  If not, we can do a lot of aggressive analysis on it.
     unsigned FunctionEffect;
@@ -92,7 +92,7 @@
 
     //------------------------------------------------
     // Implement the AliasAnalysis API
-    //  
+    //
     AliasResult alias(const Value *V1, unsigned V1Size,
                       const Value *V2, unsigned V2Size);
     ModRefResult getModRefInfo(CallSite CS, Value *P, unsigned Size);
@@ -111,7 +111,7 @@
           return DoesNotAccessMemory;
 	else if ((FR->FunctionEffect & Mod) == 0)
 	  return OnlyReadsMemory;
-      return AliasAnalysis::getModRefBehavior(F, CS, Info);    
+      return AliasAnalysis::getModRefBehavior(F, CS, Info);
     }
 
     virtual void deleteValue(Value *V);
@@ -134,7 +134,7 @@
     bool AnalyzeUsesOfGlobal(Value *V, std::vector<Function*> &Readers,
                              std::vector<Function*> &Writers);
   };
-  
+
   RegisterOpt<GlobalsModRef> X("globalsmodref-aa",
                                "Simple mod/ref analysis for globals");
   RegisterAnalysisGroup<AliasAnalysis, GlobalsModRef> Y;
@@ -211,7 +211,7 @@
           return true;
       } else {
         return true;
-      }        
+      }
     } else if (GlobalValue *GV = dyn_cast<GlobalValue>(*UI)) {
       if (AnalyzeUsesOfGlobal(GV, Readers, Writers)) return true;
     } else {
@@ -223,7 +223,7 @@
 /// AnalyzeCallGraph - At this point, we know the functions where globals are
 /// immediately stored to and read from.  Propagate this information up the call
 /// graph to all callers and compute the mod/ref info for all memory for each
-/// function.  
+/// function.
 void GlobalsModRef::AnalyzeCallGraph(CallGraph &CG, Module &M) {
   // We do a bottom-up SCC traversal of the call graph.  In other words, we
   // visit all callees before callers (leaf-first).
@@ -298,13 +298,13 @@
       FunctionInfo.erase(SCC[i]->getFunction());
     return;
   }
-  
+
   // Otherwise, unless we already know that this function mod/refs memory, scan
   // the function bodies to see if there are any explicit loads or stores.
   if (FunctionEffect != ModRef) {
     for (unsigned i = 0, e = SCC.size(); i != e && FunctionEffect != ModRef;++i)
       for (inst_iterator II = inst_begin(SCC[i]->getFunction()),
-             E = inst_end(SCC[i]->getFunction()); 
+             E = inst_end(SCC[i]->getFunction());
            II != E && FunctionEffect != ModRef; ++II)
         if (isa<LoadInst>(*II))
           FunctionEffect |= Ref;
@@ -334,7 +334,7 @@
 
   // If we are at some type of object... return it.
   if (const GlobalValue *GV = dyn_cast<GlobalValue>(V)) return GV;
-  
+
   // Traverse through different addressing mechanisms...
   if (const Instruction *I = dyn_cast<Instruction>(V)) {
     if (isa<CastInst>(I) || isa<GetElementPtrInst>(I))


Index: llvm/lib/Analysis/IPA/PrintSCC.cpp
diff -u llvm/lib/Analysis/IPA/PrintSCC.cpp:1.13 llvm/lib/Analysis/IPA/PrintSCC.cpp:1.14
--- llvm/lib/Analysis/IPA/PrintSCC.cpp:1.13	Mon Dec  6 22:03:45 2004
+++ llvm/lib/Analysis/IPA/PrintSCC.cpp	Thu Apr 21 16:08:44 2005
@@ -1,10 +1,10 @@
 //===- PrintSCC.cpp - Enumerate SCCs in some key graphs -------------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This file provides passes to print out SCCs in a CFG or a CallGraph.
@@ -17,10 +17,10 @@
 //       analyze -cfgscc            to print the SCCs in each CFG of a module.
 //       analyze -cfgscc -stats     to print the #SCCs and the maximum SCC size.
 //       analyze -cfgscc -debug > /dev/null to watch the algorithm in action.
-// 
+//
 //     and similarly:
 //       analyze -callscc [-stats] [-debug] to print SCCs in the CallGraph
-// 
+//
 // (3) To test the scc_iterator.
 //
 //===----------------------------------------------------------------------===//






More information about the llvm-commits mailing list