1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Fine-grainify namespaces for this library

llvm-svn: 9948
This commit is contained in:
Chris Lattner 2003-11-12 23:11:14 +00:00
parent c270643f35
commit b60823472a
10 changed files with 14 additions and 36 deletions

View File

@ -19,8 +19,7 @@
#include "Support/Statistic.h" #include "Support/Statistic.h"
#include "Support/Debug.h" #include "Support/Debug.h"
#include "DSCallSiteIterator.h" #include "DSCallSiteIterator.h"
using namespace llvm;
namespace llvm {
namespace { namespace {
Statistic<> MaxSCC("budatastructure", "Maximum SCC Size in Call Graph"); Statistic<> MaxSCC("budatastructure", "Maximum SCC Size in Call Graph");
@ -317,5 +316,3 @@ void BUDataStructures::calculateGraph(DSGraph &Graph) {
//Graph.writeGraphToFile(std::cerr, "bu_" + F.getName()); //Graph.writeGraphToFile(std::cerr, "bu_" + F.getName());
} }
} // End llvm namespace

View File

@ -22,8 +22,7 @@
#include "Support/Statistic.h" #include "Support/Statistic.h"
#include "Support/Timer.h" #include "Support/Timer.h"
#include <algorithm> #include <algorithm>
using namespace llvm;
namespace llvm {
namespace { namespace {
Statistic<> NumFolds ("dsnode", "Number of nodes completely folded"); Statistic<> NumFolds ("dsnode", "Number of nodes completely folded");
@ -1672,5 +1671,3 @@ void DSGraph::computeNodeMapping(const DSNodeHandle &NH1,
if (unsigned(N2Idx)+i < N2Size) if (unsigned(N2Idx)+i < N2Size)
computeNodeMapping(N1->getLink(i), N2->getLink(N2Idx+i), NodeMap); computeNodeMapping(N1->getLink(i), N2->getLink(N2Idx+i), NodeMap);
} }
} // End llvm namespace

View File

@ -16,8 +16,7 @@
#include "llvm/Analysis/DSGraph.h" #include "llvm/Analysis/DSGraph.h"
#include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Module.h" #include "llvm/Module.h"
using namespace llvm;
namespace llvm {
namespace { namespace {
class DSAA : public Pass, public AliasAnalysis { class DSAA : public Pass, public AliasAnalysis {
@ -179,4 +178,3 @@ void DSAA::getMustAliases(Value *P, std::vector<Value*> &RetVals) {
return getAnalysis<AliasAnalysis>().getMustAliases(P, RetVals); return getAnalysis<AliasAnalysis>().getMustAliases(P, RetVals);
} }
} // End llvm namespace

View File

@ -17,8 +17,7 @@
#include "llvm/Module.h" #include "llvm/Module.h"
#include "llvm/Constant.h" #include "llvm/Constant.h"
#include "Support/Statistic.h" #include "Support/Statistic.h"
using namespace llvm;
namespace llvm {
namespace { namespace {
Statistic<> Statistic<>
@ -97,5 +96,3 @@ bool DSOpt::OptimizeGlobals(Module &M) {
} }
return Changed; return Changed;
} }
} // End llvm namespace

View File

@ -18,8 +18,7 @@
#include "llvm/Support/InstVisitor.h" #include "llvm/Support/InstVisitor.h"
#include "Support/Statistic.h" #include "Support/Statistic.h"
#include <vector> #include <vector>
using namespace llvm;
namespace llvm {
namespace { namespace {
Statistic<> TotalNumCallees("totalcallees", Statistic<> TotalNumCallees("totalcallees",
@ -141,5 +140,3 @@ bool DSGraphStats::runOnFunction(Function& F) {
visit(F); visit(F);
return true; return true;
} }
} // End llvm namespace

View File

@ -29,7 +29,7 @@
#include "llvm/Value.h" #include "llvm/Value.h"
#include <set> #include <set>
namespace llvm { using namespace llvm;
namespace { namespace {
enum DSPass { local, bu, td }; enum DSPass { local, bu, td };
@ -195,5 +195,3 @@ void DSGC::verify(const DSGraph &G) {
} }
} }
} }
} // End llvm namespace

View File

@ -28,11 +28,12 @@
// //
#include "llvm/Module.h" #include "llvm/Module.h"
namespace llvm { using namespace llvm;
static RegisterAnalysis<LocalDataStructures> static RegisterAnalysis<LocalDataStructures>
X("datastructure", "Local Data Structure Analysis"); X("datastructure", "Local Data Structure Analysis");
namespace llvm {
namespace DS { namespace DS {
// isPointerType - Return true if this type is big enough to hold a pointer. // isPointerType - Return true if this type is big enough to hold a pointer.
bool isPointerType(const Type *Ty) { bool isPointerType(const Type *Ty) {
@ -42,7 +43,7 @@ namespace DS {
return Ty->getPrimitiveSize() >= PointerSize; return Ty->getPrimitiveSize() >= PointerSize;
return false; return false;
} }
} }}
using namespace DS; using namespace DS;
@ -622,4 +623,3 @@ void LocalDataStructures::releaseMemory() {
GlobalsGraph = 0; GlobalsGraph = 0;
} }
} // End llvm namespace

View File

@ -22,8 +22,7 @@
#include "Support/Statistic.h" #include "Support/Statistic.h"
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
using namespace llvm;
namespace llvm {
// OnlyPrintMain - The DataStructure printer exposes this option to allow // OnlyPrintMain - The DataStructure printer exposes this option to allow
// printing of only the graph for "main". // printing of only the graph for "main".
@ -73,6 +72,7 @@ static std::string getCaption(const DSNode *N, const DSGraph *G) {
return OS.str(); return OS.str();
} }
namespace llvm {
template<> template<>
struct DOTGraphTraits<const DSGraph*> : public DefaultDOTGraphTraits { struct DOTGraphTraits<const DSGraph*> : public DefaultDOTGraphTraits {
static std::string getGraphName(const DSGraph *G) { static std::string getGraphName(const DSGraph *G) {
@ -179,6 +179,7 @@ struct DOTGraphTraits<const DSGraph*> : public DefaultDOTGraphTraits {
} }
} }
}; };
} // end namespace llvm
void DSNode::print(std::ostream &O, const DSGraph *G) const { void DSNode::print(std::ostream &O, const DSGraph *G) const {
GraphWriter<const DSGraph *> W(O, G); GraphWriter<const DSGraph *> W(O, G);
@ -282,4 +283,3 @@ void TDDataStructures::print(std::ostream &O, const Module *M) const {
printCollection(*this, O, M, "td."); printCollection(*this, O, M, "td.");
} }
} // End llvm namespace

View File

@ -19,8 +19,7 @@
#include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Module.h" #include "llvm/Module.h"
#include "Support/Debug.h" #include "Support/Debug.h"
using namespace llvm;
namespace llvm {
namespace { namespace {
class Steens : public Pass, public AliasAnalysis { class Steens : public Pass, public AliasAnalysis {
@ -236,5 +235,3 @@ AliasAnalysis::AliasResult Steens::alias(const Value *V1, unsigned V1Size,
// //
return getAnalysis<AliasAnalysis>().alias(V1, V1Size, V2, V2Size); return getAnalysis<AliasAnalysis>().alias(V1, V1Size, V2, V2Size);
} }
} // End llvm namespace

View File

@ -20,8 +20,7 @@
#include "llvm/Analysis/DSGraph.h" #include "llvm/Analysis/DSGraph.h"
#include "Support/Debug.h" #include "Support/Debug.h"
#include "Support/Statistic.h" #include "Support/Statistic.h"
using namespace llvm;
namespace llvm {
namespace { namespace {
RegisterAnalysis<TDDataStructures> // Register the pass RegisterAnalysis<TDDataStructures> // Register the pass
@ -311,5 +310,3 @@ void TDDataStructures::inlineGraphIntoCallees(DSGraph &Graph) {
<< Graph.getFunctionNames() << " [" << Graph.getGraphSize() << "+" << Graph.getFunctionNames() << " [" << Graph.getGraphSize() << "+"
<< Graph.getFunctionCalls().size() << "]\n"); << Graph.getFunctionCalls().size() << "]\n");
} }
} // End llvm namespace