summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DataStructure
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/DataStructure')
-rw-r--r--llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp3
-rw-r--r--llvm/lib/Analysis/DataStructure/DSCallSiteIterator.h4
-rw-r--r--llvm/lib/Analysis/DataStructure/DataStructure.cpp7
-rw-r--r--llvm/lib/Analysis/DataStructure/DataStructureAA.cpp4
-rw-r--r--llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp5
-rw-r--r--llvm/lib/Analysis/DataStructure/DataStructureStats.cpp4
-rw-r--r--llvm/lib/Analysis/DataStructure/GraphChecker.cpp4
-rw-r--r--llvm/lib/Analysis/DataStructure/Local.cpp8
-rw-r--r--llvm/lib/Analysis/DataStructure/Printer.cpp5
-rw-r--r--llvm/lib/Analysis/DataStructure/Steensgaard.cpp5
-rw-r--r--llvm/lib/Analysis/DataStructure/TopDownClosure.cpp3
11 files changed, 46 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp b/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
index b4b2e48b4ef..66990fd9230 100644
--- a/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
+++ b/llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
@@ -20,6 +20,8 @@
#include "Support/Debug.h"
#include "DSCallSiteIterator.h"
+namespace llvm {
+
namespace {
Statistic<> MaxSCC("budatastructure", "Maximum SCC Size in Call Graph");
Statistic<> NumBUInlines("budatastructures", "Number of graphs inlined");
@@ -316,3 +318,4 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) {
//Graph.writeGraphToFile(std::cerr, "bu_" + F.getName());
}
+} // End llvm namespace
diff --git a/llvm/lib/Analysis/DataStructure/DSCallSiteIterator.h b/llvm/lib/Analysis/DataStructure/DSCallSiteIterator.h
index 324111cffad..df9f36908ae 100644
--- a/llvm/lib/Analysis/DataStructure/DSCallSiteIterator.h
+++ b/llvm/lib/Analysis/DataStructure/DSCallSiteIterator.h
@@ -19,6 +19,8 @@
#include "llvm/Analysis/DSGraph.h"
#include "llvm/Function.h"
+namespace llvm {
+
struct DSCallSiteIterator {
// FCs are the edges out of the current node are the call site targets...
const std::vector<DSCallSite> *FCs;
@@ -129,4 +131,6 @@ public:
}
};
+} // End llvm namespace
+
#endif
diff --git a/llvm/lib/Analysis/DataStructure/DataStructure.cpp b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
index d53c7fa5d7b..9cf77ae1229 100644
--- a/llvm/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
@@ -23,6 +23,8 @@
#include "Support/Timer.h"
#include <algorithm>
+namespace llvm {
+
namespace {
Statistic<> NumFolds ("dsnode", "Number of nodes completely folded");
Statistic<> NumCallNodesMerged("dsnode", "Number of call nodes merged");
@@ -161,7 +163,6 @@ bool DSNode::isNodeCompletelyFolded() const {
return getSize() == 1 && Ty == Type::VoidTy && isArray();
}
-
namespace {
/// TypeElementWalker Class - Used for implementation of physical subtyping...
///
@@ -252,7 +253,7 @@ namespace {
}
}
};
-}
+} // end anonymous namespace
/// ElementTypesAreCompatible - Check to see if the specified types are
/// "physically" compatible. If so, return true, else return false. We only
@@ -1639,6 +1640,7 @@ void DSGraph::mergeInGlobalsGraph() {
removeTriviallyDeadNodes();
}
+
/// computeNodeMapping - Given roots in two different DSGraphs, traverse the
/// nodes reachable from the two graphs, computing the mapping of nodes from
/// the first to the second graph.
@@ -1669,3 +1671,4 @@ void DSGraph::computeNodeMapping(const DSNodeHandle &NH1,
computeNodeMapping(N1->getLink(i), N2->getLink(N2Idx+i), NodeMap);
}
+} // End llvm namespace
diff --git a/llvm/lib/Analysis/DataStructure/DataStructureAA.cpp b/llvm/lib/Analysis/DataStructure/DataStructureAA.cpp
index 99773e3936e..4b55da7aa54 100644
--- a/llvm/lib/Analysis/DataStructure/DataStructureAA.cpp
+++ b/llvm/lib/Analysis/DataStructure/DataStructureAA.cpp
@@ -17,6 +17,8 @@
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Module.h"
+namespace llvm {
+
namespace {
class DSAA : public Pass, public AliasAnalysis {
TDDataStructures *TD;
@@ -176,3 +178,5 @@ void DSAA::getMustAliases(Value *P, std::vector<Value*> &RetVals) {
#endif
return getAnalysis<AliasAnalysis>().getMustAliases(P, RetVals);
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp b/llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp
index 0ca7d6bffc0..d037b52145e 100644
--- a/llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp
+++ b/llvm/lib/Analysis/DataStructure/DataStructureOpt.cpp
@@ -18,6 +18,8 @@
#include "llvm/Constant.h"
#include "Support/Statistic.h"
+namespace llvm {
+
namespace {
Statistic<>
NumGlobalsConstanted("ds-opt", "Number of globals marked constant");
@@ -47,7 +49,6 @@ namespace {
RegisterOpt<DSOpt> X("ds-opt", "DSA-based simple optimizations");
}
-
/// OptimizeGlobals - This method uses information taken from DSA to optimize
/// global variables.
///
@@ -96,3 +97,5 @@ bool DSOpt::OptimizeGlobals(Module &M) {
}
return Changed;
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Analysis/DataStructure/DataStructureStats.cpp b/llvm/lib/Analysis/DataStructure/DataStructureStats.cpp
index 8d2984845a2..3659c906973 100644
--- a/llvm/lib/Analysis/DataStructure/DataStructureStats.cpp
+++ b/llvm/lib/Analysis/DataStructure/DataStructureStats.cpp
@@ -19,6 +19,8 @@
#include "Support/Statistic.h"
#include <vector>
+namespace llvm {
+
namespace {
Statistic<> TotalNumCallees("totalcallees",
"Total number of callee functions at all indirect call sites");
@@ -139,3 +141,5 @@ bool DSGraphStats::runOnFunction(Function& F) {
visit(F);
return true;
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Analysis/DataStructure/GraphChecker.cpp b/llvm/lib/Analysis/DataStructure/GraphChecker.cpp
index b0164da322f..11ebc6920cb 100644
--- a/llvm/lib/Analysis/DataStructure/GraphChecker.cpp
+++ b/llvm/lib/Analysis/DataStructure/GraphChecker.cpp
@@ -29,6 +29,8 @@
#include "llvm/Value.h"
#include <set>
+namespace llvm {
+
namespace {
enum DSPass { local, bu, td };
cl::opt<DSPass>
@@ -193,3 +195,5 @@ void DSGC::verify(const DSGraph &G) {
}
}
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Analysis/DataStructure/Local.cpp b/llvm/lib/Analysis/DataStructure/Local.cpp
index 0aca21a437b..253cbf7a351 100644
--- a/llvm/lib/Analysis/DataStructure/Local.cpp
+++ b/llvm/lib/Analysis/DataStructure/Local.cpp
@@ -28,6 +28,8 @@
//
#include "llvm/Module.h"
+namespace llvm {
+
static RegisterAnalysis<LocalDataStructures>
X("datastructure", "Local Data Structure Analysis");
@@ -41,8 +43,8 @@ namespace DS {
return false;
}
}
-using namespace DS;
+using namespace DS;
namespace {
cl::opt<bool>
@@ -144,6 +146,8 @@ namespace {
};
}
+using namespace DS;
+
//===----------------------------------------------------------------------===//
// DSGraph constructor - Simply use the GraphBuilder to construct the local
// graph.
@@ -617,3 +621,5 @@ void LocalDataStructures::releaseMemory() {
delete GlobalsGraph;
GlobalsGraph = 0;
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Analysis/DataStructure/Printer.cpp b/llvm/lib/Analysis/DataStructure/Printer.cpp
index 95879795601..9902906e19a 100644
--- a/llvm/lib/Analysis/DataStructure/Printer.cpp
+++ b/llvm/lib/Analysis/DataStructure/Printer.cpp
@@ -23,6 +23,8 @@
#include <fstream>
#include <sstream>
+namespace llvm {
+
// OnlyPrintMain - The DataStructure printer exposes this option to allow
// printing of only the graph for "main".
//
@@ -32,7 +34,6 @@ namespace {
Statistic<> NumFoldedNodes ("dsnode", "Number of folded nodes (in final graph)");
}
-
void DSNode::dump() const { print(std::cerr, 0); }
static std::string getCaption(const DSNode *N, const DSGraph *G) {
@@ -280,3 +281,5 @@ void BUDataStructures::print(std::ostream &O, const Module *M) const {
void TDDataStructures::print(std::ostream &O, const Module *M) const {
printCollection(*this, O, M, "td.");
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Analysis/DataStructure/Steensgaard.cpp b/llvm/lib/Analysis/DataStructure/Steensgaard.cpp
index 8bf917f0483..d868d250f7b 100644
--- a/llvm/lib/Analysis/DataStructure/Steensgaard.cpp
+++ b/llvm/lib/Analysis/DataStructure/Steensgaard.cpp
@@ -20,6 +20,8 @@
#include "llvm/Module.h"
#include "Support/Debug.h"
+namespace llvm {
+
namespace {
class Steens : public Pass, public AliasAnalysis {
DSGraph *ResultGraph;
@@ -76,7 +78,6 @@ namespace {
RegisterAnalysisGroup<AliasAnalysis, Steens> Y;
}
-
/// ResolveFunctionCall - Resolve the actual arguments of a call to function F
/// with the specified call site descriptor. This function links the arguments
/// and the return value for the call site context-insensitively.
@@ -235,3 +236,5 @@ AliasAnalysis::AliasResult Steens::alias(const Value *V1, unsigned V1Size,
//
return getAnalysis<AliasAnalysis>().alias(V1, V1Size, V2, V2Size);
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp b/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
index ad5a9d72203..696368a866e 100644
--- a/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
+++ b/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
@@ -21,6 +21,8 @@
#include "Support/Debug.h"
#include "Support/Statistic.h"
+namespace llvm {
+
namespace {
RegisterAnalysis<TDDataStructures> // Register the pass
Y("tddatastructure", "Top-down Data Structure Analysis");
@@ -310,3 +312,4 @@ void TDDataStructures::inlineGraphIntoCallees(DSGraph &Graph) {
<< Graph.getFunctionCalls().size() << "]\n");
}
+} // End llvm namespace
OpenPOWER on IntegriCloud