[poolalloc] r206408 - Update DSA for ToT, based on D3366 by Robert Matusewicz.
Will Dietz
wdietz2 at illinois.edu
Wed Apr 16 10:56:06 PDT 2014
Author: wdietz2
Date: Wed Apr 16 12:56:05 2014
New Revision: 206408
URL: http://llvm.org/viewvc/llvm-project?rev=206408&view=rev
Log:
Update DSA for ToT, based on D3366 by Robert Matusewicz.
Changes include:
* remove DataStructureCallGraph - as it was not used by poolalloc and SAFECode
* changing include statements to properly include various LLVM headers
* changing name of various analysis passes
* changing calls to methods returning user iterators
* Additional use_{begin,end} => user_{begin,end} changes.
* Update lit cfg files so tests run.
* Update lit tests containing uses of the now deprecated weak aliases
* Fixup lit test containing invalid intializer for llvm.compiler.used
Tests now pass locally.
Modified:
poolalloc/trunk/include/assistDS/DataStructureCallGraph.h
poolalloc/trunk/include/assistDS/Devirt.h
poolalloc/trunk/include/assistDS/Int2PtrCmp.h
poolalloc/trunk/include/assistDS/SimplifyGEP.h
poolalloc/trunk/include/assistDS/TypeChecks.h
poolalloc/trunk/include/assistDS/TypeChecksOpt.h
poolalloc/trunk/include/dsa/CallTargets.h
poolalloc/trunk/include/dsa/DSCallGraph.h
poolalloc/trunk/include/dsa/DSSupport.h
poolalloc/trunk/include/dsa/DataStructure.h
poolalloc/trunk/include/dsa/TypeSafety.h
poolalloc/trunk/include/poolalloc/PoolAllocate.h
poolalloc/trunk/include/poolalloc/RunTimeAssociate.h
poolalloc/trunk/include/rdsa/CallTargets.h
poolalloc/trunk/include/rdsa/DSSupport.h
poolalloc/trunk/include/rdsa/DataStructure.h
poolalloc/trunk/lib/AssistDS/ArgCast.cpp
poolalloc/trunk/lib/AssistDS/ArgSimplify.cpp
poolalloc/trunk/lib/AssistDS/CMakeLists.txt
poolalloc/trunk/lib/AssistDS/DSNodeEquivs.cpp
poolalloc/trunk/lib/AssistDS/DataStructureCallGraph.cpp
poolalloc/trunk/lib/AssistDS/Devirt.cpp
poolalloc/trunk/lib/AssistDS/DynCount.cpp
poolalloc/trunk/lib/AssistDS/FuncSpec.cpp
poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp
poolalloc/trunk/lib/AssistDS/IndCloner.cpp
poolalloc/trunk/lib/AssistDS/Int2PtrCmp.cpp
poolalloc/trunk/lib/AssistDS/LoadArgs.cpp
poolalloc/trunk/lib/AssistDS/MergeGEP.cpp
poolalloc/trunk/lib/AssistDS/SVADevirt.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/StructReturnToPointer.cpp
poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
poolalloc/trunk/lib/AssistDS/TypeChecksOpt.cpp
poolalloc/trunk/lib/DSA/AddressTakenAnalysis.cpp
poolalloc/trunk/lib/DSA/AllocatorIdentification.cpp
poolalloc/trunk/lib/DSA/Basic.cpp
poolalloc/trunk/lib/DSA/DSGraph.cpp
poolalloc/trunk/lib/DSA/DSTest.cpp
poolalloc/trunk/lib/DSA/DataStructure.cpp
poolalloc/trunk/lib/DSA/DataStructureStats.cpp
poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp
poolalloc/trunk/lib/DSA/Local.cpp
poolalloc/trunk/lib/DSA/Printer.cpp
poolalloc/trunk/lib/DSA/StdLibPass.cpp
poolalloc/trunk/lib/DSA/TypeSafety.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/PoolOptimize.cpp
poolalloc/trunk/lib/PoolAllocate/RunTimeAssociate.cpp
poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp
poolalloc/trunk/lib/rDSA/EquivClassGraphs.cpp
poolalloc/trunk/lib/rDSA/Local.cpp
poolalloc/trunk/lib/rDSA/StdLibPass.cpp
poolalloc/trunk/lib/rDSA/Steensgaard.cpp
poolalloc/trunk/test/dsa/callgraph/inheritance1.ll
poolalloc/trunk/test/dsa/callgraph/inheritance2.ll
poolalloc/trunk/test/dsa/callgraph/inheritance3.ll
poolalloc/trunk/test/dsa/regression/2010-08-23-InlineCallersSegfault.ll
poolalloc/trunk/test/dsa/regression/2012-09-25.RCForwarding.ll
poolalloc/trunk/test/lit.cfg
poolalloc/trunk/test/lit.site.cfg.in
Modified: poolalloc/trunk/include/assistDS/DataStructureCallGraph.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/DataStructureCallGraph.h?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/DataStructureCallGraph.h (original)
+++ poolalloc/trunk/include/assistDS/DataStructureCallGraph.h Wed Apr 16 12:56:05 2014
@@ -1,108 +0,0 @@
-//===- DataStructureCallGraph.h - Provide a CallGraph using DSA -----------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file declares the DataStructureCallGraph implementation of the
-// CallGraph analysis. Based on llvm/lib/Analysis/IPA/CallGraph.cpp.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _DATA_STRUCTURE_CALLGRAPH_H
-#define _DATA_STRUCTURE_CALLGRAPH_H
-
-#include "dsa/CallTargets.h"
-#include "dsa/DataStructure.h"
-
-#include "llvm/IR/Module.h"
-#include "llvm/Analysis/CallGraph.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/Support/raw_ostream.h"
-
-namespace llvm {
-
-class DataStructureCallGraph : public ModulePass, public CallGraph {
- // Root is root of the call graph, or the external node if a 'main' function
- // couldn't be found.
- CallGraphNode *Root;
-
- // ExternalCallingNode - This node has edges to all external functions and
- // those internal functions that have their address taken.
- CallGraphNode *ExternalCallingNode;
-
- // CallsExternalNode - This node has edges to it from all functions making
- // indirect calls or calling an external function.
- CallGraphNode *CallsExternalNode;
-
- typedef dsa::CallTargetFinder<TDDataStructures> CallTargetFinderTy;
-
-public:
- static char ID;
- DataStructureCallGraph() :
- ModulePass(ID), Root(0), ExternalCallingNode(0), CallsExternalNode(0) { }
-
- virtual bool runOnModule(Module &M);
-
- virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<TDDataStructures>();
- AU.addRequired<CallTargetFinderTy>();
- AU.setPreservesAll();
- }
-
- virtual void print(raw_ostream &OS, const Module *) const {
- OS << "CallGraph Root is: ";
- if (Function *F = getRoot()->getFunction())
- OS << F->getName() << "\n";
- else {
- OS << "<<null function: 0x" << getRoot() << ">>\n";
- }
-
- CallGraph::print(OS, 0);
- }
-
- virtual void releaseMemory() {
- destroy();
- }
-
- // getAdjustedAnalysisPointer - This method is used when a pass implements an
- // analysis interface through multiple inheritance. If needed, it should
- // override this to adjust the this pointer as needed for the specified pass
- // info.
- virtual void *getAdjustedAnalysisPointer(AnalysisID PI) {
- if (PI == &CallGraph::ID)
- return (CallGraph*)this;
- return this;
- }
-
- CallGraphNode* getExternalCallingNode() const { return ExternalCallingNode; }
- CallGraphNode* getCallsExternalNode() const { return CallsExternalNode; }
-
- // getRoot - Return the root of the call graph, which is either main, or if
- // main cannot be found, the external node.
- CallGraphNode *getRoot() { return Root; }
- const CallGraphNode *getRoot() const { return Root; }
-
-private:
- // addToCallGraph - Add a function to the call graph, and link the node to all
- // of the functions that it calls.
- void addToCallGraph(Function *F);
-
- // destroy - Release memory for the call graph
- virtual void destroy() {
- // CallsExternalNode is not in the function map, delete it explicitly.
- if (CallsExternalNode) {
- CallsExternalNode->allReferencesDropped();
- delete CallsExternalNode;
- CallsExternalNode = 0;
- }
- CallGraph::destroy();
- }
-};
-
-}
-
-#endif // _DATA_STRUCTURE_CALLGRAPH_H
Modified: poolalloc/trunk/include/assistDS/Devirt.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/Devirt.h?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/Devirt.h (original)
+++ poolalloc/trunk/include/assistDS/Devirt.h Wed Apr 16 12:56:05 2014
@@ -21,7 +21,7 @@
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/DerivedTypes.h"
-#include "llvm/InstVisitor.h"
+#include "llvm/IR/InstVisitor.h"
#include "llvm/IR/DataLayout.h"
using namespace llvm;
@@ -41,7 +41,7 @@ namespace llvm {
dsa::CallTargetFinder<EQTDDataStructures> *CTF;
// Access to the target data analysis pass
- DataLayout * TD;
+ const DataLayout * TD;
// Worklist of call sites to transform
std::vector<Instruction *> Worklist;
@@ -63,7 +63,7 @@ namespace llvm {
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<dsa::CallTargetFinder<EQTDDataStructures> >();
- AU.addRequired<DataLayout>();
+ AU.addRequired<DataLayoutPass>();
}
// 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=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/Int2PtrCmp.h (original)
+++ poolalloc/trunk/include/assistDS/Int2PtrCmp.h Wed Apr 16 12:56:05 2014
@@ -26,13 +26,13 @@ namespace llvm {
//
class Int2PtrCmp : public ModulePass {
private:
- DataLayout * TD;
+ const DataLayout * TD;
public:
static char ID;
Int2PtrCmp() : ModulePass(ID) {}
virtual bool runOnModule(Module& M);
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<DataLayout>();
+ AU.addRequired<DataLayoutPass>();
}
};
Modified: poolalloc/trunk/include/assistDS/SimplifyGEP.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/SimplifyGEP.h?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/SimplifyGEP.h (original)
+++ poolalloc/trunk/include/assistDS/SimplifyGEP.h Wed Apr 16 12:56:05 2014
@@ -22,13 +22,13 @@ namespace llvm {
//
class SimplifyGEP : public ModulePass {
private:
- DataLayout * TD;
+ const DataLayout * TD;
public:
static char ID;
SimplifyGEP() : ModulePass(ID) {}
virtual bool runOnModule(Module& M);
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<DataLayout>();
+ AU.addRequired<DataLayoutPass>();
}
};
}
Modified: poolalloc/trunk/include/assistDS/TypeChecks.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/assistDS/TypeChecks.h?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/TypeChecks.h (original)
+++ poolalloc/trunk/include/assistDS/TypeChecks.h Wed Apr 16 12:56:05 2014
@@ -20,8 +20,8 @@
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Function.h"
#include "llvm/Pass.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Analysis/Dominators.h"
+#include "llvm/IR/CallSite.h"
+#include "llvm/IR/Dominators.h"
#include "llvm/Analysis/LoopInfo.h"
#include <map>
@@ -49,7 +49,7 @@ private:
std::map<BitCastInst*, Instruction*> BitCast_MD_Map;
// Analysis from other passes.
- DataLayout *TD;
+ const DataLayout *TD;
AddressTakenAnalysis* addrAnalysis;
unsigned int getTypeMarker(Type*);
@@ -100,8 +100,8 @@ public:
virtual void print(raw_ostream &OS, const Module *M) const;
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<DataLayout>();
- AU.addRequired<DominatorTree>();
+ AU.addRequired<DataLayoutPass>();
+ AU.addRequired<DominatorTreeWrapperPass>();
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=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/include/assistDS/TypeChecksOpt.h (original)
+++ poolalloc/trunk/include/assistDS/TypeChecksOpt.h Wed Apr 16 12:56:05 2014
@@ -19,7 +19,7 @@
#include "llvm/Pass.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Instructions.h"
-#include "llvm/Support/CallSite.h"
+#include "llvm/IR/CallSite.h"
#include <list>
Modified: poolalloc/trunk/include/dsa/CallTargets.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/CallTargets.h?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/include/dsa/CallTargets.h (original)
+++ poolalloc/trunk/include/dsa/CallTargets.h Wed Apr 16 12:56:05 2014
@@ -16,7 +16,7 @@
#define LLVM_ANALYSIS_CALLTARGETS_H
#include "llvm/Pass.h"
-#include "llvm/Support/CallSite.h"
+#include "llvm/IR/CallSite.h"
#include "dsa/DataStructure.h"
#include <set>
Modified: poolalloc/trunk/include/dsa/DSCallGraph.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DSCallGraph.h?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/include/dsa/DSCallGraph.h (original)
+++ poolalloc/trunk/include/dsa/DSCallGraph.h Wed Apr 16 12:56:05 2014
@@ -19,7 +19,7 @@
#include <cstddef>
#include "llvm/ADT/EquivalenceClasses.h"
-#include "llvm/Support/CallSite.h"
+#include "llvm/IR/CallSite.h"
#include <cassert>
#include <map>
Modified: poolalloc/trunk/include/dsa/DSSupport.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DSSupport.h?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/include/dsa/DSSupport.h (original)
+++ poolalloc/trunk/include/dsa/DSSupport.h Wed Apr 16 12:56:05 2014
@@ -20,7 +20,7 @@
#include <set>
#include "llvm/ADT/DenseSet.h"
-#include "llvm/Support/CallSite.h"
+#include "llvm/IR/CallSite.h"
namespace llvm {
Modified: poolalloc/trunk/include/dsa/DataStructure.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/dsa/DataStructure.h?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/include/dsa/DataStructure.h (original)
+++ poolalloc/trunk/include/dsa/DataStructure.h Wed Apr 16 12:56:05 2014
@@ -22,7 +22,7 @@
#include "llvm/Pass.h"
#include "llvm/IR/DataLayout.h"
-#include "llvm/Support/CallSite.h"
+#include "llvm/IR/CallSite.h"
#include "llvm/ADT/EquivalenceClasses.h"
#include "llvm/ADT/DenseSet.h"
@@ -45,7 +45,7 @@ class DataStructures : public ModulePass
typedef std::map<const Function*, DSGraph*> DSInfoTy;
/// DataLayout, comes in handy
- DataLayout* TD;
+ const DataLayout* TD;
/// Pass to get Graphs from
DataStructures* GraphSource;
@@ -87,7 +87,7 @@ protected:
std::vector<const Function*> GlobalFunctionList;
void init(DataStructures* D, bool clone, bool useAuxCalls, bool copyGlobalAuxCalls, bool resetAux);
- void init(DataLayout* T);
+ void init(const DataLayout* T);
void formGlobalECs();
@@ -139,7 +139,7 @@ public:
EquivalenceClasses<const GlobalValue*> &getGlobalECs() { return GlobalECs; }
- DataLayout& getDataLayout() const { return *TD; }
+ const DataLayout& getDataLayout() const { return *TD; }
const DSCallGraph& getCallGraph() const { return callgraph; }
@@ -165,7 +165,7 @@ public:
/// getAnalysisUsage - This obviously provides a data structure graph.
///
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<DataLayout>();
+ AU.addRequired<DataLayoutPass>();
AU.setPreservesAll();
}
};
@@ -188,7 +188,7 @@ public:
/// getAnalysisUsage - This obviously provides a data structure graph.
///
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<DataLayout>();
+ AU.addRequired<DataLayoutPass>();
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=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/include/dsa/TypeSafety.h (original)
+++ poolalloc/trunk/include/dsa/TypeSafety.h Wed Apr 16 12:56:05 2014
@@ -49,7 +49,7 @@ struct TypeSafety : public ModulePass {
bool typeFieldsOverlap (const DSNode * N);
// Pointers to prerequisite passes
- DataLayout * TD;
+ const DataLayout * TD;
dsa * dsaPass;
// Data structures
@@ -65,7 +65,7 @@ struct TypeSafety : public ModulePass {
}
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<DataLayout>();
+ AU.addRequired<DataLayoutPass>();
AU.addRequired<dsa>();
AU.setPreservesAll();
}
Modified: poolalloc/trunk/include/poolalloc/PoolAllocate.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/poolalloc/PoolAllocate.h?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/include/poolalloc/PoolAllocate.h (original)
+++ poolalloc/trunk/include/poolalloc/PoolAllocate.h Wed Apr 16 12:56:05 2014
@@ -22,7 +22,7 @@
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Instructions.h"
#include "llvm/Pass.h"
-#include "llvm/Support/CallSite.h"
+#include "llvm/IR/CallSite.h"
#include "llvm/ADT/EquivalenceClasses.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
@@ -536,7 +536,7 @@ public:
bool runOnModule(Module &M);
GlobalVariable *CreateGlobalPool(unsigned RecSize, unsigned Align,
Module& M);
- void ProcessFunctionBodySimple(Function& F, DataLayout & TD);
+ void ProcessFunctionBodySimple(Function& F, const DataLayout & TD);
virtual DSGraph* getDSGraph (const Function & F) const {
@@ -568,7 +568,7 @@ public:
// FIXME: Is this used? Should it be removed?
class PoolAllocateMultipleGlobalPool : public PoolAllocate {
- void ProcessFunctionBodySimple(Function& F, DataLayout & TD);
+ void ProcessFunctionBodySimple(Function& F, const 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/poolalloc/RunTimeAssociate.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/poolalloc/RunTimeAssociate.h?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/include/poolalloc/RunTimeAssociate.h (original)
+++ poolalloc/trunk/include/poolalloc/RunTimeAssociate.h Wed Apr 16 12:56:05 2014
@@ -21,7 +21,7 @@
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Instructions.h"
#include "llvm/Pass.h"
-#include "llvm/Support/CallSite.h"
+#include "llvm/IR/CallSite.h"
#include "llvm/ADT/EquivalenceClasses.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/Support/CommandLine.h"
Modified: poolalloc/trunk/include/rdsa/CallTargets.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/rdsa/CallTargets.h?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/include/rdsa/CallTargets.h (original)
+++ poolalloc/trunk/include/rdsa/CallTargets.h Wed Apr 16 12:56:05 2014
@@ -16,7 +16,7 @@
#define LLVM_ANALYSIS_CALLTARGETS_H
#include "llvm/Pass.h"
-#include "llvm/Support/CallSite.h"
+#include "llvm/IR/CallSite.h"
#include <set>
#include <list>
Modified: poolalloc/trunk/include/rdsa/DSSupport.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/rdsa/DSSupport.h?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/include/rdsa/DSSupport.h (original)
+++ poolalloc/trunk/include/rdsa/DSSupport.h Wed Apr 16 12:56:05 2014
@@ -15,7 +15,7 @@
#define LLVM_ANALYSIS_DSSUPPORT_H
#include <functional>
-#include "llvm/Support/CallSite.h"
+#include "llvm/IR/CallSite.h"
#include "poolalloc/ADT/HashExtras.h"
namespace llvm {
Modified: poolalloc/trunk/include/rdsa/DataStructure.h
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/include/rdsa/DataStructure.h?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/include/rdsa/DataStructure.h (original)
+++ poolalloc/trunk/include/rdsa/DataStructure.h Wed Apr 16 12:56:05 2014
@@ -16,7 +16,7 @@
#include "llvm/Pass.h"
#include "llvm/DataLayout.h"
-#include "llvm/Support/CallSite.h"
+#include "llvm/IR/CallSite.h"
#include "llvm/ADT/EquivalenceClasses.h"
#include "poolalloc/ADT/HashExtras.h"
@@ -203,7 +203,7 @@ public:
/// getAnalysisUsage - This obviously provides a data structure graph.
///
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<DataLayout>();
+ AU.addRequired<DataLayoutPass>();
AU.setPreservesAll();
}
};
@@ -427,7 +427,7 @@ public:
virtual void releaseMemory();
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<DataLayout>();
+ AU.addRequired<DataLayoutPass>();
AU.addRequired<StdLibDataStructures>();
AU.setPreservesAll();
}
Modified: poolalloc/trunk/lib/AssistDS/ArgCast.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/ArgCast.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/ArgCast.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/ArgCast.cpp Wed Apr 16 12:56:05 2014
@@ -56,7 +56,7 @@ bool ArgCast::runOnModule(Module& M) {
if (I->mayBeOverridden())
continue;
// Find all uses of this function
- for(Value::use_iterator ui = I->use_begin(), ue = I->use_end(); ui != ue; ) {
+ for(Value::user_iterator ui = I->user_begin(), ue = I->user_end(); ui != ue; ) {
// check if is ever casted to a different function type
ConstantExpr *CE = dyn_cast<ConstantExpr>(*ui++);
if(!CE)
@@ -78,8 +78,8 @@ bool ArgCast::runOnModule(Module& M) {
if(FTy->getNumParams() != I->arg_size() && !FTy->isVarArg())
continue;
- for(Value::use_iterator uii = CE->use_begin(),
- uee = CE->use_end(); uii != uee; ++uii) {
+ for(Value::user_iterator uii = CE->user_begin(),
+ uee = CE->user_end(); uii != uee; ++uii) {
// Find all uses of the casted value, and check if it is
// used in a Call Instruction
if (CallInst* CI = dyn_cast<CallInst>(*uii)) {
Modified: poolalloc/trunk/lib/AssistDS/ArgSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/ArgSimplify.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/ArgSimplify.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/ArgSimplify.cpp Wed Apr 16 12:56:05 2014
@@ -34,14 +34,14 @@ namespace {
static void simplify(Function *F, unsigned arg_count, Type* type) {
// Go through all uses of the function
- for(Value::use_iterator ui = F->use_begin(), ue = F->use_end();
+ for(Value::user_iterator ui = F->user_begin(), ue = F->user_end();
ui != ue; ++ui) {
if (Constant *C = dyn_cast<Constant>(*ui)) {
if (ConstantExpr *CE = dyn_cast<ConstantExpr>(C)) {
if (CE->getOpcode() == Instruction::BitCast) {
if(CE->getOperand(0) == F) {
- for(Value::use_iterator uii = CE->use_begin(), uee = CE->use_end();
+ for(Value::user_iterator uii = CE->user_begin(), uee = CE->user_end();
uii != uee; ) {
// check if it is ever used as a call (bitcast F to ...)()
if (CallInst* CI = dyn_cast<CallInst>(*uii++)) {
@@ -150,7 +150,7 @@ namespace {
for (Function::arg_iterator ii = I->arg_begin(), ee = I->arg_end();
ii != ee; ++ii) {
bool change = true;
- for(Value::use_iterator ui = ii->use_begin(), ue = ii->use_end();
+ for(Value::user_iterator ui = ii->user_begin(), ue = ii->user_end();
ui != ue; ++ui) {
// check if the argument is used exclusively in ICmp Instructions
if(!isa<ICmpInst>(*ui)){
Modified: poolalloc/trunk/lib/AssistDS/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/CMakeLists.txt?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/CMakeLists.txt (original)
+++ poolalloc/trunk/lib/AssistDS/CMakeLists.txt Wed Apr 16 12:56:05 2014
@@ -2,7 +2,6 @@ set(SOURCES
ArgCast.cpp
ArgSimplify.cpp
DSNodeEquivs.cpp
- DataStructureCallGraph.cpp
Devirt.cpp
DynCount.cpp
FuncSimplify.cpp
Modified: poolalloc/trunk/lib/AssistDS/DSNodeEquivs.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/DSNodeEquivs.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/DSNodeEquivs.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/DSNodeEquivs.cpp Wed Apr 16 12:56:05 2014
@@ -16,7 +16,7 @@
#include "llvm/IR/Constants.h"
#include "llvm/IR/Module.h"
-#include "llvm/Support/InstIterator.h"
+#include "llvm/IR/InstIterator.h"
#include "llvm/ADT/SmallSet.h"
#include <deque>
@@ -245,7 +245,7 @@ const DSNode *DSNodeEquivs::getMemberFor
std::deque<const User *> WL;
SmallSet<const User *, 8> Visited;
- WL.insert(WL.end(), V->use_begin(), V->use_end());
+ WL.insert(WL.end(), V->user_begin(), V->user_end());
do {
const User *TheUser = WL.front();
WL.pop_front();
@@ -271,7 +271,7 @@ const DSNode *DSNodeEquivs::getMemberFor
//
// If this use is of some other nature, look at the users of this use.
//
- WL.insert(WL.end(), TheUser->use_begin(), TheUser->use_end());
+ WL.insert(WL.end(), TheUser->user_begin(), TheUser->user_end());
}
} while (!WL.empty());
}
Modified: poolalloc/trunk/lib/AssistDS/DataStructureCallGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/DataStructureCallGraph.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/DataStructureCallGraph.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/DataStructureCallGraph.cpp Wed Apr 16 12:56:05 2014
@@ -1,127 +0,0 @@
-//===- DataStructureCallGraph.cpp - Provide a CallGraph using DSA ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the DataStructureCallGraph implementation of the
-// CallGraph analysis. Based on llvm/lib/Analysis/IPA/CallGraph.cpp.
-//
-//===----------------------------------------------------------------------===//
-
-#include "assistDS/DataStructureCallGraph.h"
-#include "dsa/DSGraph.h"
-#include "dsa/DSNode.h"
-
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/IR/Instructions.h"
-#include "llvm/IR/IntrinsicInst.h"
-#include "llvm/Support/CallSite.h"
-#include "llvm/Support/InstIterator.h"
-
-using namespace llvm;
-
-char DataStructureCallGraph::ID;
-
-namespace {
-
-static RegisterPass<DataStructureCallGraph>
-X("dsa-cg", "DSA-based CallGraph implementation");
-
-RegisterAnalysisGroup<CallGraph> Y(X);
-
-}
-
-bool DataStructureCallGraph::runOnModule(Module &M) {
- CallGraph::initialize(M);
-
- ExternalCallingNode = getOrInsertFunction(0);
- CallsExternalNode = new CallGraphNode(0);
- Root = 0;
-
- // Add every function to the call graph.
- for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
- addToCallGraph(I);
-
- // If we didn't find a main function, use the external call graph node
- if (Root == 0) Root = ExternalCallingNode;
-
- return false;
-}
-
-// Add a function to the call graph, and link the node to all of the functions
-// that it calls.
-void DataStructureCallGraph::addToCallGraph(Function *F) {
- CallGraphNode *Node = getOrInsertFunction(F);
-
- if (!F->hasLocalLinkage()) {
- ExternalCallingNode->addCalledFunction(CallSite(), Node);
-
- // Found the entry point?
- if (F->getName() == "main") {
- if (Root) // Found multiple external mains? Don't pick one.
- Root = ExternalCallingNode;
- else
- 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->isDeclaration() && !F->isIntrinsic()) {
- Node->addCalledFunction(CallSite(), CallsExternalNode);
- return;
- }
-
- TDDataStructures &DS = getAnalysis<TDDataStructures>();
- DSGraph &GG = *DS.getGlobalsGraph();
- CallTargetFinderTy &CTF = getAnalysis<CallTargetFinderTy>();
-
- // Determine if the function can be called by external code by looking up
- // its DSNode in the globals graph. A node marked External, Unknown, or
- // Incomplete has the possibility of being called from external code.
- DSNode *N = GG.getNodeForValue(F).getNode();
-
- if (N &&
- (N->isExternalNode() ||
- N->isUnknownNode() ||
- N->isIncompleteNode())) {
- ExternalCallingNode->addCalledFunction(CallSite(), Node);
- }
-
- // Go over the instructions in the function and determine the call targets
- // for each call site.
- for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) {
- CallSite CS(&*I);
-
- // Only look through valid call sites that are not calls to intrinsics.
- if (!CS || isa<IntrinsicInst>(&*I))
- continue;
-
- if (const Function *F =
- dyn_cast<Function>(CS.getCalledValue()->stripPointerCasts())) {
- // Direct call: Don't use DSA, just add the function we discovered as
- // the call target.
-
- Node->addCalledFunction(CS, getOrInsertFunction(F));
- } else {
- // Indirect call: Use CallTargetFinder to determine the set of targets to
- // the indirect call site. Be conservative about incomplete call sites.
-
- if (!CTF.isComplete(CS)) {
- // Add CallsExternalNode as a target of incomplete call sites.
- Node->addCalledFunction(CS, CallsExternalNode);
- }
-
- SmallPtrSet<const Function *, 16> Targets(CTF.begin(CS), CTF.end(CS));
-
- for (SmallPtrSet<const Function *, 16>::const_iterator
- TI = Targets.begin(), TE = Targets.end(); TI != TE; ++TI) {
- Node->addCalledFunction(CS, getOrInsertFunction(*TI));
- }
- }
- }
-}
Modified: poolalloc/trunk/lib/AssistDS/Devirt.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/Devirt.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/Devirt.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/Devirt.cpp Wed Apr 16 12:56:05 2014
@@ -399,7 +399,7 @@ Devirtualize::runOnModule (Module & M) {
// Get information on the target system.
//
//
- TD = &getAnalysis<DataLayout>();
+ TD = &getAnalysis<DataLayoutPass>().getDataLayout();
// 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=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/DynCount.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/DynCount.cpp Wed Apr 16 12:56:05 2014
@@ -34,7 +34,7 @@ public:
}
virtual bool runOnModule (Module & M);
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<DataLayout>();
+ AU.addRequired<DataLayoutPass>();
AU.addRequired<dsa::TypeSafety<TDDataStructures> >();
}
};
Modified: poolalloc/trunk/lib/AssistDS/FuncSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/FuncSpec.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/FuncSpec.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/FuncSpec.cpp Wed Apr 16 12:56:05 2014
@@ -69,7 +69,7 @@ bool FuncSpec::runOnModule(Module& M) {
}
}
// Now find all call sites that it is called from
- for(Value::use_iterator ui = I->use_begin(), ue = I->use_end();
+ for(Value::user_iterator ui = I->user_begin(), ue = I->user_end();
ui != ue; ++ui) {
if (CallInst* CI = dyn_cast<CallInst>(*ui)) {
// Check that it is the called value (and not an argument)
Modified: poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/GEPExprArgs.cpp Wed Apr 16 12:56:05 2014
@@ -16,10 +16,10 @@
#include "llvm/IR/Constants.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/Use.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
+#include "llvm/IR/GetElementPtrTypeIterator.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/ValueMap.h"
+#include "llvm/IR/ValueMap.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/Debug.h"
#include <vector>
Modified: poolalloc/trunk/lib/AssistDS/IndCloner.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/IndCloner.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/IndCloner.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/IndCloner.cpp Wed Apr 16 12:56:05 2014
@@ -71,7 +71,7 @@ IndClone::runOnModule(Module& M) {
// function by the linker.
//
if (!I->isDeclaration() && !I->mayBeOverridden()) {
- for (Value::use_iterator ui = I->use_begin(), ue = I->use_end();
+ for (Value::user_iterator ui = I->user_begin(), ue = I->user_end();
ui != ue; ++ui) {
if (!isa<CallInst>(*ui) && !isa<InvokeInst>(*ui)) {
if(!ui->use_empty())
@@ -146,8 +146,8 @@ IndClone::runOnModule(Module& M) {
// Find all uses of the function that use it as a direct call. Change
// them to use the clone.
//
- for (Value::use_iterator ui = Original->use_begin(),
- ue = Original->use_end();
+ for (Value::user_iterator ui = Original->user_begin(),
+ ue = Original->user_end();
ui != ue; ) {
CallInst *CI = dyn_cast<CallInst>(*ui);
ui++;
Modified: poolalloc/trunk/lib/AssistDS/Int2PtrCmp.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/Int2PtrCmp.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/Int2PtrCmp.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/Int2PtrCmp.cpp Wed Apr 16 12:56:05 2014
@@ -18,7 +18,7 @@
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/Debug.h"
-#include "llvm/Support/PatternMatch.h"
+#include "llvm/IR/PatternMatch.h"
#include <set>
#include <map>
@@ -45,7 +45,7 @@ using namespace PatternMatch;
// false - The module was not modified.
//
bool Int2PtrCmp::runOnModule(Module& M) {
- TD = &getAnalysis<DataLayout>();
+ TD = &getAnalysis<DataLayoutPass>().getDataLayout();
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/LoadArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/LoadArgs.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/LoadArgs.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/LoadArgs.cpp Wed Apr 16 12:56:05 2014
@@ -17,10 +17,10 @@
#include "assistDS/LoadArgs.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Use.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
+#include "llvm/IR/GetElementPtrTypeIterator.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/ValueMap.h"
+#include "llvm/IR/ValueMap.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/Debug.h"
#include <vector>
Modified: poolalloc/trunk/lib/AssistDS/MergeGEP.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/MergeGEP.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/MergeGEP.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/MergeGEP.cpp Wed Apr 16 12:56:05 2014
@@ -18,7 +18,7 @@
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/Module.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
+#include "llvm/IR/GetElementPtrTypeIterator.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/FormattedStream.h"
Modified: poolalloc/trunk/lib/AssistDS/SVADevirt.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/SVADevirt.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/SVADevirt.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/SVADevirt.cpp Wed Apr 16 12:56:05 2014
@@ -176,7 +176,7 @@ namespace {
std::set<Value*> safecalls;
std::vector<Instruction*> toDelete;
- for (Value::use_iterator ii = ams->use_begin(), ee = ams->use_end();
+ for (Value::user_iterator ii = ams->user_begin(), ee = ams->user_end();
ii != ee; ++ii) {
if (CallInst* CI = dyn_cast<CallInst>(*ii)) {
std::cerr << "Found safe call site in "
@@ -195,7 +195,7 @@ namespace {
for(std::set<Value*>::iterator i = safecalls.begin(), e = safecalls.end();
i != e; ++i) {
- for (Value::use_iterator uii = (*i)->use_begin(), uie = (*i)->use_end();
+ for (Value::user_iterator uii = (*i)->user_begin(), uie = (*i)->user_end();
uii != uie; ++uii) {
CallSite cs = CallSite::get(*uii);
bool isSafeCall = cs.getInstruction() &&
Modified: poolalloc/trunk/lib/AssistDS/SimplifyExtractValue.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/SimplifyExtractValue.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/SimplifyExtractValue.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/SimplifyExtractValue.cpp Wed Apr 16 12:56:05 2014
@@ -20,7 +20,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/Debug.h"
-#include "llvm/Support/PatternMatch.h"
+#include "llvm/IR/PatternMatch.h"
#include "llvm/IR/DataLayout.h"
#include <set>
Modified: poolalloc/trunk/lib/AssistDS/SimplifyGEP.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/SimplifyGEP.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/SimplifyGEP.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/SimplifyGEP.cpp Wed Apr 16 12:56:05 2014
@@ -15,7 +15,7 @@
#define DEBUG_TYPE "simplify-gep"
#include "assistDS/SimplifyGEP.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
+#include "llvm/IR/GetElementPtrTypeIterator.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/Debug.h"
#include "llvm/IR/Constants.h"
@@ -75,7 +75,7 @@ static void preprocess(Module& M) {
// false - The module was not modified.
//
bool SimplifyGEP::runOnModule(Module& M) {
- TD = &getAnalysis<DataLayout>();
+ TD = &getAnalysis<DataLayoutPass>().getDataLayout();
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=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/SimplifyInsertValue.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/SimplifyInsertValue.cpp Wed Apr 16 12:56:05 2014
@@ -18,7 +18,7 @@
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/Debug.h"
-#include "llvm/Support/PatternMatch.h"
+#include "llvm/IR/PatternMatch.h"
#include "llvm/IR/DataLayout.h"
#include <set>
@@ -63,7 +63,7 @@ bool SimplifyIV::runOnModule(Module& M)
if(!IV->hasOneUse())
continue;
// Check that its only use is a StoreInst
- StoreInst *SI = dyn_cast<StoreInst>(*(IV->use_begin()));
+ StoreInst *SI = dyn_cast<StoreInst>(*(IV->user_begin()));
if(!SI)
continue;
// Check that it is the stored value
Modified: poolalloc/trunk/lib/AssistDS/SimplifyLoad.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/SimplifyLoad.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/SimplifyLoad.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/SimplifyLoad.cpp Wed Apr 16 12:56:05 2014
@@ -16,7 +16,7 @@
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/Debug.h"
-#include "llvm/Support/PatternMatch.h"
+#include "llvm/IR/PatternMatch.h"
#include "llvm/IR/DataLayout.h"
#include <set>
@@ -57,7 +57,7 @@ bool SimplifyLoad::runOnModule(Module& M
if(!LI)
continue;
if(LI->hasOneUse()) {
- if(CastInst *CI = dyn_cast<CastInst>(*(LI->use_begin()))) {
+ if(CastInst *CI = dyn_cast<CastInst>(*(LI->user_begin()))) {
if(LI->getType()->isPointerTy()) {
if(ConstantExpr *CE = dyn_cast<ConstantExpr>(LI->getOperand(0))) {
if(const PointerType *PTy = dyn_cast<PointerType>(CE->getOperand(0)->getType()))
Modified: poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/StructReturnToPointer.cpp Wed Apr 16 12:56:05 2014
@@ -17,7 +17,7 @@
#include "llvm/IR/Attributes.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/ValueMap.h"
+#include "llvm/IR/ValueMap.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/Debug.h"
@@ -108,7 +108,7 @@ bool StructRet::runOnModule(Module& M) {
}
}
- for(Value::use_iterator ui = F->use_begin(), ue = F->use_end();
+ for(Value::user_iterator ui = F->user_begin(), ue = F->user_end();
ui != ue; ) {
CallInst *CI = dyn_cast<CallInst>(*ui++);
if(!CI)
Modified: poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/TypeChecks.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/TypeChecks.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/TypeChecks.cpp Wed Apr 16 12:56:05 2014
@@ -16,9 +16,8 @@
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Module.h"
-#include "llvm/Assembly/Writer.h"
#include "llvm/Support/Debug.h"
-#include "llvm/Support/InstIterator.h"
+#include "llvm/IR/InstIterator.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/Support/CommandLine.h"
@@ -152,7 +151,7 @@ bool TypeChecks::runOnModule(Module &M)
bool modified = false; // Flags whether we modified the module.
bool transformIndirectCalls = true;
- TD = &getAnalysis<DataLayout>();
+ TD = &getAnalysis<DataLayoutPass>().getDataLayout();
addrAnalysis = &getAnalysis<AddressTakenAnalysis>();
// Create the necessary prototypes
@@ -257,7 +256,7 @@ bool TypeChecks::runOnModule(Module &M)
Function &F = *MI;
if(F.isDeclaration())
continue;
- DominatorTree & DT = getAnalysis<DominatorTree>(F);
+ DominatorTree & DT = getAnalysis<DominatorTreeWrapperPass>(F).getDomTree();
std::deque<DomTreeNode *> Worklist;
Worklist.push_back (DT.getRootNode());
while(Worklist.size()) {
@@ -321,8 +320,8 @@ bool TypeChecks::runOnModule(Module &M)
Constant *CNew = ConstantExpr::getBitCast(FI->second, F->getType());
std::set<User *> toReplace;
- for(Function::use_iterator User = F->use_begin();
- User != F->use_end();++User) {
+ for(Function::user_iterator User = F->user_begin();
+ User != F->user_end();++User) {
toReplace.insert(*User);
}
for(std::set<llvm::User *>::iterator userI = toReplace.begin(); userI != toReplace.end(); ++userI) {
@@ -330,8 +329,8 @@ bool TypeChecks::runOnModule(Module &M)
if(Constant *C = dyn_cast<Constant>(user)) {
if(!isa<GlobalValue>(C)) {
bool changeUse = true;
- for(Value::use_iterator II = user->use_begin();
- II != user->use_end(); II++) {
+ for(Value::user_iterator II = user->user_begin();
+ II != user->user_end(); II++) {
if(CallInst *CI = dyn_cast<CallInst>(*II))
if(CI->getCalledFunction()) {
if(CI->getCalledFunction()->isDeclaration())
@@ -506,7 +505,7 @@ void TypeChecks::optimizeChecks(Module &
Function &F = *MI;
if(F.isDeclaration())
continue;
- DominatorTree & DT = getAnalysis<DominatorTree>(F);
+ DominatorTree & DT = getAnalysis<DominatorTreeWrapperPass>(F).getDomTree();
std::deque<DomTreeNode *> Worklist;
Worklist.push_back (DT.getRootNode());
while(Worklist.size()) {
@@ -520,7 +519,7 @@ void TypeChecks::optimizeChecks(Module &
if(CI->getCalledFunction() != checkTypeInst)
continue;
std::list<Instruction *>toDelete;
- for(Value::use_iterator User = CI->getOperand(3)->use_begin(); User != CI->getOperand(3)->use_end(); ++User) {
+ for(Value::user_iterator User = CI->getOperand(3)->user_begin(); User != CI->getOperand(3)->user_end(); ++User) {
CallInst *CI2 = dyn_cast<CallInst>(*User);
if(!CI2)
continue;
@@ -550,7 +549,7 @@ void TypeChecks::optimizeChecks(Module &
Function &F = *MI;
if(F.isDeclaration())
continue;
- DominatorTree & DT = getAnalysis<DominatorTree>(F);
+ DominatorTree & DT = getAnalysis<DominatorTreeWrapperPass>(F).getDomTree();
LoopInfo & LI = getAnalysis<LoopInfo>(F);
std::deque<DomTreeNode *> Worklist;
Worklist.push_back (DT.getRootNode());
@@ -697,7 +696,7 @@ bool TypeChecks::visitAddressTakenFuncti
std::vector<Instruction *>toDelete;
// Find all uses of the function
- for(Value::use_iterator ui = F.use_begin(), ue = F.use_end();
+ for(Value::user_iterator ui = F.user_begin(), ue = F.user_end();
ui != ue;++ui) {
if(InvokeInst *II = dyn_cast<InvokeInst>(*ui)) {
if(II->getCalledValue()->stripPointerCasts() != &F)
@@ -927,7 +926,7 @@ bool TypeChecks::visitInternalVarArgFunc
std::vector<Instruction *>toDelete;
// Find all uses of the function
- for(Value::use_iterator ui = F.use_begin(), ue = F.use_end();
+ for(Value::user_iterator ui = F.user_begin(), ue = F.user_end();
ui != ue;ui ++) {
// Check for call sites
@@ -1051,7 +1050,7 @@ bool TypeChecks::visitInternalByValFunct
// Update the call sites
std::vector<Instruction *>toDelete;
- for(Value::use_iterator ui = F.use_begin(), ue = F.use_end();
+ for(Value::user_iterator ui = F.user_begin(), ue = F.user_end();
ui != ue; ui++) {
// Check that F is the called value
if(InvokeInst *II = dyn_cast<InvokeInst>(*ui)) {
@@ -2124,7 +2123,7 @@ bool TypeChecks::visitLoadInst(Module &M
// BCI - ptr
// I - instruction whose uses to instrument
bool TypeChecks::visitUses(Instruction *I, Instruction *AI, Value *BCI) {
- for(Value::use_iterator II = I->use_begin(); II != I->use_end(); ++II) {
+ for(Value::user_iterator II = I->user_begin(); II != I->user_end(); ++II) {
if(DisablePtrCmpChecks) {
if(isa<CmpInst>(*II)) {
if(I->getType()->isPointerTy())
Modified: poolalloc/trunk/lib/AssistDS/TypeChecksOpt.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/TypeChecksOpt.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/TypeChecksOpt.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/TypeChecksOpt.cpp Wed Apr 16 12:56:05 2014
@@ -16,9 +16,8 @@
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Module.h"
-#include "llvm/Assembly/Writer.h"
#include "llvm/Support/Debug.h"
-#include "llvm/Support/InstIterator.h"
+#include "llvm/IR/InstIterator.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/Support/CommandLine.h"
@@ -136,7 +135,7 @@ bool TypeChecksOpt::runOnModule(Module &
NULL);
MallocFunc = M.getFunction("malloc");
- for(Value::use_iterator User = trackGlobal->use_begin(); User != trackGlobal->use_end(); ++User) {
+ for(Value::user_iterator User = trackGlobal->user_begin(); User != trackGlobal->user_end(); ++User) {
CallInst *CI = dyn_cast<CallInst>(*User);
assert(CI);
if(TS->isTypeSafe(CI->getOperand(1)->stripPointerCasts(), CI->getParent()->getParent())) {
@@ -149,7 +148,7 @@ bool TypeChecksOpt::runOnModule(Module &
}
}
- for(Value::use_iterator User = checkTypeInst->use_begin(); User != checkTypeInst->use_end(); ++User) {
+ for(Value::user_iterator User = checkTypeInst->user_begin(); User != checkTypeInst->user_end(); ++User) {
CallInst *CI = dyn_cast<CallInst>(*User);
assert(CI);
@@ -158,7 +157,7 @@ bool TypeChecksOpt::runOnModule(Module &
}
}
- for(Value::use_iterator User = trackStoreInst->use_begin(); User != trackStoreInst->use_end(); ++User) {
+ for(Value::user_iterator User = trackStoreInst->user_begin(); User != trackStoreInst->user_end(); ++User) {
CallInst *CI = dyn_cast<CallInst>(*User);
assert(CI);
@@ -169,7 +168,7 @@ bool TypeChecksOpt::runOnModule(Module &
// for alloca's if they are type known
// assume initialized with TOP
- for(Value::use_iterator User = trackUnInitInst->use_begin(); User != trackUnInitInst->use_end(); ) {
+ for(Value::user_iterator User = trackUnInitInst->user_begin(); User != trackUnInitInst->user_end(); ) {
CallInst *CI = dyn_cast<CallInst>(*(User++));
assert(CI);
@@ -190,7 +189,7 @@ bool TypeChecksOpt::runOnModule(Module &
}
if(MallocFunc) {
- for(Value::use_iterator User = MallocFunc->use_begin(); User != MallocFunc->use_end(); User ++) {
+ for(Value::user_iterator User = MallocFunc->user_begin(); User != MallocFunc->user_end(); User ++) {
CallInst *CI = dyn_cast<CallInst>(*User);
if(!CI)
continue;
@@ -212,7 +211,7 @@ bool TypeChecksOpt::runOnModule(Module &
// also do for mallocs/calloc/other allocators???
// other allocators??
- for(Value::use_iterator User = copyTypeInfo->use_begin(); User != copyTypeInfo->use_end(); ++User) {
+ for(Value::user_iterator User = copyTypeInfo->user_begin(); User != copyTypeInfo->user_end(); ++User) {
CallInst *CI = dyn_cast<CallInst>(*User);
assert(CI);
@@ -225,7 +224,7 @@ bool TypeChecksOpt::runOnModule(Module &
toDelete.push_back(CI);
}
}
- for(Value::use_iterator User = setTypeInfo->use_begin(); User != setTypeInfo->use_end(); ++User) {
+ for(Value::user_iterator User = setTypeInfo->user_begin(); User != setTypeInfo->user_end(); ++User) {
CallInst *CI = dyn_cast<CallInst>(*User);
assert(CI);
@@ -239,7 +238,7 @@ bool TypeChecksOpt::runOnModule(Module &
}
}
- for(Value::use_iterator User = getTypeTag->use_begin(); User != getTypeTag->use_end(); ++User) {
+ for(Value::user_iterator User = getTypeTag->user_begin(); User != getTypeTag->user_end(); ++User) {
CallInst *CI = dyn_cast<CallInst>(*User);
assert(CI);
if(TS->isTypeSafe(CI->getOperand(1)->stripPointerCasts(), CI->getParent()->getParent())) {
Modified: poolalloc/trunk/lib/DSA/AddressTakenAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/AddressTakenAnalysis.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/AddressTakenAnalysis.cpp (original)
+++ poolalloc/trunk/lib/DSA/AddressTakenAnalysis.cpp Wed Apr 16 12:56:05 2014
@@ -15,6 +15,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Pass.h"
+#include "llvm/IR/CallSite.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Function.h"
@@ -22,7 +23,6 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/Debug.h"
-#include "llvm/Support/CallSite.h"
#include <fstream>
#include <set>
@@ -36,7 +36,7 @@ AddressTakenAnalysis::~AddressTakenAnaly
static bool isAddressTaken(Value* V) {
for (Value::use_iterator I = V->use_begin(), E = V->use_end(); I != E; ++I) {
- User *U = *I;
+ User *U = I->getUser();
if(isa<StoreInst>(U))
return true;
if (!isa<CallInst>(U) && !isa<InvokeInst>(U)) {
@@ -60,7 +60,7 @@ static bool isAddressTaken(Value* V) {
// are never used
} else {
llvm::CallSite CS(cast<Instruction>(U));
- if (!CS.isCallee(I))
+ if (!CS.isCallee(&(*I)))
return true;
}
}
Modified: poolalloc/trunk/lib/DSA/AllocatorIdentification.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/AllocatorIdentification.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/AllocatorIdentification.cpp (original)
+++ poolalloc/trunk/lib/DSA/AllocatorIdentification.cpp Wed Apr 16 12:56:05 2014
@@ -62,7 +62,7 @@ bool AllocIdentify::flowsFrom(Value *Des
bool isNotStored(Value *V) {
// check that V is not stored to a location that is accessible outside this fn
- for(Value::use_iterator ui = V->use_begin(), ue = V->use_end();
+ for(Value::user_iterator ui = V->user_begin(), ue = V->user_end();
ui != ue; ++ui) {
if(isa<StoreInst>(*ui))
return false;
@@ -110,7 +110,7 @@ bool AllocIdentify::runOnModule(Module&
Function* F = M.getFunction(*it);
if(!F)
continue;
- for(Value::use_iterator ui = F->use_begin(), ue = F->use_end();
+ for(Value::user_iterator ui = F->user_begin(), ue = F->user_end();
ui != ue; ++ui) {
// iterate though all calls to malloc
if (CallInst* CI = dyn_cast<CallInst>(*ui)) {
@@ -162,7 +162,7 @@ bool AllocIdentify::runOnModule(Module&
if(!F)
continue;
- for(Value::use_iterator ui = F->use_begin(), ue = F->use_end();
+ for(Value::user_iterator ui = F->user_begin(), ue = F->user_end();
ui != ue; ++ui) {
// iterate though all calls to malloc
if (CallInst* CI = dyn_cast<CallInst>(*ui)) {
Modified: poolalloc/trunk/lib/DSA/Basic.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Basic.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Basic.cpp (original)
+++ poolalloc/trunk/lib/DSA/Basic.cpp Wed Apr 16 12:56:05 2014
@@ -15,15 +15,15 @@
#include "dsa/DataStructure.h"
#include "dsa/DSGraph.h"
-#include "llvm/InstVisitor.h"
+#include "llvm/IR/InstVisitor.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/TypeBuilder.h"
-#include "llvm/Support/InstIterator.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
+#include "llvm/IR/InstIterator.h"
+#include "llvm/IR/GetElementPtrTypeIterator.h"
using namespace llvm;
@@ -33,7 +33,7 @@ X("dsa-basic", "Basic Data Structure Ana
char BasicDataStructures::ID = 0;
bool BasicDataStructures::runOnModule(Module &M) {
- init(&getAnalysis<DataLayout>());
+ init(&getAnalysis<DataLayoutPass>().getDataLayout());
//
// Create a void pointer type. This is simply a pointer to an 8 bit value.
Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSGraph.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DSGraph.cpp (original)
+++ poolalloc/trunk/lib/DSA/DSGraph.cpp Wed Apr 16 12:56:05 2014
@@ -23,7 +23,6 @@
#include "llvm/IR/Instructions.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/DataLayout.h"
-#include "llvm/Assembly/Writer.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/ADT/DepthFirstIterator.h"
Modified: poolalloc/trunk/lib/DSA/DSTest.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSTest.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DSTest.cpp (original)
+++ poolalloc/trunk/lib/DSA/DSTest.cpp Wed Apr 16 12:56:05 2014
@@ -45,7 +45,6 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/IR/ValueSymbolTable.h"
-#include "llvm/Assembly/Writer.h"
using namespace llvm;
namespace {
Modified: poolalloc/trunk/lib/DSA/DataStructure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DataStructure.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DataStructure.cpp (original)
+++ poolalloc/trunk/lib/DSA/DataStructure.cpp Wed Apr 16 12:56:05 2014
@@ -22,7 +22,6 @@
#include "llvm/IR/Instructions.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/DataLayout.h"
-#include "llvm/Assembly/Writer.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/ADT/DepthFirstIterator.h"
@@ -1496,7 +1495,7 @@ void DataStructures::init(DataStructures
if (!clone) D->DSGraphsStolen = true;
}
-void DataStructures::init(DataLayout* T) {
+void DataStructures::init(const 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=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DataStructureStats.cpp (original)
+++ poolalloc/trunk/lib/DSA/DataStructureStats.cpp Wed Apr 16 12:56:05 2014
@@ -18,7 +18,7 @@
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Instructions.h"
-#include "llvm/InstVisitor.h"
+#include "llvm/IR/InstVisitor.h"
#include "llvm/Pass.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Support/Debug.h"
@@ -80,7 +80,7 @@ namespace {
void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
AU.addRequired<TDDataStructures>();
- AU.addRequired<DataLayout>();
+ AU.addRequired<DataLayoutPass>();
AU.addRequired<dsa::TypeSafety<TDDataStructures> >();
}
@@ -236,7 +236,7 @@ void DSGraphStats::visitStore(StoreInst
bool DSGraphStats::runOnFunction(Function& F) {
DS = &getAnalysis<TDDataStructures>();
- TD = &getAnalysis<DataLayout>();
+ TD = &getAnalysis<DataLayoutPass>().getDataLayout();
TS = &getAnalysis<dsa::TypeSafety<TDDataStructures> >();
TDGraph = DS->getDSGraph(F);
countCallees(F);
Modified: poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp (original)
+++ poolalloc/trunk/lib/DSA/EquivClassGraphs.cpp Wed Apr 16 12:56:05 2014
@@ -20,7 +20,7 @@
#include "llvm/IR/Module.h"
#include "llvm/Pass.h"
#include "dsa/DSGraph.h"
-#include "llvm/Support/CallSite.h"
+#include "llvm/IR/CallSite.h"
#include "llvm/Support/Debug.h"
#include "llvm/ADT/SCCIterator.h"
#include "llvm/ADT/Statistic.h"
Modified: poolalloc/trunk/lib/DSA/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Local.cpp (original)
+++ poolalloc/trunk/lib/DSA/Local.cpp Wed Apr 16 12:56:05 2014
@@ -31,8 +31,8 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FormattedStream.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/InstVisitor.h"
+#include "llvm/IR/GetElementPtrTypeIterator.h"
+#include "llvm/IR/InstVisitor.h"
#include "llvm/Support/Timer.h"
#include <fstream>
@@ -402,7 +402,7 @@ void GraphBuilder::visitLoadInst(LoadIns
// check that it is the inserted value
if(TypeInferenceOptimize)
if(LI.hasOneUse())
- if(StoreInst *SI = dyn_cast<StoreInst>(*(LI.use_begin())))
+ if(StoreInst *SI = dyn_cast<StoreInst>(*(LI.user_begin())))
if(SI->getOperand(0) == &LI) {
++NumIgnoredInst;
return;
@@ -562,7 +562,7 @@ void GraphBuilder::visitVAArgInst(VAArgI
void GraphBuilder::visitIntToPtrInst(IntToPtrInst &I) {
DSNode *N = createNode();
if(I.hasOneUse()) {
- if(isa<ICmpInst>(*(I.use_begin()))) {
+ if(isa<ICmpInst>(*(I.user_begin()))) {
NumBoringIntToPtr++;
return;
}
@@ -576,13 +576,13 @@ void GraphBuilder::visitIntToPtrInst(Int
void GraphBuilder::visitPtrToIntInst(PtrToIntInst& I) {
DSNode* N = getValueDest(I.getOperand(0)).getNode();
if(I.hasOneUse()) {
- if(isa<ICmpInst>(*(I.use_begin()))) {
+ if(isa<ICmpInst>(*(I.user_begin()))) {
NumBoringIntToPtr++;
return;
}
}
if(I.hasOneUse()) {
- Value *V = dyn_cast<Value>(*(I.use_begin()));
+ Value *V = dyn_cast<Value>(*(I.user_begin()));
DenseSet<Value *> Seen;
while(V && V->hasOneUse() &&
Seen.insert(V).second) {
@@ -592,7 +592,7 @@ void GraphBuilder::visitPtrToIntInst(Ptr
break;
if(isa<CallInst>(V))
break;
- V = dyn_cast<Value>(*(V->use_begin()));
+ V = dyn_cast<Value>(*(V->user_begin()));
}
if(isa<BranchInst>(V)){
NumBoringIntToPtr++;
@@ -1440,7 +1440,7 @@ void handleMagicSections(DSGraph* Global
char LocalDataStructures::ID;
bool LocalDataStructures::runOnModule(Module &M) {
- init(&getAnalysis<DataLayout>());
+ init(&getAnalysis<DataLayoutPass>().getDataLayout());
addrAnalysis = &getAnalysis<AddressTakenAnalysis>();
// First step, build the globals graph.
Modified: poolalloc/trunk/lib/DSA/Printer.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Printer.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Printer.cpp (original)
+++ poolalloc/trunk/lib/DSA/Printer.cpp Wed Apr 16 12:56:05 2014
@@ -18,7 +18,6 @@
#include "dsa/DSGraphTraits.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Constants.h"
-#include "llvm/Assembly/Writer.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/GraphWriter.h"
#include "llvm/ADT/Statistic.h"
@@ -116,7 +115,7 @@ static std::string getCaption(const DSNo
for (DSNode::globals_iterator i = N->globals_begin(), e = N->globals_end();
i != e; ++i) {
- WriteAsOperand(OS, *i, false, M);
+ (*i)->print(OS);
// Figure out how many globals are equivalent to this one.
if (GlobalECs) {
@@ -195,17 +194,6 @@ struct DOTGraphTraits<const DSGraph*> :
///
static void addCustomGraphFeatures(const DSGraph *G,
GraphWriter<const DSGraph*> &GW) {
- const Module *CurMod = 0;
- if (G->retnodes_begin() != G->retnodes_end())
- CurMod = G->retnodes_begin()->first->getParent();
- else {
- // If there is a global in the graph, we can use it to find the module.
- const DSScalarMap &SM = G->getScalarMap();
- if (SM.global_begin() != SM.global_end())
- CurMod = (*SM.global_begin())->getParent();
- }
-
-
if (!LimitPrint) {
// Add scalar nodes to the graph...
const DSGraph::ScalarMapTy &VM = G->getScalarMap();
@@ -214,7 +202,7 @@ struct DOTGraphTraits<const DSGraph*> :
if (!isa<GlobalValue>(I->first)) {
std::string OS_str;
llvm::raw_string_ostream OS(OS_str);
- WriteAsOperand(OS, I->first, false, CurMod);
+ I->first->print(OS);
GW.emitSimpleNode(I->first, "", OS.str());
// Add edge from return node to real destination
@@ -305,7 +293,7 @@ void DSGraph::writeGraphToFile(llvm::raw
O << "Writing '" << Filename << "'...";
if (!DontPrintGraphs) {
std::string Error;
- llvm::raw_fd_ostream F(Filename.c_str(), Error);
+ llvm::raw_fd_ostream F(Filename.c_str(), Error, sys::fs::F_Text);
if (Error.size()) {
O << " error opening file for writing! " << Error << "\n";
Modified: poolalloc/trunk/lib/DSA/StdLibPass.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/StdLibPass.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/StdLibPass.cpp (original)
+++ poolalloc/trunk/lib/DSA/StdLibPass.cpp Wed Apr 16 12:56:05 2014
@@ -18,7 +18,7 @@
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
+#include "llvm/IR/GetElementPtrTypeIterator.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
@@ -451,7 +451,7 @@ void
StdLibDataStructures::eraseCallsTo(Function* F) {
typedef std::pair<DSGraph*,Function*> RemovalPair;
DenseSet<RemovalPair> ToRemove;
- for (Value::use_iterator ii = F->use_begin(), ee = F->use_end();
+ for (Value::user_iterator ii = F->user_begin(), ee = F->user_end();
ii != ee; ++ii)
if (CallInst* CI = dyn_cast<CallInst>(*ii)){
if (CI->getCalledValue() == F) {
@@ -471,7 +471,7 @@ StdLibDataStructures::eraseCallsTo(Funct
}
} else if(ConstantExpr *CE = dyn_cast<ConstantExpr>(*ii)) {
if(CE->isCast()) {
- for (Value::use_iterator ci = CE->use_begin(), ce = CE->use_end();
+ for (Value::user_iterator ci = CE->user_begin(), ce = CE->user_end();
ci != ce; ++ci) {
if (CallInst* CI = dyn_cast<CallInst>(*ci)){
if(CI->getCalledValue() == CE) {
@@ -522,7 +522,7 @@ StdLibDataStructures::processRuntimeChec
// Scan through all direct calls to the function (there should only be direct
// calls) and process each one.
//
- for (Value::use_iterator ii = F->use_begin(), ee = F->use_end();
+ for (Value::user_iterator ii = F->user_begin(), ee = F->user_end();
ii != ee; ++ii) {
if (CallInst* CI = dyn_cast<CallInst>(*ii)) {
if (CI->getCalledValue() == F) {
@@ -677,7 +677,7 @@ StdLibDataStructures::runOnModule (Modul
void StdLibDataStructures::processFunction(int x, Function *F) {
- for (Value::use_iterator ii = F->use_begin(), ee = F->use_end();
+ for (Value::user_iterator ii = F->user_begin(), ee = F->user_end();
ii != ee; ++ii)
if (CallInst* CI = dyn_cast<CallInst>(*ii)){
if (CI->getCalledValue() == F) {
@@ -825,7 +825,7 @@ void StdLibDataStructures::processFuncti
}
} else if(ConstantExpr *CE = dyn_cast<ConstantExpr>(*ii)) {
if(CE->isCast())
- for (Value::use_iterator ci = CE->use_begin(), ce = CE->use_end();
+ for (Value::user_iterator ci = CE->user_begin(), ce = CE->user_end();
ci != ce; ++ci) {
if (CallInst* CI = dyn_cast<CallInst>(*ci)){
Modified: poolalloc/trunk/lib/DSA/TypeSafety.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/TypeSafety.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/TypeSafety.cpp (original)
+++ poolalloc/trunk/lib/DSA/TypeSafety.cpp Wed Apr 16 12:56:05 2014
@@ -333,7 +333,7 @@ TypeSafety<dsa>::runOnModule(Module & M)
//
// Get access to prerequisite passes.
//
- TD = &getAnalysis<DataLayout>();
+ TD = &getAnalysis<DataLayoutPass>().getDataLayout();
dsaPass = &getAnalysis<dsa>();
//
Modified: poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/Heuristic.cpp Wed Apr 16 12:56:05 2014
@@ -871,7 +871,7 @@ OnlyOverheadHeuristic::HackFunctionBody(
for (std::map<const DSNode*, Value*>::iterator PDI = PDs.begin(),
E = PDs.end(); PDI != E; ++PDI) {
Value *OldPD = PDI->second;
- std::vector<User*> OldPDUsers(OldPD->use_begin(), OldPD->use_end());
+ std::vector<User*> OldPDUsers(OldPD->user_begin(), OldPD->user_end());
for (unsigned i = 0, e = OldPDUsers.size(); i != e; ++i) {
CallSite PDUser(cast<Instruction>(OldPDUsers[i]));
if (PDUser.getCalledValue() != PoolInit &&
Modified: poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp Wed Apr 16 12:56:05 2014
@@ -26,7 +26,7 @@
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/TypeBuilder.h"
-#include "llvm/Support/CFG.h"
+#include "llvm/IR/CFG.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/ADT/DepthFirstIterator.h"
@@ -74,7 +74,7 @@ castTo (Value * V, Type * Ty, const std:
}
void PoolAllocateMultipleGlobalPool::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<DataLayout>();
+ AU.addRequired<DataLayoutPass>();
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 @@ bool PoolAllocateMultipleGlobalPool::run
Graphs = NULL;
assert (Graphs && "No DSA pass available!\n");
- DataLayout & TD = getAnalysis<DataLayout>();
+ const DataLayout & TD = getAnalysis<DataLayoutPass>().getDataLayout();
// Add the pool* prototypes to the module
AddPoolPrototypes(&M);
@@ -120,7 +120,7 @@ bool PoolAllocateMultipleGlobalPool::run
}
void
-PoolAllocateMultipleGlobalPool::ProcessFunctionBodySimple (Function& F, DataLayout & TD) {
+PoolAllocateMultipleGlobalPool::ProcessFunctionBodySimple (Function& F, const 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=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PASimple.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PASimple.cpp Wed Apr 16 12:56:05 2014
@@ -23,7 +23,7 @@
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
-#include "llvm/Support/CFG.h"
+#include "llvm/IR/CFG.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/ADT/DepthFirstIterator.h"
@@ -70,7 +70,7 @@ castTo (Value * V, Type * Ty, std::strin
}
void PoolAllocateSimple::getAnalysisUsage(AnalysisUsage &AU) const {
- AU.addRequired<DataLayout>();
+ AU.addRequired<DataLayoutPass>();
// Get the Target Data information and the Graphs
if (CompleteDSA) {
AU.addRequiredTransitive<EQTDDataStructures>();
@@ -131,7 +131,7 @@ bool PoolAllocateSimple::runOnModule(Mod
Graphs = &getAnalysis<BasicDataStructures>();
}
assert (Graphs && "No DSA pass available!\n");
- DataLayout & TD = getAnalysis<DataLayout>();
+ const DataLayout & TD = getAnalysis<DataLayoutPass>().getDataLayout();
// Add the pool* prototypes to the module
AddPoolPrototypes(&M);
@@ -187,7 +187,7 @@ bool PoolAllocateSimple::runOnModule(Mod
}
void
-PoolAllocateSimple::ProcessFunctionBodySimple (Function& F, DataLayout & TD) {
+PoolAllocateSimple::ProcessFunctionBodySimple (Function& F, const 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=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp Wed Apr 16 12:56:05 2014
@@ -24,8 +24,8 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
-#include "llvm/InstVisitor.h"
+#include "llvm/IR/GetElementPtrTypeIterator.h"
+#include "llvm/IR/InstVisitor.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Transforms/Utils/Cloning.h"
Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Wed Apr 16 12:56:05 2014
@@ -27,7 +27,7 @@
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
-#include "llvm/Support/CFG.h"
+#include "llvm/IR/CFG.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/ADT/DepthFirstIterator.h"
@@ -218,7 +218,7 @@ void PoolAllocate::getAnalysisUsage(Anal
if (lie_preserve_passes == LIE_PRESERVE_ALL)
AU.setPreservesAll();
- AU.addRequired<DataLayout>();
+ AU.addRequired<DataLayoutPass>();
}
bool PoolAllocate::runOnModule(Module &M) {
@@ -349,8 +349,8 @@ bool PoolAllocate::runOnModule(Module &M
// o) the called function is the function that we're replacing
//
std::vector<User *> toReplace;
- for (Function::use_iterator User = F->use_begin();
- User != F->use_end();
+ for (Function::user_iterator User = F->user_begin();
+ User != F->user_end();
++User) {
if (CallInst * CI = dyn_cast<CallInst>(*User)) {
if (CI->getCalledFunction() == F)
@@ -515,7 +515,7 @@ static void getCallsOf(Constant *C, std:
assert (0 && "Constant is not a Function of ConstantExpr!");
}
Calls.clear();
- for (Value::use_iterator UI = F->use_begin(), E = F->use_end(); UI != E; ++UI)
+ for (Value::user_iterator UI = F->user_begin(), E = F->user_end(); UI != E; ++UI)
Calls.push_back(cast<CallInst>(*UI));
}
@@ -529,7 +529,7 @@ static void getCallsOf(Constant *C, std:
//
static void
OptimizePointerNotNull(Value *V, LLVMContext * Context) {
- for (Value::use_iterator I = V->use_begin(), E = V->use_end(); I != E; ++I) {
+ for (Value::user_iterator I = V->user_begin(), E = V->user_end(); I != E; ++I) {
Instruction *User = cast<Instruction>(*I);
if (isa<ICmpInst>(User) && cast<ICmpInst>(User)->isEquality()) {
ICmpInst * ICI = cast<ICmpInst>(User);
@@ -1318,7 +1318,7 @@ static void DeleteIfIsPoolFree(Instructi
void PoolAllocate::CalculateLivePoolFreeBlocks(std::set<BasicBlock*>&LiveBlocks,
Value *PD) {
- for (Value::use_iterator I = PD->use_begin(), E = PD->use_end(); I != E; ++I){
+ for (Value::user_iterator I = PD->user_begin(), E = PD->user_end(); I != E; ++I){
//
// The only users of the pool should be call, invoke, and cast
// instructions. We know that poolfree() and pooldestroy() do not need to
Modified: poolalloc/trunk/lib/PoolAllocate/PoolOptimize.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolOptimize.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PoolOptimize.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PoolOptimize.cpp Wed Apr 16 12:56:05 2014
@@ -54,7 +54,7 @@ static void getCallsOf(Constant *C, std:
assert (0 && "Constant is not a Function of ConstantExpr!");
}
Calls.clear();
- for (Value::use_iterator UI = F->use_begin(), E = F->use_end(); UI != E; ++UI)
+ for (Value::user_iterator UI = F->user_begin(), E = F->user_end(); UI != E; ++UI)
Calls.push_back(cast<CallInst>(*UI));
}
@@ -216,8 +216,8 @@ bool PoolOptimize::runOnModule(Module &M
PI != E; ++PI) {
bool HasPoolAlloc = false, HasOtherUse = false;
Value *PoolDesc = *PI;
- for (Value::use_iterator UI = PoolDesc->use_begin(),
- E = PoolDesc->use_end(); UI != E; ++UI) {
+ for (Value::user_iterator UI = PoolDesc->user_begin(),
+ E = PoolDesc->user_end(); UI != E; ++UI) {
if (CallInst *CI = dyn_cast<CallInst>(*UI)) {
if (CI->getCalledFunction() == PoolInit ||
CI->getCalledFunction() == PoolDestroy) {
@@ -239,14 +239,14 @@ bool PoolOptimize::runOnModule(Module &M
// Yes, if there are uses at all, nuke the pool init, destroy, and the PD.
if (!HasPoolAlloc) {
while (!PoolDesc->use_empty())
- cast<Instruction>(PoolDesc->use_back())->eraseFromParent();
+ cast<Instruction>(PoolDesc->user_back())->eraseFromParent();
if (AllocaInst *AI = dyn_cast<AllocaInst>(PoolDesc))
AI->eraseFromParent();
else
cast<GlobalVariable>(PoolDesc)->eraseFromParent();
} else {
// Convert all of the pool descriptor users to the BumpPtr flavor.
- std::vector<User*> PDUsers(PoolDesc->use_begin(), PoolDesc->use_end());
+ std::vector<User*> PDUsers(PoolDesc->user_begin(), PoolDesc->user_end());
while (!PDUsers.empty()) {
CallInst *CI = cast<CallInst>(PDUsers.back());
Modified: poolalloc/trunk/lib/PoolAllocate/RunTimeAssociate.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/RunTimeAssociate.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/RunTimeAssociate.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/RunTimeAssociate.cpp Wed Apr 16 12:56:05 2014
@@ -23,7 +23,7 @@
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
-#include "llvm/Support/CFG.h"
+#include "llvm/IR/CFG.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/ADT/DepthFirstIterator.h"
Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Wed Apr 16 12:56:05 2014
@@ -23,7 +23,7 @@
#include "llvm/IR/Constants.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/DataLayout.h"
-#include "llvm/InstVisitor.h"
+#include "llvm/IR/InstVisitor.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/Debug.h"
#include "llvm/ADT/StringMap.h"
Modified: poolalloc/trunk/lib/rDSA/EquivClassGraphs.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/rDSA/EquivClassGraphs.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/rDSA/EquivClassGraphs.cpp (original)
+++ poolalloc/trunk/lib/rDSA/EquivClassGraphs.cpp Wed Apr 16 12:56:05 2014
@@ -20,7 +20,7 @@
#include "llvm/Module.h"
#include "llvm/Pass.h"
#include "rdsa/DSGraph.h"
-#include "llvm/Support/CallSite.h"
+#include "llvm/IR/CallSite.h"
#include "llvm/Support/Debug.h"
#include "llvm/ADT/SCCIterator.h"
#include "llvm/ADT/Statistic.h"
Modified: poolalloc/trunk/lib/rDSA/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/rDSA/Local.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/rDSA/Local.cpp (original)
+++ poolalloc/trunk/lib/rDSA/Local.cpp Wed Apr 16 12:56:05 2014
@@ -21,7 +21,7 @@
#include "llvm/DerivedTypes.h"
#include "llvm/Instructions.h"
#include "llvm/Intrinsics.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
+#include "llvm/IR/GetElementPtrTypeIterator.h"
#include "llvm/Support/InstVisitor.h"
#include "llvm/DataLayout.h"
#include "llvm/Support/CommandLine.h"
@@ -944,7 +944,7 @@ void GraphBuilderGlobal::mergeFunction(F
char LocalDataStructures::ID;
bool LocalDataStructures::runOnModule(Module &M) {
- init(&getAnalysis<DataLayout>());
+ init(&getAnalysis<DataLayoutPass>().getDataLayout());
// First step, build the globals graph.
{
Modified: poolalloc/trunk/lib/rDSA/StdLibPass.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/rDSA/StdLibPass.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/rDSA/StdLibPass.cpp (original)
+++ poolalloc/trunk/lib/rDSA/StdLibPass.cpp Wed Apr 16 12:56:05 2014
@@ -16,7 +16,7 @@
#include "llvm/DerivedTypes.h"
#include "llvm/Instructions.h"
#include "llvm/Intrinsics.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
+#include "llvm/IR/GetElementPtrTypeIterator.h"
#include "llvm/DataLayout.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
@@ -177,7 +177,7 @@ const struct {
};
void StdLibDataStructures::eraseCallsTo(Function* F) {
- for (Value::use_iterator ii = F->use_begin(), ee = F->use_end();
+ for (Value::user_iterator ii = F->user_begin(), ee = F->user_end();
ii != ee; ++ii)
if (CallInst* CI = dyn_cast<CallInst>(ii))
if (CI->getOperand(0) == F) {
@@ -220,7 +220,7 @@ bool StdLibDataStructures::runOnModule(M
for (int x = 0; recFuncs[x].name; ++x)
if (Function* F = M.getFunction(recFuncs[x].name))
if (F->isDeclaration()) {
- for (Value::use_iterator ii = F->use_begin(), ee = F->use_end();
+ for (Value::user_iterator ii = F->user_begin(), ee = F->user_end();
ii != ee; ++ii)
if (CallInst* CI = dyn_cast<CallInst>(ii))
if (CI->getOperand(0) == F) {
Modified: poolalloc/trunk/lib/rDSA/Steensgaard.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/rDSA/Steensgaard.cpp?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/lib/rDSA/Steensgaard.cpp (original)
+++ poolalloc/trunk/lib/rDSA/Steensgaard.cpp Wed Apr 16 12:56:05 2014
@@ -49,7 +49,7 @@ SteensgaardDataStructures::print(std::os
bool
SteensgaardDataStructures::runOnModule(Module &M) {
DS = &getAnalysis<StdLibDataStructures>();
- init(&getAnalysis<DataLayout>());
+ init(&getAnalysis<DataLayoutPass>().getDataLayout());
return runOnModuleInternal(M);
}
Modified: poolalloc/trunk/test/dsa/callgraph/inheritance1.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/callgraph/inheritance1.ll?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/test/dsa/callgraph/inheritance1.ll (original)
+++ poolalloc/trunk/test/dsa/callgraph/inheritance1.ll Wed Apr 16 12:56:05 2014
@@ -54,20 +54,6 @@ target triple = "x86_64-unknown-linux-gn
@__dso_handle = external global i8* ; <i8**> [#uses=1]
@llvm.global_ctors = appending global [1 x %0] [%0 { i32 65535, void ()* @_GLOBAL__I_main }] ; <[1 x %0]*> [#uses=0]
- at _ZL20__gthrw_pthread_oncePiPFvvE = alias weak i32 (i32*, void ()*)* @pthread_once ; <i32 (i32*, void ()*)*> [#uses=0]
- at _ZL27__gthrw_pthread_getspecificj = alias weak i8* (i32)* @pthread_getspecific ; <i8* (i32)*> [#uses=0]
- at _ZL27__gthrw_pthread_setspecificjPKv = alias weak i32 (i32, i8*)* @pthread_setspecific ; <i32 (i32, i8*)*> [#uses=0]
- at _ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = alias weak i32 (i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; <i32 (i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)*> [#uses=0]
- at _ZL22__gthrw_pthread_cancelm = alias weak i32 (i64)* @pthread_cancel ; <i32 (i64)*> [#uses=0]
- at _ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_lock ; <i32 (%union.pthread_mutex_t*)*> [#uses=0]
- at _ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_trylock ; <i32 (%union.pthread_mutex_t*)*> [#uses=0]
- at _ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_unlock ; <i32 (%union.pthread_mutex_t*)*> [#uses=0]
- at _ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutex_t*, %union.pthread_mutexattr_t*)* @pthread_mutex_init ; <i32 (%union.pthread_mutex_t*, %union.pthread_mutexattr_t*)*> [#uses=0]
- at _ZL26__gthrw_pthread_key_createPjPFvPvE = alias weak i32 (i32*, void (i8*)*)* @pthread_key_create ; <i32 (i32*, void (i8*)*)*> [#uses=0]
- at _ZL26__gthrw_pthread_key_deletej = alias weak i32 (i32)* @pthread_key_delete ; <i32 (i32)*> [#uses=0]
- at _ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_init ; <i32 (%union.pthread_mutexattr_t*)*> [#uses=0]
- at _ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = alias weak i32 (%union.pthread_mutexattr_t*, i32)* @pthread_mutexattr_settype ; <i32 (%union.pthread_mutexattr_t*, i32)*> [#uses=0]
- at _ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_destroy ; <i32 (%union.pthread_mutexattr_t*)*> [#uses=0]
define i32 @main() {
entry:
Modified: poolalloc/trunk/test/dsa/callgraph/inheritance2.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/callgraph/inheritance2.ll?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/test/dsa/callgraph/inheritance2.ll (original)
+++ poolalloc/trunk/test/dsa/callgraph/inheritance2.ll Wed Apr 16 12:56:05 2014
@@ -57,20 +57,6 @@ target triple = "x86_64-unknown-linux-gn
@__dso_handle = external global i8* ; <i8**> [#uses=1]
@llvm.global_ctors = appending global [1 x %0] [%0 { i32 65535, void ()* @_GLOBAL__I_ob }] ; <[1 x %0]*> [#uses=0]
- at _ZL20__gthrw_pthread_oncePiPFvvE = alias weak i32 (i32*, void ()*)* @pthread_once ; <i32 (i32*, void ()*)*> [#uses=0]
- at _ZL27__gthrw_pthread_getspecificj = alias weak i8* (i32)* @pthread_getspecific ; <i8* (i32)*> [#uses=0]
- at _ZL27__gthrw_pthread_setspecificjPKv = alias weak i32 (i32, i8*)* @pthread_setspecific ; <i32 (i32, i8*)*> [#uses=0]
- at _ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = alias weak i32 (i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; <i32 (i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)*> [#uses=0]
- at _ZL22__gthrw_pthread_cancelm = alias weak i32 (i64)* @pthread_cancel ; <i32 (i64)*> [#uses=0]
- at _ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_lock ; <i32 (%union.pthread_mutex_t*)*> [#uses=0]
- at _ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_trylock ; <i32 (%union.pthread_mutex_t*)*> [#uses=0]
- at _ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_unlock ; <i32 (%union.pthread_mutex_t*)*> [#uses=0]
- at _ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutex_t*, %union.pthread_mutexattr_t*)* @pthread_mutex_init ; <i32 (%union.pthread_mutex_t*, %union.pthread_mutexattr_t*)*> [#uses=0]
- at _ZL26__gthrw_pthread_key_createPjPFvPvE = alias weak i32 (i32*, void (i8*)*)* @pthread_key_create ; <i32 (i32*, void (i8*)*)*> [#uses=0]
- at _ZL26__gthrw_pthread_key_deletej = alias weak i32 (i32)* @pthread_key_delete ; <i32 (i32)*> [#uses=0]
- at _ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_init ; <i32 (%union.pthread_mutexattr_t*)*> [#uses=0]
- at _ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = alias weak i32 (%union.pthread_mutexattr_t*, i32)* @pthread_mutexattr_settype ; <i32 (%union.pthread_mutexattr_t*, i32)*> [#uses=0]
- at _ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_destroy ; <i32 (%union.pthread_mutexattr_t*)*> [#uses=0]
define internal void @_GLOBAL__I_ob() {
entry:
Modified: poolalloc/trunk/test/dsa/callgraph/inheritance3.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/callgraph/inheritance3.ll?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/test/dsa/callgraph/inheritance3.ll (original)
+++ poolalloc/trunk/test/dsa/callgraph/inheritance3.ll Wed Apr 16 12:56:05 2014
@@ -53,21 +53,6 @@ target triple = "x86_64-unknown-linux-gn
@__dso_handle = external global i8* ; <i8**> [#uses=1]
@llvm.global_ctors = appending global [1 x %0] [%0 { i32 65535, void ()* @_GLOBAL__I_ob }] ; <[1 x %0]*> [#uses=0]
- at _ZL20__gthrw_pthread_oncePiPFvvE = alias weak i32 (i32*, void ()*)* @pthread_once ; <i32 (i32*, void ()*)*> [#uses=0]
- at _ZL27__gthrw_pthread_getspecificj = alias weak i8* (i32)* @pthread_getspecific ; <i8* (i32)*> [#uses=0]
- at _ZL27__gthrw_pthread_setspecificjPKv = alias weak i32 (i32, i8*)* @pthread_setspecific ; <i32 (i32, i8*)*> [#uses=0]
- at _ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = alias weak i32 (i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; <i32 (i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)*> [#uses=0]
- at _ZL22__gthrw_pthread_cancelm = alias weak i32 (i64)* @pthread_cancel ; <i32 (i64)*> [#uses=0]
- at _ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_lock ; <i32 (%union.pthread_mutex_t*)*> [#uses=0]
- at _ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_trylock ; <i32 (%union.pthread_mutex_t*)*> [#uses=0]
- at _ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_unlock ; <i32 (%union.pthread_mutex_t*)*> [#uses=0]
- at _ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutex_t*, %union.pthread_mutexattr_t*)* @pthread_mutex_init ; <i32 (%union.pthread_mutex_t*, %union.pthread_mutexattr_t*)*> [#uses=0]
- at _ZL26__gthrw_pthread_key_createPjPFvPvE = alias weak i32 (i32*, void (i8*)*)* @pthread_key_create ; <i32 (i32*, void (i8*)*)*> [#uses=0]
- at _ZL26__gthrw_pthread_key_deletej = alias weak i32 (i32)* @pthread_key_delete ; <i32 (i32)*> [#uses=0]
- at _ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_init ; <i32 (%union.pthread_mutexattr_t*)*> [#uses=0]
- at _ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = alias weak i32 (%union.pthread_mutexattr_t*, i32)* @pthread_mutexattr_settype ; <i32 (%union.pthread_mutexattr_t*, i32)*> [#uses=0]
- at _ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutexattr_t*)* @pthread_mutexattr_destroy ; <i32 (%union.pthread_mutexattr_t*)*> [#uses=0]
-
define internal void @_GLOBAL__I_ob() {
entry:
call void @_Z41__static_initialization_and_destruction_0ii(i32 1, i32 65535)
Modified: poolalloc/trunk/test/dsa/regression/2010-08-23-InlineCallersSegfault.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/regression/2010-08-23-InlineCallersSegfault.ll?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/test/dsa/regression/2010-08-23-InlineCallersSegfault.ll (original)
+++ poolalloc/trunk/test/dsa/regression/2010-08-23-InlineCallersSegfault.ll Wed Apr 16 12:56:05 2014
@@ -69,21 +69,6 @@ target triple = "x86_64-unknown-linux-gn
@_ZTV16mrSurfaceTexture = internal constant [9 x i32 (...)*] [i32 (...)* null, i32 (...)* bitcast (%struct.__si_class_type_info_pseudo* @_ZTI16mrSurfaceTexture to i32 (...)*), i32 (...)* bitcast (i32 (%struct.mrSurfaceTexture*, %"struct.std::basic_ostream<char,std::char_traits<char> >"*)* @_ZNK16mrSurfaceTexture5printERSo to i32 (...)*), i32 (...)* bitcast (i32 (%struct.mrSurfaceTexture*, %struct.ggBox3*, double, double, double, double*, %struct.ggPoint3*, i32*, %struct.ggSpectrum*)* @_ZNK16mrSurfaceTexture9shadowHitERK6ggRay3dddRdR9ggVector3RiR10ggSpectrum to i32 (...)*), i32 (...)* bitcast (i32 (%struct.mrSurfaceTexture*, %struct.ggBox3*, double, double, double, %struct.mrViewingHitRecord*, %struct.ggMaterialRecord*)* @_ZNK16mrSurfaceTexture10viewingHitERK6ggRay3dddR18mrViewingHitRecordR16ggMaterialRecord to i32 (...)*), i32 (...)* bitcast (i32 (%struct.mrSurfaceTexture*, double, double, %struct.ggBox3*)* @_ZNK16mrSurfaceTexture11boundingBoxEddR6ggBox3 to i32 (...)*), i32!
(...)* b
itcast (i32 (%struct.ggBRDF*, double, double, %struct.ggBox3*)* @_ZNK9mrSurface11overlapsBoxEddRK6ggBox3 to i32 (...)*), i32 (...)* bitcast (i32 (%struct.mrSurfaceTexture*, %struct.ggPoint3*, %struct.ggPoint3*, %struct.ggPoint2*, double, %struct.ggPoint3*, double*)* @_ZNK16mrSurfaceTexture18selectVisiblePointERK8ggPoint3RK9ggVector3RK8ggPoint2dRS0_Rd to i32 (...)*), i32 (...)* bitcast (i32 (%struct.ggBRDF*, %struct.ggPoint3*, %struct.ggPoint3*, double, %struct.ggSpectrum*)* @_ZNK9mrSurface25approximateDirectRadianceERK8ggPoint3RK9ggVector3dR10ggSpectrum to i32 (...)*)], align 32 ; <[9 x i32 (...)*]*> [#uses=1]
@_ZTI16mrSurfaceTexture = external constant %struct.__si_class_type_info_pseudo, align 16 ; <%struct.__si_class_type_info_pseudo*> [#uses=1]
- at _ZL20__gthrw_pthread_oncePiPFvvE = alias weak i32 (i32*, void ()*)* @pthread_once ; <i32 (i32*, void ()*)*> [#uses=0]
- at _ZL27__gthrw_pthread_getspecificj = alias weak i8* (i32)* @pthread_getspecific ; <i8* (i32)*> [#uses=0]
- at _ZL27__gthrw_pthread_setspecificjPKv = alias weak i32 (i32, i8*)* @pthread_setspecific ; <i32 (i32, i8*)*> [#uses=0]
- at _ZL22__gthrw_pthread_createPmPK14pthread_attr_tPFPvS3_ES3_ = alias weak i32 (i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)* @pthread_create ; <i32 (i64*, %union.pthread_attr_t*, i8* (i8*)*, i8*)*> [#uses=0]
- at _ZL22__gthrw_pthread_cancelm = alias weak i32 (i64)* @pthread_cancel ; <i32 (i64)*> [#uses=0]
- at _ZL26__gthrw_pthread_mutex_lockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_lock ; <i32 (%union.pthread_mutex_t*)*> [#uses=0]
- at _ZL29__gthrw_pthread_mutex_trylockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_trylock ; <i32 (%union.pthread_mutex_t*)*> [#uses=0]
- at _ZL28__gthrw_pthread_mutex_unlockP15pthread_mutex_t = alias weak i32 (%union.pthread_mutex_t*)* @pthread_mutex_unlock ; <i32 (%union.pthread_mutex_t*)*> [#uses=0]
- at _ZL26__gthrw_pthread_mutex_initP15pthread_mutex_tPK19pthread_mutexattr_t = alias weak i32 (%union.pthread_mutex_t*, %"union.__mbstate_t::._2"*)* @pthread_mutex_init ; <i32 (%union.pthread_mutex_t*, %"union.__mbstate_t::._2"*)*> [#uses=0]
- at _ZL26__gthrw_pthread_key_createPjPFvPvE = alias weak i32 (i32*, void (i8*)*)* @pthread_key_create ; <i32 (i32*, void (i8*)*)*> [#uses=0]
- at _ZL26__gthrw_pthread_key_deletej = alias weak i32 (i32)* @pthread_key_delete ; <i32 (i32)*> [#uses=0]
- at _ZL30__gthrw_pthread_mutexattr_initP19pthread_mutexattr_t = alias weak i32 (%"union.__mbstate_t::._2"*)* @pthread_mutexattr_init ; <i32 (%"union.__mbstate_t::._2"*)*> [#uses=0]
- at _ZL33__gthrw_pthread_mutexattr_settypeP19pthread_mutexattr_ti = alias weak i32 (%"union.__mbstate_t::._2"*, i32)* @pthread_mutexattr_settype ; <i32 (%"union.__mbstate_t::._2"*, i32)*> [#uses=0]
- at _ZL33__gthrw_pthread_mutexattr_destroyP19pthread_mutexattr_t = alias weak i32 (%"union.__mbstate_t::._2"*)* @pthread_mutexattr_destroy ; <i32 (%"union.__mbstate_t::._2"*)*> [#uses=0]
-
declare i8* @_Znwm(i64)
define fastcc void @_ZN7mrScene4ReadERSi(%struct.mrScene* %this, %"struct.std::basic_istream<char,std::char_traits<char> >"* %surfaces) nounwind align 2 {
Modified: poolalloc/trunk/test/dsa/regression/2012-09-25.RCForwarding.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/regression/2012-09-25.RCForwarding.ll?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/test/dsa/regression/2012-09-25.RCForwarding.ll (original)
+++ poolalloc/trunk/test/dsa/regression/2012-09-25.RCForwarding.ll Wed Apr 16 12:56:05 2014
@@ -17,7 +17,6 @@ target triple = "x86_64-unknown-linux-gn
%struct.icmTag = type { i32, i32, i32, i32, %struct._icmBase* }
@typetable = internal unnamed_addr constant [25 x %struct.anon] [%struct.anon { i32 1668441193, %struct._icmBase* (%struct._icc*)* @new_icmCrdInfo }, %struct.anon { i32 1668641398, %struct._icmBase* (%struct._icc*)* @new_icmCurve }, %struct.anon { i32 1684108385, %struct._icmBase* (%struct._icc*)* @new_icmData }, %struct.anon { i32 1685350765, %struct._icmBase* (%struct._icc*)* @new_icmDateTimeNumber }, %struct.anon { i32 1835430962, %struct._icmBase* (%struct._icc*)* @new_icmLut }, %struct.anon { i32 1835430961, %struct._icmBase* (%struct._icc*)* @new_icmLut }, %struct.anon { i32 1835360627, %struct._icmBase* (%struct._icc*)* @new_icmMeasurement }, %struct.anon { i32 1852010348, %struct._icmBase* (%struct._icc*)* @new_icmNamedColor }, %struct.anon { i32 1852009522, %struct._icmBase* (%struct._icc*)* @new_icmNamedColor }, %struct.anon { i32 1886610801, %struct._icmBase* (%struct._icc*)* @new_icmProfileSequenceDesc }, %struct.anon { i32 1936077618, %struct._icmBase* (%struct!
._icc*)*
@new_icmS15Fixed16Array }, %struct.anon { i32 1935897198, %struct._icmBase* (%struct._icc*)* @new_icmScreening }, %struct.anon { i32 1936287520, %struct._icmBase* (%struct._icc*)* @new_icmSignature }, %struct.anon { i32 1684370275, %struct._icmBase* (%struct._icc*)* @new_icmTextDescription }, %struct.anon { i32 1952807028, %struct._icmBase* (%struct._icc*)* @new_icmText }, %struct.anon { i32 1969632050, %struct._icmBase* (%struct._icc*)* @new_icmU16Fixed16Array }, %struct.anon { i32 1650877472, %struct._icmBase* (%struct._icc*)* @new_icmUcrBg }, %struct.anon { i32 1986226036, %struct._icmBase* (%struct._icc*)* @new_icmVideoCardGamma }, %struct.anon { i32 1969828150, %struct._icmBase* (%struct._icc*)* @new_icmUInt16Array }, %struct.anon { i32 1969828658, %struct._icmBase* (%struct._icc*)* @new_icmUInt32Array }, %struct.anon { i32 1969829428, %struct._icmBase* (%struct._icc*)* @new_icmUInt64Array }, %struct.anon { i32 1969827896, %struct._icmBase* (%struct._icc*)* @new_icmUIn!
t8Array }
, %struct.anon { i32 1986618743, %struct._icmBase* (%struct._icc*)* @new_icmViewingConditions }, %struct.anon { i32 1482250784, %struct._icmBase* (%struct._icc*)* @new_icmXYZArray }, %struct.anon { i32 -1, %struct._icmBase* (%struct._icc*)* null }], align 16
- at llvm.compiler.used = appending global [0 x i8*] zeroinitializer, section "llvm.metadata"
declare i32 @test() nounwind readnone
Modified: poolalloc/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/lit.cfg?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/test/lit.cfg (original)
+++ poolalloc/trunk/test/lit.cfg Wed Apr 16 12:56:05 2014
@@ -5,6 +5,10 @@
import os
import sys
import re
+import platform
+
+import lit.util
+import lit.formats
# name: The name of this test suite.
config.name = 'PoolAlloc/DSA'
@@ -13,17 +17,26 @@ config.name = 'PoolAlloc/DSA'
if sys.platform in ['win32']:
# Seek sane tools in directories and set to $PATH.
path = getattr(config, 'lit_tools_dir', None)
- path = lit.getToolsPath(path,
- config.environment['PATH'],
- ['cmp.exe', 'grep.exe', 'sed.exe'])
+ path = lit_config.getToolsPath(path,
+ config.environment['PATH'],
+ ['cmp.exe', 'grep.exe', 'sed.exe'])
if path is not None:
path = os.path.pathsep.join((path,
config.environment['PATH']))
config.environment['PATH'] = path
+# Choose between lit's internal shell pipeline runner and a real shell. If
+# LIT_USE_INTERNAL_SHELL is in the environment, we use that as an override.
+use_lit_shell = os.environ.get("LIT_USE_INTERNAL_SHELL")
+if use_lit_shell:
+ # 0 is external, "" is default, and everything else is internal.
+ execute_external = (use_lit_shell == "0")
+else:
+ # Otherwise we default to internal on Windows and external elsewhere, as
+ # bash on Windows is usually very slow.
+ execute_external = (not sys.platform in ['win32'])
+
# testFormat: The test format to use to interpret tests.
-execute_external = (not sys.platform in ['win32']
- or lit.getBashPath() not in [None, ""])
config.test_format = lit.formats.ShTest(execute_external)
# To ignore test output on stderr so it doesn't trigger failures uncomment this:
@@ -36,36 +49,27 @@ config.suffixes = []
# excludes: A list of directories to exclude from the testsuite. The 'Inputs'
# subdirectories contain auxiliary inputs for various tests in their parent
# directories.
-config.excludes = ['Inputs']
+config.excludes = ['Inputs', 'CMakeLists.txt', 'README.txt', 'LICENSE.txt']
# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)
# test_exec_root: The root path where tests should be run.
-llvm_obj_root = getattr(config, 'llvm_obj_root', None)
proj_obj_root = getattr(config, 'proj_obj_root', None)
if proj_obj_root is not None:
config.test_exec_root = os.path.join(proj_obj_root, 'test')
# Tweak the PATH to include the scripts dir, the tools dir, and the llvm-gcc bin
# dir (if available).
+llvm_obj_root = getattr(config, 'llvm_obj_root', None)
if llvm_obj_root is not None:
- llvm_src_root = getattr(config, 'llvm_src_root', None)
- if not llvm_src_root:
- lit.fatal('No LLVM source root set!')
- path = os.path.pathsep.join((os.path.join(llvm_src_root, 'test',
- 'Scripts'),
- config.environment['PATH']))
- config.environment['PATH'] = path
-
llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
if not llvm_tools_dir:
- lit.fatal('No LLVM tools dir set!')
+ lit_config.fatal('No LLVM tools dir set!')
path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
config.environment['PATH'] = path
- proj_obj_root = getattr(config, 'proj_obj_root', None)
- if proj_obj_root:
+ if proj_obj_root is not None:
path = os.path.pathsep.join((os.path.join(proj_obj_root, 'test', 'tools'),
config.environment['PATH']))
config.environment['PATH'] = path
@@ -97,6 +101,11 @@ config.environment['LLVM_SRC_ROOT'] = ge
config.environment['PYTHON_EXECUTABLE'] = getattr(config, 'python_executable',
'')
+# Propagate path to symbolizer for ASan/MSan.
+for symbolizer in ['ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH']:
+ if symbolizer in os.environ:
+ config.environment[symbolizer] = os.environ[symbolizer]
+
###
import os
@@ -111,9 +120,9 @@ if config.test_exec_root is None:
# out-of-tree build situation).
# Check for 'llvm_site_config' user parameter, and use that if available.
- site_cfg = lit.params.get('llvm_site_config', None)
+ site_cfg = lit_config.params.get('llvm_site_config', None)
if site_cfg and os.path.exists(site_cfg):
- lit.load_config(config, site_cfg)
+ lit_config.load_config(config, site_cfg)
raise SystemExit
# Try to detect the situation where we are using an out-of-tree build by
@@ -126,7 +135,7 @@ if config.test_exec_root is None:
llvm_config = lit.util.which('llvm-config', config.environment['PATH'])
if not llvm_config:
- lit.fatal('No site specific configuration available!')
+ lit_config.fatal('No site specific configuration available!')
# Get the source and object roots.
llvm_src_root = lit.util.capture(['llvm-config', '--src-root']).strip()
@@ -135,27 +144,55 @@ if config.test_exec_root is None:
# Validate that we got a tree which points to here.
this_src_root = os.path.dirname(config.test_source_root)
if os.path.realpath(llvm_src_root) != os.path.realpath(this_src_root):
- lit.fatal('No site specific configuration available!')
+ lit_config.fatal('No site specific configuration available!')
# Check that the site specific configuration exists.
site_cfg = os.path.join(llvm_obj_root, 'test', 'lit.site.cfg')
if not os.path.exists(site_cfg):
- lit.fatal('No site specific configuration available!')
+ lit_config.fatal('No site specific configuration available!')
# Okay, that worked. Notify the user of the automagic, and reconfigure.
- lit.note('using out-of-tree build at %r' % llvm_obj_root)
- lit.load_config(config, site_cfg)
+ lit_config.note('using out-of-tree build at %r' % llvm_obj_root)
+ lit_config.load_config(config, site_cfg)
raise SystemExit
###
+# Provide a command line for mcjit tests
+lli_mcjit = 'lli -use-mcjit'
+# The target triple used by default by lli is the process target triple (some
+# triple appropriate for generating code for the current process) but because
+# we don't support COFF in MCJIT well enough for the tests, force ELF format on
+# Windows. FIXME: the process target triple should be used here, but this is
+# difficult to obtain on Windows.
+if re.search(r'cygwin|mingw32|win32', config.host_triple):
+ lli_mcjit += ' -mtriple='+config.host_triple+'-elf'
+config.substitutions.append( ('%lli_mcjit', lli_mcjit) )
+
+# Similarly, have a macro to use llc with DWARF even when the host is win32.
+llc_dwarf = 'llc'
+if re.search(r'win32', config.target_triple):
+ llc_dwarf += ' -mtriple='+config.target_triple.replace('-win32', '-mingw32')
+config.substitutions.append( ('%llc_dwarf', llc_dwarf) )
+
+# Provide a substition for those tests that need to run the jit to obtain data
+# but simply want use the currently considered most reliable jit for platform
+# FIXME: ppc32 is not ready for mcjit.
+if 'arm' in config.target_triple \
+ or 'aarch64' in config.target_triple \
+ or 'powerpc64' in config.target_triple \
+ or 's390x' in config.target_triple:
+ defaultIsMCJIT = 'true'
+else:
+ defaultIsMCJIT = 'false'
+config.substitutions.append( ('%defaultjit', '-use-mcjit='+defaultIsMCJIT) )
# Process jit implementation option
-jit_impl_cfg = lit.params.get('jit_impl', None)
+jit_impl_cfg = lit_config.params.get('jit_impl', None)
if jit_impl_cfg == 'mcjit':
# When running with mcjit, mangle -mcjit into target triple
# and add -use-mcjit flag to lli invocation
- if 'i686' in config.target_triple:
+ if 'i386' in config.target_triple or 'i686' in config.target_triple:
config.target_triple += jit_impl_cfg + '-ia32'
elif 'x86_64' in config.target_triple:
config.target_triple += jit_impl_cfg + '-ia64'
@@ -177,51 +214,67 @@ config.substitutions.append( ('%shlibext
# tools that might happen to be in the user's PATH. Thus this list
# includes every tool placed in $(LLVM_OBJ_ROOT)/$(BuildMode)/bin
# (llvm_tools_dir in lit parlance).
- # Don't match 'bugpoint-' or 'clang-'.
- # Don't match '/clang' or '-clang'.
-if os.pathsep == ';':
- pathext = os.environ.get('PATHEXT', '').split(';')
-else:
- pathext = ['']
-for pattern in [r"\bbugpoint\b(?!-)", r"(?<!/|-)\bclang\b(?!-)",
- r"\bgold\b",
- r"\bllc\b", r"\blli\b",
- r"\bllvm-ar\b", r"\bllvm-as\b",
- r"\bllvm-bcanalyzer\b", r"\bllvm-config\b",
- r"\bllvm-cov\b", r"\bllvm-diff\b",
- r"\bllvm-dis\b", r"\bllvm-dwarfdump\b",
- r"\bllvm-extract\b", r"\bllvm-ld\b",
- r"\bllvm-link\b", r"\bllvm-mc\b",
- r"\bllvm-nm\b", r"\bllvm-objdump\b",
- r"\bllvm-prof\b", r"\bllvm-ranlib\b",
- r"\bllvm-rtdyld\b", r"\bllvm-shlib\b",
- r"\bllvm-size\b", r"\bllvm-stub\b",
- # Don't match '-llvmc'.
- r"(?<!-)\bllvmc\b", r"\blto\b",
- # Don't match '.opt', '-opt',
- # '^opt' or '/opt'.
- r"\bmacho-dump\b", r"(?<!\.|-|\^|/)\bopt\b",
- r"\bllvm-tblgen\b", r"\bFileCheck\b",
- r"\bFileUpdate\b", r"\bc-index-test\b",
- r"\bfpcmp\b", r"\bllvm-PerfectShuffle\b",
+
+# Avoid matching RUN line fragments that are actually part of
+# path names or options or whatever.
+# The regex is a pre-assertion to avoid matching a preceding
+# dot, hyphen, carat, or slash (.foo, -foo, etc.). Some patterns
+# also have a post-assertion to not match a trailing hyphen (foo-).
+NOJUNK = r"(?<!\.|-|\^|/)"
+
+for pattern in [r"\bbugpoint\b(?!-)",
+ NOJUNK + r"\bclang\b(?!-)",
+ NOJUNK + r"\bllc\b",
+ r"\blli\b",
+ r"\bllvm-PerfectShuffle\b",
+ r"\bllvm-ar\b",
+ r"\bllvm-as\b",
+ r"\bllvm-bcanalyzer\b",
+ r"\bllvm-config\b",
+ r"\bllvm-cov\b",
+ r"\bllvm-diff\b",
+ r"\bllvm-dis\b",
+ r"\bllvm-dwarfdump\b",
+ r"\bllvm-extract\b",
+ r"\bllvm-link\b",
+ r"\bllvm-lto\b",
+ r"\bllvm-mc\b",
+ r"\bllvm-mcmarkup\b",
+ r"\bllvm-nm\b",
+ r"\bllvm-objdump\b",
+ r"\bllvm-profdata\b",
+ r"\bllvm-ranlib\b",
+ r"\bllvm-readobj\b",
+ r"\bllvm-rtdyld\b",
+ r"\bllvm-size\b",
+ r"\bllvm-tblgen\b",
+ r"\bllvm-c-test\b",
+ r"\bmacho-dump\b",
+ NOJUNK + r"\bopt\b",
+ r"\bFileCheck\b",
+ r"\bFileUpdate\b",
+ r"\bc-index-test\b",
+ r"\bfpcmp\b",
+ r"\bobj2yaml\b",
+ r"\byaml2obj\b",
# Handle these specially as they are strings searched
# for during testing.
- r"\| \bcount\b", r"\| \bnot\b"]:
+ r"\| \bcount\b",
+ r"\| \bnot\b"]:
# Extract the tool name from the pattern. This relies on the tool
# name being surrounded by \b word match operators. If the
# pattern starts with "| ", include it in the string to be
# substituted.
- substitution = re.sub(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$",
- r"\2" + llvm_tools_dir + "/" + r"\4",
+ tool_match = re.match(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$",
pattern)
- for ext in pathext:
- substitution_ext = substitution + ext
- if os.path.exists(substitution_ext):
- substitution = substitution_ext
- break
- config.substitutions.append((pattern, substitution))
-
-
+ tool_pipe = tool_match.group(2)
+ tool_name = tool_match.group(4)
+ tool_path = lit.util.which(tool_name, llvm_tools_dir)
+ if not tool_path:
+ # Warn, but still provide a substitution.
+ lit_config.note('Did not find ' + tool_name + ' in ' + llvm_tools_dir)
+ tool_path = llvm_tools_dir + '/' + tool_name
+ config.substitutions.append((pattern, tool_pipe + tool_path))
### Helper tools
dsa_so = config.llvm_shlib_dir + "/LLVMDataStructure" + config.llvm_shlib_ext
@@ -236,9 +289,13 @@ config.substitutions.append((r'\bpaopt\b
### Features
# Shell execution
-if sys.platform not in ['win32'] or lit.getBashPath() != '':
+if execute_external:
config.available_features.add('shell')
+# Others/can-execute.txt
+if sys.platform not in ['win32']:
+ config.available_features.add('can-execute')
+
# Loadable module
# FIXME: This should be supplied by Makefile or autoconf.
if sys.platform in ['win32', 'cygwin']:
@@ -249,15 +306,71 @@ else:
if loadable_module:
config.available_features.add('loadable_module')
-# llc knows whether he is compiled with -DNDEBUG.
+# Sanitizers.
+if config.llvm_use_sanitizer == "Address":
+ config.available_features.add("asan")
+if (config.llvm_use_sanitizer == "Memory" or
+ config.llvm_use_sanitizer == "MemoryWithOrigins"):
+ config.available_features.add("msan")
+
+# Direct object generation
+if not 'hexagon' in config.target_triple and \
+ not re.match('(arm|thumb).*windows', config.target_triple):
+ config.available_features.add("object-emission")
+
+if config.have_zlib == "1":
+ config.available_features.add("zlib")
+else:
+ config.available_features.add("nozlib")
+
+# Native compilation: host arch == target arch
+# FIXME: Consider cases that target can be executed
+# even if host_triple were different from target_triple.
+if config.host_triple == config.target_triple:
+ config.available_features.add("native")
+
+# Ask llvm-config about assertion mode.
import subprocess
try:
- llc_cmd = subprocess.Popen([os.path.join(llvm_tools_dir, 'llc'), '-version'],
- stdout = subprocess.PIPE)
-except OSError, why:
- print "Could not find llc in " + llvm_tools_dir
+ llvm_config_cmd = subprocess.Popen(
+ [os.path.join(llvm_tools_dir, 'llvm-config'), '--assertion-mode'],
+ stdout = subprocess.PIPE)
+except OSError:
+ print("Could not find llvm-config in " + llvm_tools_dir)
exit(42)
-if re.search(r'with assertions', llc_cmd.stdout.read()):
+if re.search(r'ON', llvm_config_cmd.stdout.read().decode('ascii')):
config.available_features.add('asserts')
-llc_cmd.wait()
+llvm_config_cmd.wait()
+
+if 'darwin' == sys.platform:
+ try:
+ sysctl_cmd = subprocess.Popen(['sysctl', 'hw.optional.fma'],
+ stdout = subprocess.PIPE)
+ except OSError:
+ print("Could not exec sysctl")
+ result = sysctl_cmd.stdout.read().decode('ascii')
+ if -1 != result.find("hw.optional.fma: 1"):
+ config.available_features.add('fma3')
+ sysctl_cmd.wait()
+
+# Check if we should use gmalloc.
+use_gmalloc_str = lit_config.params.get('use_gmalloc', None)
+if use_gmalloc_str is not None:
+ if use_gmalloc_str.lower() in ('1', 'true'):
+ use_gmalloc = True
+ elif use_gmalloc_str.lower() in ('', '0', 'false'):
+ use_gmalloc = False
+ else:
+ lit_config.fatal('user parameter use_gmalloc should be 0 or 1')
+else:
+ # Default to not using gmalloc
+ use_gmalloc = False
+
+# Allow use of an explicit path for gmalloc library.
+# Will default to '/usr/lib/libgmalloc.dylib' if not set.
+gmalloc_path_str = lit_config.params.get('gmalloc_path',
+ '/usr/lib/libgmalloc.dylib')
+
+if use_gmalloc:
+ config.environment.update({'DYLD_INSERT_LIBRARIES' : gmalloc_path_str})
Modified: poolalloc/trunk/test/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/lit.site.cfg.in?rev=206408&r1=206407&r2=206408&view=diff
==============================================================================
--- poolalloc/trunk/test/lit.site.cfg.in (original)
+++ poolalloc/trunk/test/lit.site.cfg.in Wed Apr 16 12:56:05 2014
@@ -1,14 +1,18 @@
+import sys
+
## Autogenerated by LLVM/Clang configuration.
# Do not edit!
+config.host_triple = "@LLVM_HOST_TRIPLE@"
+config.target_triple = "@TARGET_TRIPLE@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.proj_src_root = "@PROJ_SRC_ROOT@"
config.proj_obj_root = "@PROJ_OBJ_ROOT@"
-config.target_triple = "@TARGET_TRIPLE@"
config.llvm_shlib_dir = "@SHLIBDIR@"
config.llvm_shlib_ext = "@SHLIBEXT@"
+config.llvm_exe_ext = "@EXEEXT@"
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
config.python_executable = "@PYTHON_EXECUTABLE@"
config.ocamlopt_executable = "@OCAMLOPT@"
@@ -18,14 +22,19 @@ config.targets_to_build = "@TARGETS_TO_B
config.llvm_bindings = "@LLVM_BINDINGS@"
config.host_os = "@HOST_OS@"
config.host_arch = "@HOST_ARCH@"
+config.llvm_use_intel_jitevents = "@LLVM_USE_INTEL_JITEVENTS@"
+config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
+config.have_zlib = "@HAVE_LIBZ@"
# Support substitution of the tools_dir with user parameters. This is
# used when we can't determine the tool dir at configuration time.
try:
- config.llvm_tools_dir = config.llvm_tools_dir % lit.params
-except KeyError,e:
+ config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
+ config.llvm_shlib_dir = config.llvm_shlib_dir % lit_config.params
+except KeyError:
+ e = sys.exc_info()[1]
key, = e.args
- lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))
+ lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))
# Let the main config do the real work.
-lit.load_config(config, "@PROJ_SRC_ROOT@/test/lit.cfg")
+lit_config.load_config(config, "@PROJ_SRC_ROOT@/test/lit.cfg")
More information about the llvm-commits
mailing list