From b3416bc9ccd9d7f379d14238bae297a9613999cf Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 1 Feb 2003 04:01:21 +0000 Subject: [PATCH] Remove using declarations git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5456 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../DataStructure/BottomUpClosure.cpp | 3 +-- lib/Analysis/DataStructure/DataStructure.cpp | 26 +++++++++---------- lib/Analysis/DataStructure/Local.cpp | 15 +++++------ lib/Analysis/DataStructure/Printer.cpp | 10 +++---- 4 files changed, 24 insertions(+), 30 deletions(-) diff --git a/lib/Analysis/DataStructure/BottomUpClosure.cpp b/lib/Analysis/DataStructure/BottomUpClosure.cpp index ef3bf387ef9..26b7813482e 100644 --- a/lib/Analysis/DataStructure/BottomUpClosure.cpp +++ b/lib/Analysis/DataStructure/BottomUpClosure.cpp @@ -11,7 +11,6 @@ #include "llvm/Analysis/DSGraph.h" #include "llvm/Module.h" #include "Support/Statistic.h" -using std::map; namespace { Statistic<> MaxSCC("budatastructure", "Maximum SCC Size in Call Graph"); @@ -284,7 +283,7 @@ unsigned BUDataStructures::calculateGraphs(Function *F, // our memory... here... // void BUDataStructures::releaseMemory() { - for (map::iterator I = DSInfo.begin(), + for (std::map::iterator I = DSInfo.begin(), E = DSInfo.end(); I != E; ++I) delete I->second; diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp index b46e04fc2e8..797eb19a19b 100644 --- a/lib/Analysis/DataStructure/DataStructure.cpp +++ b/lib/Analysis/DataStructure/DataStructure.cpp @@ -14,8 +14,6 @@ #include "Support/Timer.h" #include -using std::vector; - namespace { Statistic<> NumFolds ("dsnode", "Number of nodes completely folded"); Statistic<> NumCallNodesMerged("dsnode", "Number of call nodes merged"); @@ -45,7 +43,7 @@ DSNode::DSNode(const DSNode &N) void DSNode::removeReferrer(DSNodeHandle *H) { // Search backwards, because we depopulate the list from the back for // efficiency (because it's a vector). - vector::reverse_iterator I = + std::vector::reverse_iterator I = std::find(Referrers.rbegin(), Referrers.rend(), H); assert(I != Referrers.rend() && "Referrer not pointing to node!"); Referrers.erase(I.base()-1); @@ -56,7 +54,7 @@ void DSNode::removeReferrer(DSNodeHandle *H) { // void DSNode::addGlobal(GlobalValue *GV) { // Keep the list sorted. - vector::iterator I = + std::vector::iterator I = std::lower_bound(Globals.begin(), Globals.end(), GV); if (I == Globals.end() || *I != GV) { @@ -83,8 +81,8 @@ void DSNode::foldNodeCompletely() { // Loop over all of our referrers, making them point to our zero bytes of // space. - for (vector::iterator I = Referrers.begin(), E=Referrers.end(); - I != E; ++I) + for (std::vector::iterator I = Referrers.begin(), + E = Referrers.end(); I != E; ++I) (*I)->setOffset(0); // If we have links, merge all of our outgoing links together... @@ -339,8 +337,8 @@ void DSNode::addEdgeTo(unsigned Offset, const DSNodeHandle &NH) { // duplicates are not allowed and both are sorted. This assumes that 'T's are // efficiently copyable and have sane comparison semantics. // -static void MergeSortedVectors(vector &Dest, - const vector &Src) { +static void MergeSortedVectors(std::vector &Dest, + const std::vector &Src) { // By far, the most common cases will be the simple ones. In these cases, // avoid having to allocate a temporary vector... // @@ -350,21 +348,21 @@ static void MergeSortedVectors(vector &Dest, Dest = Src; } else if (Src.size() == 1) { // Insert a single element... const GlobalValue *V = Src[0]; - vector::iterator I = + std::vector::iterator I = std::lower_bound(Dest.begin(), Dest.end(), V); if (I == Dest.end() || *I != Src[0]) // If not already contained... Dest.insert(I, Src[0]); } else if (Dest.size() == 1) { GlobalValue *Tmp = Dest[0]; // Save value in temporary... Dest = Src; // Copy over list... - vector::iterator I = + std::vector::iterator I = std::lower_bound(Dest.begin(), Dest.end(), Tmp); if (I == Dest.end() || *I != Tmp) // If not already contained... Dest.insert(I, Tmp); } else { // Make a copy to the side of Dest... - vector Old(Dest); + std::vector Old(Dest); // Make space for all of the type entries now... Dest.resize(Dest.size()+Src.size()); @@ -847,7 +845,7 @@ static inline bool nodeContainsExternalFunction(const DSNode *N) { return false; } -static void removeIdenticalCalls(vector &Calls, +static void removeIdenticalCalls(std::vector &Calls, const std::string &where) { // Remove trivially identical function calls unsigned NumFns = Calls.size(); @@ -1097,7 +1095,7 @@ void DSGraph::removeDeadNodes(unsigned Flags) { ScalarMap.erase(GlobalNodes[i].first); // Loop over all unreachable nodes, dropping their references... - vector DeadNodes; + std::vector DeadNodes; DeadNodes.reserve(Nodes.size()); // Only one allocation is allowed. for (unsigned i = 0; i != Nodes.size(); ++i) if (!Alive.count(Nodes[i])) { @@ -1211,7 +1209,7 @@ DSNode* GlobalDSGraph::cloneNodeInto(DSNode *OldNode, // void GlobalDSGraph::cloneCalls(DSGraph& Graph) { std::map NodeCache; - vector& FromCalls =Graph.FunctionCalls; + std::vector& FromCalls =Graph.FunctionCalls; FunctionCalls.reserve(FunctionCalls.size() + FromCalls.size()); diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp index 2df0fd434fa..b6e468c87c3 100644 --- a/lib/Analysis/DataStructure/Local.cpp +++ b/lib/Analysis/DataStructure/Local.cpp @@ -25,9 +25,6 @@ // #include "llvm/Module.h" -using std::map; -using std::vector; - static RegisterAnalysis X("datastructure", "Local Data Structure Analysis"); @@ -57,15 +54,15 @@ namespace { /// class GraphBuilder : InstVisitor { DSGraph &G; - vector &Nodes; + std::vector &Nodes; DSNodeHandle &RetNode; // Node that gets returned... - map &ScalarMap; - vector &FunctionCalls; + std::map &ScalarMap; + std::vector &FunctionCalls; public: - GraphBuilder(DSGraph &g, vector &nodes, DSNodeHandle &retNode, - map &SM, - vector &fc) + GraphBuilder(DSGraph &g, std::vector &nodes, DSNodeHandle &retNode, + std::map &SM, + std::vector &fc) : G(g), Nodes(nodes), RetNode(retNode), ScalarMap(SM), FunctionCalls(fc) { // Create scalar nodes for all pointer arguments... diff --git a/lib/Analysis/DataStructure/Printer.cpp b/lib/Analysis/DataStructure/Printer.cpp index d8856b83903..e9b5a179728 100644 --- a/lib/Analysis/DataStructure/Printer.cpp +++ b/lib/Analysis/DataStructure/Printer.cpp @@ -14,7 +14,6 @@ #include "Support/Statistic.h" #include #include -using std::string; // OnlyPrintMain - The DataStructure printer exposes this option to allow // printing of only the graph for "main". @@ -28,7 +27,7 @@ namespace { void DSNode::dump() const { print(std::cerr, 0); } -static string getCaption(const DSNode *N, const DSGraph *G) { +static std::string getCaption(const DSNode *N, const DSGraph *G) { std::stringstream OS; Module *M = G && &G->getFunction() ? G->getFunction().getParent() : 0; @@ -153,8 +152,9 @@ void DSGraph::print(std::ostream &O) const { WriteGraph(O, this, "DataStructures"); } -void DSGraph::writeGraphToFile(std::ostream &O, const string &GraphName) const { - string Filename = GraphName + ".dot"; +void DSGraph::writeGraphToFile(std::ostream &O, + const std::string &GraphName) const { + std::string Filename = GraphName + ".dot"; O << "Writing '" << Filename << "'..."; std::ofstream F(Filename.c_str()); @@ -170,7 +170,7 @@ void DSGraph::writeGraphToFile(std::ostream &O, const string &GraphName) const { template static void printCollection(const Collection &C, std::ostream &O, - const Module *M, const string &Prefix) { + const Module *M, const std::string &Prefix) { if (M == 0) { O << "Null Module pointer, cannot continue!\n"; return;