[llvm-commits] [poolalloc] r165399 - in /poolalloc/trunk: include/assistDS/ include/dsa/ include/poolalloc/ include/rdsa/ lib/AssistDS/ lib/DSA/ lib/Macroscopic/ lib/PoolAllocate/ lib/rDSA/ tools/Pa/ tools/TypeChecker/

Micah Villmow villmow at gmail.com
Mon Oct 8 09:30:11 PDT 2012


Author: mvillmow
Date: Mon Oct  8 11:30:10 2012
New Revision: 165399

URL: http://llvm.org/viewvc/llvm-project?rev=165399&view=rev
Log:
Move TargetData to DataLayout.

Modified:
    poolalloc/trunk/include/assistDS/Devirt.h
    poolalloc/trunk/include/assistDS/Int2PtrCmp.h
    poolalloc/trunk/include/assistDS/MergeGEP.h
    poolalloc/trunk/include/assistDS/SimplifyGEP.h
    poolalloc/trunk/include/assistDS/TypeChecks.h
    poolalloc/trunk/include/assistDS/TypeChecksOpt.h
    poolalloc/trunk/include/dsa/DSGraph.h
    poolalloc/trunk/include/dsa/DataStructure.h
    poolalloc/trunk/include/dsa/TypeSafety.h
    poolalloc/trunk/include/poolalloc/Heuristic.h
    poolalloc/trunk/include/poolalloc/PoolAllocate.h
    poolalloc/trunk/include/rdsa/DSGraph.h
    poolalloc/trunk/include/rdsa/DSNode.h
    poolalloc/trunk/include/rdsa/DataStructure.h
    poolalloc/trunk/lib/AssistDS/Devirt.cpp
    poolalloc/trunk/lib/AssistDS/DynCount.cpp
    poolalloc/trunk/lib/AssistDS/Int2PtrCmp.cpp
    poolalloc/trunk/lib/AssistDS/SimplifyExtractValue.cpp
    poolalloc/trunk/lib/AssistDS/SimplifyGEP.cpp
    poolalloc/trunk/lib/AssistDS/SimplifyInsertValue.cpp
    poolalloc/trunk/lib/AssistDS/SimplifyLoad.cpp
    poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
    poolalloc/trunk/lib/DSA/Basic.cpp
    poolalloc/trunk/lib/DSA/DSGraph.cpp
    poolalloc/trunk/lib/DSA/DataStructure.cpp
    poolalloc/trunk/lib/DSA/DataStructureStats.cpp
    poolalloc/trunk/lib/DSA/Local.cpp
    poolalloc/trunk/lib/DSA/StdLibPass.cpp
    poolalloc/trunk/lib/DSA/TopDownClosure.cpp
    poolalloc/trunk/lib/DSA/TypeSafety.cpp
    poolalloc/trunk/lib/Macroscopic/StructureFieldVisitor.cpp
    poolalloc/trunk/lib/PoolAllocate/AllHeapNodesHeuristic.cpp
    poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp
    poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp
    poolalloc/trunk/lib/PoolAllocate/PASimple.cpp
    poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp
    poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
    poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp
    poolalloc/trunk/lib/rDSA/DataStructure.cpp
    poolalloc/trunk/lib/rDSA/Local.cpp
    poolalloc/trunk/lib/rDSA/StdLibPass.cpp
    poolalloc/trunk/lib/rDSA/Steensgaard.cpp
    poolalloc/trunk/lib/rDSA/TopDownClosure.cpp
    poolalloc/trunk/tools/Pa/pa.cpp
    poolalloc/trunk/tools/TypeChecker/tc.cpp

Modified: poolalloc/trunk/include/assistDS/Devirt.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/Devirt.h?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/Devirt.h (original)
+++ poolalloc/trunk/include/assistDS/Devirt.h Mon Oct  8 11:30:10 2012
@@ -22,7 +22,7 @@
 #include "llvm/Instructions.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Support/InstVisitor.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 
 using namespace llvm;
 
@@ -41,7 +41,7 @@
       dsa::CallTargetFinder<EQTDDataStructures> *CTF;
 
       // Access to the target data analysis pass
-      TargetData * TD;
+      DataLayout * TD;
 
       // Worklist of call sites to transform
       std::vector<Instruction *> Worklist;
@@ -63,7 +63,7 @@
 
       virtual void getAnalysisUsage(AnalysisUsage &AU) const {
         AU.addRequired<dsa::CallTargetFinder<EQTDDataStructures> >();
-        AU.addRequired<TargetData>();
+        AU.addRequired<DataLayout>();
       }
 
       // Visitor methods for analyzing instructions

Modified: poolalloc/trunk/include/assistDS/Int2PtrCmp.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/Int2PtrCmp.h?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/Int2PtrCmp.h (original)
+++ poolalloc/trunk/include/assistDS/Int2PtrCmp.h Mon Oct  8 11:30:10 2012
@@ -16,7 +16,7 @@
 #include "llvm/Instructions.h"
 #include "llvm/Module.h"
 #include "llvm/Pass.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 
 
 namespace llvm {
@@ -26,13 +26,13 @@
   //
   class Int2PtrCmp : public ModulePass {
   private:
-    TargetData * TD;
+    DataLayout * TD;
   public:
     static char ID;
     Int2PtrCmp() : ModulePass(ID) {}
     virtual bool runOnModule(Module& M);
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-      AU.addRequired<TargetData>();
+      AU.addRequired<DataLayout>();
     }
 
   };

Modified: poolalloc/trunk/include/assistDS/MergeGEP.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/MergeGEP.h?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/MergeGEP.h (original)
+++ poolalloc/trunk/include/assistDS/MergeGEP.h Mon Oct  8 11:30:10 2012
@@ -11,7 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Instructions.h"
 #include "llvm/Module.h"
 #include "llvm/Pass.h"

Modified: poolalloc/trunk/include/assistDS/SimplifyGEP.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/SimplifyGEP.h?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/SimplifyGEP.h (original)
+++ poolalloc/trunk/include/assistDS/SimplifyGEP.h Mon Oct  8 11:30:10 2012
@@ -11,7 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Instructions.h"
 #include "llvm/Module.h"
 #include "llvm/Pass.h"
@@ -22,13 +22,13 @@
   //
   class SimplifyGEP : public ModulePass {
   private:
-    TargetData * TD;
+    DataLayout * TD;
   public:
     static char ID;
     SimplifyGEP() : ModulePass(ID) {}
     virtual bool runOnModule(Module& M);
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-      AU.addRequired<TargetData>();
+      AU.addRequired<DataLayout>();
     }
   };
 }

Modified: poolalloc/trunk/include/assistDS/TypeChecks.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/TypeChecks.h?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/TypeChecks.h (original)
+++ poolalloc/trunk/include/assistDS/TypeChecks.h Mon Oct  8 11:30:10 2012
@@ -19,7 +19,7 @@
 #include "llvm/Instructions.h"
 #include "llvm/Function.h"
 #include "llvm/Pass.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Support/CallSite.h"
 #include "llvm/Analysis/Dominators.h"
 #include "llvm/Analysis/LoopInfo.h"
@@ -49,7 +49,7 @@
   std::map<BitCastInst*, Instruction*> BitCast_MD_Map;
 
   // Analysis from other passes.
-  TargetData *TD;
+  DataLayout *TD;
   AddressTakenAnalysis* addrAnalysis;
   
   unsigned int getTypeMarker(Type*);
@@ -100,7 +100,7 @@
   virtual void print(raw_ostream &OS, const Module *M) const;
 
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-    AU.addRequired<TargetData>();
+    AU.addRequired<DataLayout>();
     AU.addRequired<DominatorTree>();
     AU.addRequired<LoopInfo>();
     AU.addRequired<AddressTakenAnalysis>();

Modified: poolalloc/trunk/include/assistDS/TypeChecksOpt.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/TypeChecksOpt.h?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/TypeChecksOpt.h (original)
+++ poolalloc/trunk/include/assistDS/TypeChecksOpt.h Mon Oct  8 11:30:10 2012
@@ -18,7 +18,7 @@
 
 #include "llvm/Instructions.h"
 #include "llvm/Pass.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Support/CallSite.h"
 
 #include <list>

Modified: poolalloc/trunk/include/dsa/DSGraph.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DSGraph.h?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/include/dsa/DSGraph.h (original)
+++ poolalloc/trunk/include/dsa/DSGraph.h Mon Oct  8 11:30:10 2012
@@ -26,7 +26,7 @@
 
 namespace llvm {
 
-class TargetData;
+class DataLayout;
 class GlobalValue;
 
 //===----------------------------------------------------------------------===//
@@ -249,7 +249,7 @@
 
   /// TD - This is the target data object for the machine this graph is
   /// constructed for.
-  const TargetData &TD;
+  const DataLayout &TD;
 
   SuperSet<Type*>& TypeSS;
 
@@ -257,7 +257,7 @@
   DSGraph(const DSGraph&);         // DO NOT IMPLEMENT
 public:
   // Create a new, empty, DSGraph.
-  DSGraph(EquivalenceClasses<const GlobalValue*> &ECs, const TargetData &td,
+  DSGraph(EquivalenceClasses<const GlobalValue*> &ECs, const DataLayout &td,
           SuperSet<Type*>& tss,
           DSGraph *GG = 0) 
     :GlobalsGraph(GG), UseAuxCalls(false), 
@@ -290,9 +290,9 @@
     return TypeSS;
   }
 
-  /// getTargetData - Return the TargetData object for the current target.
+  /// getDataLayout - Return the DataLayout object for the current target.
   ///
-  const TargetData &getTargetData() const { return TD; }
+  const DataLayout &getDataLayout() const { return TD; }
 
   /// setUseAuxCalls - If you call this method, the auxillary call vector will
   /// be used instead of the standard call vector to the dot file.

Modified: poolalloc/trunk/include/dsa/DataStructure.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DataStructure.h?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/include/dsa/DataStructure.h (original)
+++ poolalloc/trunk/include/dsa/DataStructure.h Mon Oct  8 11:30:10 2012
@@ -21,7 +21,7 @@
 #include "dsa/AllocatorIdentification.h"
 
 #include "llvm/Pass.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Support/CallSite.h"
 #include "llvm/ADT/EquivalenceClasses.h"
 #include "llvm/ADT/DenseSet.h"
@@ -44,8 +44,8 @@
 class DataStructures : public ModulePass {
   typedef std::map<const Function*, DSGraph*> DSInfoTy;
 
-  /// TargetData, comes in handy
-  TargetData* TD;
+  /// DataLayout, comes in handy
+  DataLayout* TD;
 
   /// Pass to get Graphs from
   DataStructures* GraphSource;
@@ -87,7 +87,7 @@
   std::vector<const Function*> GlobalFunctionList; 
 
   void init(DataStructures* D, bool clone, bool useAuxCalls, bool copyGlobalAuxCalls, bool resetAux);
-  void init(TargetData* T);
+  void init(DataLayout* T);
 
   void formGlobalECs();
   
@@ -139,7 +139,7 @@
 
   EquivalenceClasses<const GlobalValue*> &getGlobalECs() { return GlobalECs; }
 
-  TargetData& getTargetData() const { return *TD; }
+  DataLayout& getDataLayout() const { return *TD; }
 
   const DSCallGraph& getCallGraph() const { return callgraph; }
 
@@ -165,7 +165,7 @@
   /// getAnalysisUsage - This obviously provides a data structure graph.
   ///
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-    AU.addRequired<TargetData>();
+    AU.addRequired<DataLayout>();
     AU.setPreservesAll();
   }
 };
@@ -188,7 +188,7 @@
   /// getAnalysisUsage - This obviously provides a data structure graph.
   ///
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-    AU.addRequired<TargetData>();
+    AU.addRequired<DataLayout>();
     AU.addRequired<AddressTakenAnalysis>();
     AU.setPreservesAll();
   }

Modified: poolalloc/trunk/include/dsa/TypeSafety.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/TypeSafety.h?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/include/dsa/TypeSafety.h (original)
+++ poolalloc/trunk/include/dsa/TypeSafety.h Mon Oct  8 11:30:10 2012
@@ -49,7 +49,7 @@
     bool typeFieldsOverlap (const DSNode * N);
 
     // Pointers to prerequisite passes
-    TargetData * TD;
+    DataLayout * TD;
     dsa * dsaPass;
 
     // Data structures
@@ -65,7 +65,7 @@
     }
 
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-      AU.addRequired<TargetData>();
+      AU.addRequired<DataLayout>();
       AU.addRequired<dsa>();
       AU.setPreservesAll();
     }

Modified: poolalloc/trunk/include/poolalloc/Heuristic.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/poolalloc/Heuristic.h?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/include/poolalloc/Heuristic.h (original)
+++ poolalloc/trunk/include/poolalloc/Heuristic.h Mon Oct  8 11:30:10 2012
@@ -31,7 +31,7 @@
   class DSGraph;
   class DSNode;
   class PoolAllocate;
-  class TargetData;
+  class DataLayout;
   class Type;
 
 namespace PA {
@@ -128,7 +128,7 @@
     ///
     static unsigned getRecommendedAlignment(const DSNode *N);
     static unsigned getRecommendedAlignment(Type *Ty,
-                                            const TargetData &TD);
+                                            const DataLayout &TD);
   };
 
   ////////////////////////////////////////////////////////////////////////////

Modified: poolalloc/trunk/include/poolalloc/PoolAllocate.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/poolalloc/PoolAllocate.h?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/include/poolalloc/PoolAllocate.h (original)
+++ poolalloc/trunk/include/poolalloc/PoolAllocate.h Mon Oct  8 11:30:10 2012
@@ -536,7 +536,7 @@
   bool runOnModule(Module &M);
   GlobalVariable *CreateGlobalPool(unsigned RecSize, unsigned Align,
                                    Module& M);
-  void ProcessFunctionBodySimple(Function& F, TargetData & TD);
+  void ProcessFunctionBodySimple(Function& F, DataLayout & TD);
 
 
   virtual DSGraph* getDSGraph (const Function & F) const {
@@ -568,7 +568,7 @@
 
 // FIXME: Is this used?  Should it be removed?
 class PoolAllocateMultipleGlobalPool : public PoolAllocate {
-  void ProcessFunctionBodySimple(Function& F, TargetData & TD);
+  void ProcessFunctionBodySimple(Function& F, DataLayout & TD);
   /// Mapping between DSNodes and Pool descriptors. For this pass, it is a
   /// one-to-one relationship.
   typedef DenseMap<const DSNode *, GlobalVariable *> PoolMapTy;

Modified: poolalloc/trunk/include/rdsa/DSGraph.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/rdsa/DSGraph.h?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/include/rdsa/DSGraph.h (original)
+++ poolalloc/trunk/include/rdsa/DSGraph.h Mon Oct  8 11:30:10 2012
@@ -236,13 +236,13 @@
 
   /// TD - This is the target data object for the machine this graph is
   /// constructed for.
-  const TargetData &TD;
+  const DataLayout &TD;
 
   void operator=(const DSGraph &); // DO NOT IMPLEMENT
   DSGraph(const DSGraph&);         // DO NOT IMPLEMENT
 public:
   // Create a new, empty, DSGraph.
-  DSGraph(EquivalenceClasses<const GlobalValue*> &ECs, const TargetData &td,
+  DSGraph(EquivalenceClasses<const GlobalValue*> &ECs, const DataLayout &td,
           DSGraph *GG) 
     :GlobalsGraph(GG), UseAuxCalls(false), 
      ScalarMap(ECs), TD(td)
@@ -268,9 +268,9 @@
     return ScalarMap.getGlobalECs();
   }
 
-  /// getTargetData - Return the TargetData object for the current target.
+  /// getDataLayout - Return the DataLayout object for the current target.
   ///
-  const TargetData &getTargetData() const { return TD; }
+  const DataLayout &getDataLayout() const { return TD; }
 
   /// setUseAuxCalls - If you call this method, the auxillary call vector will
   /// be printed instead of the standard call vector to the dot file.

Modified: poolalloc/trunk/include/rdsa/DSNode.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/rdsa/DSNode.h?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/include/rdsa/DSNode.h (original)
+++ poolalloc/trunk/include/rdsa/DSNode.h Mon Oct  8 11:30:10 2012
@@ -23,7 +23,7 @@
 
 template<typename BaseType>
 class DSNodeIterator;          // Data structure graph traversal iterator
-class TargetData;
+class DataLayout;
 
 //===----------------------------------------------------------------------===//
 /// DSNode - Data structure node class
@@ -137,9 +137,9 @@
   void setParentGraph(DSGraph *G) { ParentGraph = G; }
 
 
-  /// getTargetData - Get the target data object used to construct this node.
+  /// getDataLayout - Get the target data object used to construct this node.
   ///
-  const TargetData &getTargetData() const;
+  const DataLayout &getDataLayout() const;
 
   /// getForwardNode - This method returns the node that this node is forwarded
   /// to, if any.

Modified: poolalloc/trunk/include/rdsa/DataStructure.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/rdsa/DataStructure.h?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/include/rdsa/DataStructure.h (original)
+++ poolalloc/trunk/include/rdsa/DataStructure.h Mon Oct  8 11:30:10 2012
@@ -15,7 +15,7 @@
 #define LLVM_ANALYSIS_DATA_STRUCTURE_H
 
 #include "llvm/Pass.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Support/CallSite.h"
 #include "llvm/ADT/EquivalenceClasses.h"
 
@@ -100,8 +100,8 @@
 class DataStructures : public ModulePass {
   typedef hash_map<const Function*, DSGraph*> DSInfoTy;
 
-  /// TargetData, comes in handy
-  TargetData* TD;
+  /// DataLayout, comes in handy
+  DataLayout* TD;
 
   /// Pass to get Graphs from
   DataStructures* GraphSource;
@@ -132,7 +132,7 @@
 
 
   void init(DataStructures* D, bool clone, bool useAuxCalls, bool copyGlobalAuxCalls, bool resetAux);
-  void init(TargetData* T);
+  void init(DataLayout* T);
 
   void formGlobalECs();
 
@@ -178,7 +178,7 @@
 
   EquivalenceClasses<const GlobalValue*> &getGlobalECs() { return GlobalECs; }
 
-  TargetData& getTargetData() const { return *TD; }
+  DataLayout& getDataLayout() const { return *TD; }
 
   /// deleteValue/copyValue - Interfaces to update the DSGraphs in the program.
   /// These correspond to the interfaces defined in the AliasAnalysis class.
@@ -203,7 +203,7 @@
   /// getAnalysisUsage - This obviously provides a data structure graph.
   ///
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-    AU.addRequired<TargetData>();
+    AU.addRequired<DataLayout>();
     AU.setPreservesAll();
   }
 };
@@ -223,7 +223,7 @@
   ///
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.addRequired<LocalDataStructures>();
-    AU.addPreserved<TargetData>();
+    AU.addPreserved<DataLayout>();
     AU.setPreservesCFG();
   }
 };
@@ -259,7 +259,7 @@
 
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.addRequired<StdLibDataStructures>();
-    AU.addPreserved<TargetData>();
+    AU.addPreserved<DataLayout>();
     AU.setPreservesCFG();
   }
 
@@ -301,7 +301,7 @@
 
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.addRequired<BUDataStructures>();
-    AU.addPreserved<TargetData>();
+    AU.addPreserved<DataLayout>();
     AU.setPreservesCFG();
   }
 
@@ -324,7 +324,7 @@
 
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
     AU.addRequired<CompleteBUDataStructures>();
-    AU.addPreserved<TargetData>();
+    AU.addPreserved<DataLayout>();
     AU.setPreservesCFG();
   }
 
@@ -382,7 +382,7 @@
       AU.addRequired<BUDataStructures>();
       AU.addPreserved<BUDataStructures>();
     }
-    AU.addPreserved<TargetData>();
+    AU.addPreserved<DataLayout>();
     AU.setPreservesCFG();
   }
 
@@ -427,7 +427,7 @@
   virtual void releaseMemory();
 
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-    AU.addRequired<TargetData>();
+    AU.addRequired<DataLayout>();
     AU.addRequired<StdLibDataStructures>();
     AU.setPreservesAll();
   }

Modified: poolalloc/trunk/lib/AssistDS/Devirt.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/Devirt.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/Devirt.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/Devirt.cpp Mon Oct  8 11:30:10 2012
@@ -399,7 +399,7 @@
   // Get information on the target system.
   //
   //
-  TD = &getAnalysis<TargetData>();
+  TD = &getAnalysis<DataLayout>();
 
   // Visit all of the call instructions in this function and record those that
   // are indirect function calls.

Modified: poolalloc/trunk/lib/AssistDS/DynCount.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/DynCount.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/DynCount.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/DynCount.cpp Mon Oct  8 11:30:10 2012
@@ -16,7 +16,7 @@
 #include "llvm/Module.h"
 #include "llvm/Instructions.h"
 #include "llvm/Constants.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "dsa/TypeSafety.h"
 
 using namespace llvm;
@@ -34,7 +34,7 @@
   }
   virtual bool runOnModule (Module & M);
   virtual void getAnalysisUsage(AnalysisUsage &AU) const {
-    AU.addRequired<TargetData>();
+    AU.addRequired<DataLayout>();
     AU.addRequired<dsa::TypeSafety<TDDataStructures> >();
   }
 };

Modified: poolalloc/trunk/lib/AssistDS/Int2PtrCmp.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/Int2PtrCmp.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/Int2PtrCmp.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/Int2PtrCmp.cpp Mon Oct  8 11:30:10 2012
@@ -45,7 +45,7 @@
 //  false - The module was not modified.
 //
 bool Int2PtrCmp::runOnModule(Module& M) {
-  TD = &getAnalysis<TargetData>();
+  TD = &getAnalysis<DataLayout>();
   for (Module::iterator F = M.begin(); F != M.end(); ++F) {
     for (Function::iterator B = F->begin(), FE = F->end(); B != FE; ++B) {      
       for (BasicBlock::iterator I = B->begin(), BE = B->end(); I != BE;) {

Modified: poolalloc/trunk/lib/AssistDS/SimplifyExtractValue.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/SimplifyExtractValue.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/SimplifyExtractValue.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/SimplifyExtractValue.cpp Mon Oct  8 11:30:10 2012
@@ -21,7 +21,7 @@
 #include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/PatternMatch.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 
 #include <set>
 #include <map>

Modified: poolalloc/trunk/lib/AssistDS/SimplifyGEP.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/SimplifyGEP.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/SimplifyGEP.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/SimplifyGEP.cpp Mon Oct  8 11:30:10 2012
@@ -20,7 +20,7 @@
 #include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Operator.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 
 #include <vector>
 
@@ -75,7 +75,7 @@
 //  false - The module was not modified.
 //
 bool SimplifyGEP::runOnModule(Module& M) {
-  TD = &getAnalysis<TargetData>();
+  TD = &getAnalysis<DataLayout>();
   preprocess(M);
   for (Module::iterator F = M.begin(); F != M.end(); ++F){
     for (Function::iterator B = F->begin(), FE = F->end(); B != FE; ++B) {      

Modified: poolalloc/trunk/lib/AssistDS/SimplifyInsertValue.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/SimplifyInsertValue.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/SimplifyInsertValue.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/SimplifyInsertValue.cpp Mon Oct  8 11:30:10 2012
@@ -19,7 +19,7 @@
 #include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/PatternMatch.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 
 #include <set>
 #include <map>

Modified: poolalloc/trunk/lib/AssistDS/SimplifyLoad.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/SimplifyLoad.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/SimplifyLoad.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/SimplifyLoad.cpp Mon Oct  8 11:30:10 2012
@@ -17,7 +17,7 @@
 #include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/PatternMatch.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 
 #include <set>
 #include <map>

Modified: poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/TypeChecks.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/TypeChecks.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/TypeChecks.cpp Mon Oct  8 11:30:10 2012
@@ -152,7 +152,7 @@
   bool modified = false; // Flags whether we modified the module.
   bool transformIndirectCalls = true;
 
-  TD = &getAnalysis<TargetData>();
+  TD = &getAnalysis<DataLayout>();
   addrAnalysis = &getAnalysis<AddressTakenAnalysis>();
 
   // Create the necessary prototypes

Modified: poolalloc/trunk/lib/DSA/Basic.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Basic.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Basic.cpp (original)
+++ poolalloc/trunk/lib/DSA/Basic.cpp Mon Oct  8 11:30:10 2012
@@ -33,7 +33,7 @@
 char BasicDataStructures::ID = 0;
 
 bool BasicDataStructures::runOnModule(Module &M) {
-  init(&getAnalysis<TargetData>());
+  init(&getAnalysis<DataLayout>());
 
   //
   // Create a void pointer type.  This is simply a pointer to an 8 bit value.
@@ -62,7 +62,7 @@
 
   for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) {
     if (!F->isDeclaration()) {
-      DSGraph* G = new DSGraph(GlobalECs, getTargetData(), *TypeSS, GlobalsGraph);
+      DSGraph* G = new DSGraph(GlobalECs, getDataLayout(), *TypeSS, GlobalsGraph);
       DSNode * Node = new DSNode(G);
           
       if (!F->hasInternalLinkage())

Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSGraph.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DSGraph.cpp (original)
+++ poolalloc/trunk/lib/DSA/DSGraph.cpp Mon Oct  8 11:30:10 2012
@@ -22,7 +22,7 @@
 #include "llvm/GlobalVariable.h"
 #include "llvm/Instructions.h"
 #include "llvm/DerivedTypes.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Assembly/Writer.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"

Modified: poolalloc/trunk/lib/DSA/DataStructure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DataStructure.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DataStructure.cpp (original)
+++ poolalloc/trunk/lib/DSA/DataStructure.cpp Mon Oct  8 11:30:10 2012
@@ -21,7 +21,7 @@
 #include "llvm/GlobalVariable.h"
 #include "llvm/Instructions.h"
 #include "llvm/DerivedTypes.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Assembly/Writer.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
@@ -334,7 +334,7 @@
 void DSNode::markIntPtrFlags() {
   // check if the types merged have both int and pointer at the same offset,
 
-  const TargetData &TD = getParentGraph()->getTargetData();
+  const DataLayout &TD = getParentGraph()->getDataLayout();
   // check all offsets for that node.
   for(unsigned offset = 0; offset < getSize() ; offset++) {
     // if that Node has no Type information, skip
@@ -414,7 +414,7 @@
   if (isArrayNode() && getSize() > 0) {
     Offset %= getSize();
   }
-  const TargetData &TD = getParentGraph()->getTargetData();
+  const DataLayout &TD = getParentGraph()->getDataLayout();
   if (Offset + TD.getTypeAllocSize(NewTy) >= getSize())
     growSize(Offset + TD.getTypeAllocSize(NewTy));
 
@@ -441,7 +441,7 @@
   // individually(at the appropriate offset), instead of the 
   // struct type.
   if(NewTy->isStructTy()) {
-    const TargetData &TD = getParentGraph()->getTargetData();
+    const DataLayout &TD = getParentGraph()->getDataLayout();
     StructType *STy = cast<StructType>(NewTy);
     const StructLayout *SL = TD.getStructLayout(cast<StructType>(STy));
     unsigned count = 0;
@@ -460,7 +460,7 @@
   if (isCollapsedNode()) return;
   if (isArrayNode()) Offset %= getSize();
 
-  const TargetData &TD = getParentGraph()->getTargetData();
+  const DataLayout &TD = getParentGraph()->getDataLayout();
   if (!TyMap[Offset]){
     TyMap[Offset] = TyIt;
     for (svset<Type*>::const_iterator ni = TyMap[Offset]->begin(),
@@ -1300,7 +1300,7 @@
       if (resetAuxCalls)
         G->getAuxFunctionCalls() = G->getFunctionCalls();
     } else {
-      G = new DSGraph(GlobalECs, GraphSource->getTargetData(), *TypeSS);
+      G = new DSGraph(GlobalECs, GraphSource->getDataLayout(), *TypeSS);
       G->spliceFrom(BaseGraph);
       if (resetAuxCalls)
         G->getAuxFunctionCalls() = G->getFunctionCalls();
@@ -1491,7 +1491,7 @@
   if (!clone) D->DSGraphsStolen = true;
 }
 
-void DataStructures::init(TargetData* T) {
+void DataStructures::init(DataLayout* T) {
   assert (!TD && "Already init");
   GraphSource = 0;
   Clone = false;

Modified: poolalloc/trunk/lib/DSA/DataStructureStats.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DataStructureStats.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DataStructureStats.cpp (original)
+++ poolalloc/trunk/lib/DSA/DataStructureStats.cpp Mon Oct  8 11:30:10 2012
@@ -64,7 +64,7 @@
   class DSGraphStats : public FunctionPass, public InstVisitor<DSGraphStats> {
     void countCallees(const Function &F);
     const TDDataStructures *DS;
-    const TargetData *TD;
+    const DataLayout *TD;
     const DSGraph *TDGraph;
     dsa::TypeSafety<TDDataStructures> *TS;
     DSNodeHandle getNodeHandleForValue(Value *V);
@@ -80,7 +80,7 @@
     void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesAll();
       AU.addRequired<TDDataStructures>();
-      AU.addRequired<TargetData>();
+      AU.addRequired<DataLayout>();
       AU.addRequired<dsa::TypeSafety<TDDataStructures> >();
     }
 
@@ -236,7 +236,7 @@
 
 bool DSGraphStats::runOnFunction(Function& F) {
   DS = &getAnalysis<TDDataStructures>();
-  TD = &getAnalysis<TargetData>();
+  TD = &getAnalysis<DataLayout>();
   TS = &getAnalysis<dsa::TypeSafety<TDDataStructures> >();
   TDGraph = DS->getDSGraph(F);
   countCallees(F);

Modified: poolalloc/trunk/lib/DSA/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Local.cpp (original)
+++ poolalloc/trunk/lib/DSA/Local.cpp Mon Oct  8 11:30:10 2012
@@ -27,7 +27,7 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/Timer.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/Triple.h"
@@ -73,7 +73,7 @@
     DSGraph &G;
     Function* FB;
     LocalDataStructures* DS;
-    const TargetData& TD;
+    const DataLayout& TD;
 
     ////////////////////////////////////////////////////////////////////////////
     // Helper functions used to implement the visitation functions...
@@ -142,7 +142,7 @@
 
   public:
     GraphBuilder(Function &f, DSGraph &g, LocalDataStructures& DSi)
-      : G(g), FB(&f), DS(&DSi), TD(g.getTargetData()) {
+      : G(g), FB(&f), DS(&DSi), TD(g.getDataLayout()) {
       // Create scalar nodes for all pointer arguments...
       for (Function::arg_iterator I = f.arg_begin(), E = f.arg_end();
            I != E; ++I) {
@@ -204,7 +204,7 @@
 
     // GraphBuilder ctor for working on the globals graph
     explicit GraphBuilder(DSGraph& g)
-      :G(g), FB(0), TD(g.getTargetData())
+      :G(g), FB(0), TD(g.getDataLayout())
     {}
 
     void mergeInGlobalInitializer(GlobalVariable *GV);
@@ -612,11 +612,11 @@
 }
 
 unsigned getValueOffset(Type *Ty, ArrayRef<unsigned> Idxs,
-                        const TargetData &TD) {
+                        const DataLayout &TD) {
   unsigned Offset = 0;
   for (ArrayRef<unsigned>::iterator I = Idxs.begin(), E = Idxs.end(); I != E;
        ++I) {
-    // Lifted from TargetData.cpp's getIndexedOffset.
+    // Lifted from DataLayout.cpp's getIndexedOffset.
     // We can't use that because it insists on only allowing pointer types.
     if (StructType *STy = dyn_cast<StructType>(Ty)) {
       unsigned FieldNo = *I;
@@ -1365,7 +1365,7 @@
 char LocalDataStructures::ID;
 
 bool LocalDataStructures::runOnModule(Module &M) {
-  init(&getAnalysis<TargetData>());
+  init(&getAnalysis<DataLayout>());
   addrAnalysis = &getAnalysis<AddressTakenAnalysis>();
 
   // First step, build the globals graph.
@@ -1405,7 +1405,7 @@
   // Calculate all of the graphs...
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
     if (!I->isDeclaration()) {
-      DSGraph* G = new DSGraph(GlobalECs, getTargetData(), *TypeSS, GlobalsGraph);
+      DSGraph* G = new DSGraph(GlobalECs, getDataLayout(), *TypeSS, GlobalsGraph);
       GraphBuilder GGB(*I, *G, *this);
       G->getAuxFunctionCalls() = G->getFunctionCalls();
       setDSGraph(*I, G);

Modified: poolalloc/trunk/lib/DSA/StdLibPass.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/StdLibPass.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/StdLibPass.cpp (original)
+++ poolalloc/trunk/lib/DSA/StdLibPass.cpp Mon Oct  8 11:30:10 2012
@@ -19,7 +19,7 @@
 #include "llvm/Instructions.h"
 #include "llvm/Intrinsics.h"
 #include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/FormattedStream.h"

Modified: poolalloc/trunk/lib/DSA/TopDownClosure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/TopDownClosure.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/TopDownClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/TopDownClosure.cpp Mon Oct  8 11:30:10 2012
@@ -404,7 +404,7 @@
     } else {
       // Otherwise, create a new DSGraph to represent this.
       DSGraph* IndCallGraph = new DSGraph(DSG->getGlobalECs(),
-                                          DSG->getTargetData(), *TypeSS);
+                                          DSG->getDataLayout(), *TypeSS);
 
       // Clone over the call into the new DSGraph
       ReachabilityCloner RC(IndCallGraph, DSG, 0);

Modified: poolalloc/trunk/lib/DSA/TypeSafety.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/TypeSafety.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/TypeSafety.cpp (original)
+++ poolalloc/trunk/lib/DSA/TypeSafety.cpp Mon Oct  8 11:30:10 2012
@@ -333,7 +333,7 @@
   //
   // Get access to prerequisite passes.
   //
-  TD      = &getAnalysis<TargetData>();
+  TD      = &getAnalysis<DataLayout>();
   dsaPass = &getAnalysis<dsa>();
 
   //

Modified: poolalloc/trunk/lib/Macroscopic/StructureFieldVisitor.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/Macroscopic/StructureFieldVisitor.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/Macroscopic/StructureFieldVisitor.cpp (original)
+++ poolalloc/trunk/lib/Macroscopic/StructureFieldVisitor.cpp Mon Oct  8 11:30:10 2012
@@ -63,7 +63,7 @@
 /// getFieldOffset - Return the offset of this field from the start of the node.
 ///
 unsigned LatticeValue::getFieldOffset() const {
-  const TargetData &TD = getNode()->getParentGraph()->getTargetData();
+  const DataLayout &TD = getNode()->getParentGraph()->getDataLayout();
 
   unsigned Offset = 0;
   const Type *Ty = Node->getType();
@@ -181,7 +181,7 @@
 
 static void ComputeStructureFieldIndices(const Type *Ty, unsigned Offset,
                                          std::vector<unsigned> &Idxs,
-                                         const TargetData &TD) {
+                                         const DataLayout &TD) {
   if (Ty->isFirstClassType()) {
     assert(Offset == 0 && "Illegal structure index!");
     return;
@@ -225,7 +225,7 @@
   // Okay, next convert the node offset to a field index expression.
   std::vector<unsigned> Idxs;
   ComputeStructureFieldIndices(Node->getType(), NH->getOffset(), Idxs,
-                               Node->getParentGraph()->getTargetData());
+                               Node->getParentGraph()->getDataLayout());
 
   for (; I != NodeLVs.end() && I->first == Node; ++I)
     if (I->second->getIndices() == Idxs)
@@ -329,7 +329,7 @@
 ///
 static bool VisitGlobalInit(LatticeValue *LV, Constant *Init,
                             unsigned FieldOffset) {
-  const TargetData &TD = LV->getParentGraph().getTargetData();
+  const DataLayout &TD = LV->getParentGraph().getDataLayout();
 
   if (Init->isNullValue())
     return LV->visitGlobalInit(Constant::getNullValue(LV->getFieldType()));

Modified: poolalloc/trunk/lib/PoolAllocate/AllHeapNodesHeuristic.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/AllHeapNodesHeuristic.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/AllHeapNodesHeuristic.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/AllHeapNodesHeuristic.cpp Mon Oct  8 11:30:10 2012
@@ -25,7 +25,7 @@
 #include "llvm/ADT/DepthFirstIterator.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/FormattedStream.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include <iostream>
 
 using namespace llvm;

Modified: poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp Mon Oct  8 11:30:10 2012
@@ -24,7 +24,7 @@
 #include "llvm/ADT/DepthFirstIterator.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/FormattedStream.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include <iostream>
 
 using namespace llvm;
@@ -85,7 +85,7 @@
 //  Offs - The offset of the type within a derived type (e.g., a structure).
 //         We will try to align a structure on an 8 byte boundary if one of its
 //         elements can/needs to be.
-//  TD   - A reference to the TargetData pass.
+//  TD   - A reference to the DataLayout pass.
 //
 // Return value:
 //  true - This type should be allocated on an 8-byte boundary.
@@ -97,7 +97,7 @@
 //  FIXME: This code needs to handle LLVM first-class structures and vectors.
 //
 static bool
-Wants8ByteAlignment(Type *Ty, unsigned Offs, const TargetData &TD) {
+Wants8ByteAlignment(Type *Ty, unsigned Offs, const DataLayout &TD) {
   //
   // If the user has requested this optimization to be turned off, don't bother
   // doing it.
@@ -110,7 +110,7 @@
   //
   if ((Offs & 7) == 0) {
     //
-    // Doubles always want to be 8-byte aligned regardless of what TargetData
+    // Doubles always want to be 8-byte aligned regardless of what DataLayout
     // claims.
     //
     if (Ty->isDoubleTy()) return true;
@@ -154,7 +154,7 @@
 }
 
 unsigned Heuristic::getRecommendedAlignment(Type *Ty,
-                                            const TargetData &TD) {
+                                            const DataLayout &TD) {
   if (!Ty || Ty->isVoidTy())  // Is this void or collapsed?
     return 0;  // No known alignment, let runtime decide.
 
@@ -174,9 +174,9 @@
 unsigned
 Heuristic::getRecommendedAlignment(const DSNode *Node) {
   //
-  // Get the TargetData information from the DSNode's DSGraph.
+  // Get the DataLayout information from the DSNode's DSGraph.
   //
-  const TargetData &TD = Node->getParentGraph()->getTargetData();
+  const DataLayout &TD = Node->getParentGraph()->getDataLayout();
 
   //
   // Iterate through all the types that the DSA type-inference algorithm

Modified: poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp Mon Oct  8 11:30:10 2012
@@ -26,7 +26,7 @@
 #include "llvm/Module.h"
 #include "llvm/TypeBuilder.h"
 #include "llvm/Support/CFG.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #include "llvm/Transforms/Utils/Cloning.h"
 #include "llvm/ADT/DepthFirstIterator.h"
@@ -74,7 +74,7 @@
 }
 
 void PoolAllocateMultipleGlobalPool::getAnalysisUsage(AnalysisUsage &AU) const {
-  AU.addRequired<TargetData>();
+  AU.addRequired<DataLayout>();
   assert(0 && "PoolAllocateMultipleGlobalPool doesn't work! Needs Steensgard-like analysis, which was removed!");
   //AU.addRequiredTransitive<SteensgaardDataStructures>();
   // It is a big lie.
@@ -96,7 +96,7 @@
   Graphs = NULL;
   assert (Graphs && "No DSA pass available!\n");
 
-  TargetData & TD = getAnalysis<TargetData>();
+  DataLayout & TD = getAnalysis<DataLayout>();
 
   // Add the pool* prototypes to the module
   AddPoolPrototypes(&M);
@@ -120,7 +120,7 @@
 }
 
 void
-PoolAllocateMultipleGlobalPool::ProcessFunctionBodySimple (Function& F, TargetData & TD) {
+PoolAllocateMultipleGlobalPool::ProcessFunctionBodySimple (Function& F, DataLayout & TD) {
   std::vector<Instruction*> toDelete;
   std::vector<ReturnInst*> Returns;
 

Modified: poolalloc/trunk/lib/PoolAllocate/PASimple.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PASimple.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PASimple.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PASimple.cpp Mon Oct  8 11:30:10 2012
@@ -24,7 +24,7 @@
 #include "llvm/Module.h"
 #include "llvm/Constants.h"
 #include "llvm/Support/CFG.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #include "llvm/Transforms/Utils/Cloning.h"
 #include "llvm/ADT/DepthFirstIterator.h"
@@ -71,7 +71,7 @@
 }
 
 void PoolAllocateSimple::getAnalysisUsage(AnalysisUsage &AU) const {
-  AU.addRequired<TargetData>();
+  AU.addRequired<DataLayout>();
   // Get the Target Data information and the Graphs
   if (CompleteDSA) {
     AU.addRequiredTransitive<EQTDDataStructures>();
@@ -132,7 +132,7 @@
     Graphs = &getAnalysis<BasicDataStructures>();
   }
   assert (Graphs && "No DSA pass available!\n");
-  TargetData & TD = getAnalysis<TargetData>();
+  DataLayout & TD = getAnalysis<DataLayout>();
 
   // Add the pool* prototypes to the module
   AddPoolPrototypes(&M);
@@ -188,7 +188,7 @@
 }
 
 void
-PoolAllocateSimple::ProcessFunctionBodySimple (Function& F, TargetData & TD) {
+PoolAllocateSimple::ProcessFunctionBodySimple (Function& F, DataLayout & TD) {
   // Set of instructions to delete because they have been replaced.  We record
   // all instructions to delete first and then delete them later to avoid
   // invalidating the iterators over the instruction list.

Modified: poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp Mon Oct  8 11:30:10 2012
@@ -194,7 +194,7 @@
     /// Initialize - When we know all of the pools in a function that are going
     /// to be compressed, initialize our state based on that data.
     void Initialize(std::map<const DSNode*, CompressedPoolInfo> &Nodes,
-                    const TargetData &TD);
+                    const DataLayout &TD);
 
     const DSNode *getNode() const { return Pool; }
     Type *getNewType() const { return NewTy; }
@@ -225,7 +225,7 @@
 /// to be compressed, initialize our state based on that data.
 void CompressedPoolInfo::Initialize(std::map<const DSNode*, 
                                              CompressedPoolInfo> &Nodes,
-                                    const TargetData &TD) {
+                                    const DataLayout &TD) {
   // First step, compute the type of the compressed node.  This basically
   // replaces all pointers to compressed pools with uints.
 //FIXME: TYPE
@@ -263,7 +263,7 @@
     return OrigTy;
 
 
-  const TargetData &TD = getNode()->getParentGraph()->getTargetData();
+  const DataLayout &TD = getNode()->getParentGraph()->getDataLayout();
 
   // Okay, we have an aggregate type.
   if (StructType *STy = dyn_cast<StructType>(OrigTy)) {
@@ -323,7 +323,7 @@
 /// dump - Emit a debugging dump for this pool info.
 ///
 void CompressedPoolInfo::dump() const {
-//  const TargetData &TD = getNode()->getParentGraph()->getTargetData();
+//  const DataLayout &TD = getNode()->getParentGraph()->getDataLayout();
 //FIXME: type
   //errs() << "  From size: "
 //            << (getNode()->getType()->isSized() ?
@@ -352,9 +352,9 @@
   
     const PointerCompress::PoolInfoMap &PoolInfo;
 
-    /// TD - The TargetData object for the current target.
+    /// TD - The DataLayout object for the current target.
     ///
-    const TargetData &TD;
+    const DataLayout &TD;
 
 
     DSGraph* DSG;
@@ -373,7 +373,7 @@
     InstructionRewriter(const PointerCompress::PoolInfoMap &poolInfo,
                         DSGraph* dsg, PA::FuncInfo &pafi,
                         FunctionCloneRecord *fcr, PointerCompress &ptrcomp)
-      : PoolInfo(poolInfo), TD(dsg->getTargetData()), DSG(dsg),
+      : PoolInfo(poolInfo), TD(dsg->getDataLayout()), DSG(dsg),
         PAFuncInfo(pafi), FCR(fcr), PtrComp(ptrcomp) {
     }
 
@@ -1312,7 +1312,7 @@
   // Use these to compute the closure of compression information.  In
   // particular, if one pool points to another, we need to know if the outgoing
   // pointer is compressed.
-  const TargetData &TD = DSG->getTargetData();
+  const DataLayout &TD = DSG->getDataLayout();
   errs() << "In function '" << F.getName().str() << "':\n";
   for (std::map<const DSNode*, CompressedPoolInfo>::iterator
          I = PoolsToCompress.begin(), E = PoolsToCompress.end(); I != E; ++I) {

Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Mon Oct  8 11:30:10 2012
@@ -28,7 +28,7 @@
 #include "llvm/Constants.h"
 #include "llvm/Attributes.h"
 #include "llvm/Support/CFG.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #include "llvm/Transforms/Utils/Cloning.h"
 #include "llvm/ADT/DepthFirstIterator.h"
@@ -219,7 +219,7 @@
   if (lie_preserve_passes == LIE_PRESERVE_ALL)
     AU.setPreservesAll();
 
-  AU.addRequired<TargetData>();
+  AU.addRequired<DataLayout>();
 }
 
 bool PoolAllocate::runOnModule(Module &M) {

Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Mon Oct  8 11:30:10 2012
@@ -22,7 +22,7 @@
 #include "llvm/DerivedTypes.h"
 #include "llvm/Constants.h"
 #include "llvm/Instructions.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Support/InstVisitor.h"
 #include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/Debug.h"

Modified: poolalloc/trunk/lib/rDSA/DataStructure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/rDSA/DataStructure.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/rDSA/DataStructure.cpp (original)
+++ poolalloc/trunk/lib/rDSA/DataStructure.cpp Mon Oct  8 11:30:10 2012
@@ -20,7 +20,7 @@
 #include "llvm/GlobalVariable.h"
 #include "llvm/Instructions.h"
 #include "llvm/DerivedTypes.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Assembly/Writer.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
@@ -144,10 +144,10 @@
   assert(hasNoReferrers() && "Referrers to dead node exist!");
 }
 
-/// getTargetData - Get the target data object used to construct this node.
+/// getDataLayout - Get the target data object used to construct this node.
 ///
-const TargetData &DSNode::getTargetData() const {
-  return ParentGraph->getTargetData();
+const DataLayout &DSNode::getDataLayout() const {
+  return ParentGraph->getDataLayout();
 }
 
 void DSNode::assertOK() const {
@@ -330,9 +330,9 @@
     };
 
     std::vector<StackState> Stack;
-    const TargetData &TD;
+    const DataLayout &TD;
   public:
-    TypeElementWalker(const Type *T, const TargetData &td) : TD(td) {
+    TypeElementWalker(const Type *T, const DataLayout &td) : TD(td) {
       Stack.push_back(T);
       StepToLeaf();
     }
@@ -416,7 +416,7 @@
 /// is true, then we also allow a larger T1.
 ///
 static bool ElementTypesAreCompatible(const Type *T1, const Type *T2,
-                                      bool AllowLargerT1, const TargetData &TD){
+                                      bool AllowLargerT1, const DataLayout &TD){
   TypeElementWalker T1W(T1, TD), T2W(T2, TD);
 
   while (!T1W.isDone() && !T2W.isDone()) {
@@ -447,7 +447,7 @@
 bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset,
                            bool FoldIfIncompatible) {
   //DOUT << "merging " << *NewTy << " at " << Offset << " with " << *Ty << "\n";
-  const TargetData &TD = getTargetData();
+  const DataLayout &TD = getDataLayout();
   // Check to make sure the Size member is up-to-date.  Size can be one of the
   // following:
   //  Size = 0, Ty = Void: Nothing is known about this node.
@@ -2527,7 +2527,7 @@
       G = new DSGraph(BaseGraph, GlobalECs, GlobalsGraph, 
 		      DSGraph::DontCloneAuxCallNodes);
     } else {
-      G = new DSGraph(GlobalECs, GraphSource->getTargetData(),
+      G = new DSGraph(GlobalECs, GraphSource->getDataLayout(),
 		      GlobalsGraph);
       G->spliceFrom(BaseGraph);
       if (resetAuxCalls) 
@@ -2662,7 +2662,7 @@
   if (!clone) D->DSGraphsStolen = true;
 }
 
-void DataStructures::init(TargetData* T) {
+void DataStructures::init(DataLayout* T) {
   assert (!TD && "Already init");
   GraphSource = 0;
   Clone = false;

Modified: poolalloc/trunk/lib/rDSA/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/rDSA/Local.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/rDSA/Local.cpp (original)
+++ poolalloc/trunk/lib/rDSA/Local.cpp Mon Oct  8 11:30:10 2012
@@ -23,7 +23,7 @@
 #include "llvm/Intrinsics.h"
 #include "llvm/Support/GetElementPtrTypeIterator.h"
 #include "llvm/Support/InstVisitor.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/FormattedStream.h"
@@ -510,7 +510,7 @@
     return;
   }
 
-  const TargetData &TD = Value.getNode()->getTargetData();
+  const DataLayout &TD = Value.getNode()->getDataLayout();
 
 #if 0
   // Handle the pointer index specially...
@@ -894,7 +894,7 @@
 
   if (Ty->isIntOrIntVector() || Ty->isFPOrFPVector()) return;
 
-  const TargetData &TD = NH.getNode()->getTargetData();
+  const DataLayout &TD = NH.getNode()->getDataLayout();
 
   if (ConstantArray *CA = dyn_cast<ConstantArray>(C)) {
     for (unsigned i = 0, e = CA->getNumOperands(); i != e; ++i)
@@ -944,7 +944,7 @@
 char LocalDataStructures::ID;
 
 bool LocalDataStructures::runOnModule(Module &M) {
-  init(&getAnalysis<TargetData>());
+  init(&getAnalysis<DataLayout>());
 
   // First step, build the globals graph.
   {
@@ -972,7 +972,7 @@
   // Calculate all of the graphs...
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
     if (!I->isDeclaration()) {
-      DSGraph* G = new DSGraph(GlobalECs, getTargetData(), GlobalsGraph);
+      DSGraph* G = new DSGraph(GlobalECs, getDataLayout(), GlobalsGraph);
       GraphBuilderLocal GGB(*I, G->getOrCreateReturnNodeFor(*I), G, *this);
       G->getAuxFunctionCalls() = G->getFunctionCalls();
       setDSGraph(I, G);

Modified: poolalloc/trunk/lib/rDSA/StdLibPass.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/rDSA/StdLibPass.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/rDSA/StdLibPass.cpp (original)
+++ poolalloc/trunk/lib/rDSA/StdLibPass.cpp Mon Oct  8 11:30:10 2012
@@ -17,7 +17,7 @@
 #include "llvm/Instructions.h"
 #include "llvm/Intrinsics.h"
 #include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/FormattedStream.h"

Modified: poolalloc/trunk/lib/rDSA/Steensgaard.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/rDSA/Steensgaard.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/rDSA/Steensgaard.cpp (original)
+++ poolalloc/trunk/lib/rDSA/Steensgaard.cpp Mon Oct  8 11:30:10 2012
@@ -49,7 +49,7 @@
 bool
 SteensgaardDataStructures::runOnModule(Module &M) {
   DS = &getAnalysis<StdLibDataStructures>();
-  init(&getAnalysis<TargetData>());
+  init(&getAnalysis<DataLayout>());
   return runOnModuleInternal(M);
 }
 
@@ -62,7 +62,7 @@
   GlobalsGraph = new DSGraph(GG, GG->getGlobalECs(), 0, 0);
 
   // Create a new, empty, graph...
-  ResultGraph = new DSGraph(GG->getGlobalECs(), getTargetData(), GlobalsGraph);
+  ResultGraph = new DSGraph(GG->getGlobalECs(), getDataLayout(), GlobalsGraph);
   
   // Loop over the rest of the module, merging graphs for non-external functions
   // into this graph.

Modified: poolalloc/trunk/lib/rDSA/TopDownClosure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/rDSA/TopDownClosure.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/lib/rDSA/TopDownClosure.cpp (original)
+++ poolalloc/trunk/lib/rDSA/TopDownClosure.cpp Mon Oct  8 11:30:10 2012
@@ -344,7 +344,7 @@
       IndCallGraph = IndCallRecI->second;
     } else {
       // Otherwise, create a new DSGraph to represent this.
-      IndCallGraph = new DSGraph(DSG->getGlobalECs(), DSG->getTargetData(), GlobalsGraph);
+      IndCallGraph = new DSGraph(DSG->getGlobalECs(), DSG->getDataLayout(), GlobalsGraph);
       // Make a nullary dummy call site, which will eventually get some content
       // merged into it.  The actual callee function doesn't matter here, so we
       // just pass it something to keep the ctor happy.

Modified: poolalloc/trunk/tools/Pa/pa.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/tools/Pa/pa.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/tools/Pa/pa.cpp (original)
+++ poolalloc/trunk/tools/Pa/pa.cpp Mon Oct  8 11:30:10 2012
@@ -23,7 +23,7 @@
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/PluginLoader.h"
 #include "llvm/Support/FileUtilities.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Analysis/Verifier.h"
 #include "llvm/System/Signals.h"
@@ -89,7 +89,7 @@
   // Build up all of the passes that we want to do to the module...
   PassManager Passes;
 
-  Passes.add(new TargetData(M.get()));
+  Passes.add(new DataLayout(M.get()));
 
   // Currently deactiviated
   Passes.add(new PoolAllocate());

Modified: poolalloc/trunk/tools/TypeChecker/tc.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/tools/TypeChecker/tc.cpp?rev=165399&r1=165398&r2=165399&view=diff
==============================================================================
--- poolalloc/trunk/tools/TypeChecker/tc.cpp (original)
+++ poolalloc/trunk/tools/TypeChecker/tc.cpp Mon Oct  8 11:30:10 2012
@@ -23,7 +23,7 @@
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/PluginLoader.h"
 #include "llvm/Support/FileUtilities.h"
-#include "llvm/Target/TargetData.h"
+#include "llvm/DataLayout.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Analysis/Verifier.h"
 #include "llvm/System/Signals.h"
@@ -92,7 +92,7 @@
   // Build up all of the passes that we want to do to the module...
   PassManager Passes;
 
-  Passes.add(new TargetData(M.get()));
+  Passes.add(new DataLayout(M.get()));
 
   // Currently deactiviated
   Passes.add(new TypeChecks());





More information about the llvm-commits mailing list