diff options
author | Bill Wendling <isanbard@gmail.com> | 2006-11-29 00:19:40 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2006-11-29 00:19:40 +0000 |
commit | 68fe61d6a165ea6090008e281330895a21607daf (patch) | |
tree | 2e0cc1cbd16099aed908dbb3ecda16cf57d04300 /lib/Analysis/DataStructure | |
parent | a5b31ca85686062408bca0f0a8aa43f9fe58e644 (diff) |
Replacing std::iostreams with llvm iostreams. Some of these changes involve
adding a temporary wrapper around the ostream to make it friendly to
functions expecting an LLVM stream. This should be fixed in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31990 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure')
-rw-r--r-- | lib/Analysis/DataStructure/Local.cpp | 5 | ||||
-rw-r--r-- | lib/Analysis/DataStructure/Printer.cpp | 5 | ||||
-rw-r--r-- | lib/Analysis/DataStructure/Steensgaard.cpp | 7 |
3 files changed, 10 insertions, 7 deletions
diff --git a/lib/Analysis/DataStructure/Local.cpp b/lib/Analysis/DataStructure/Local.cpp index 34947371c65..436218be9e1 100644 --- a/lib/Analysis/DataStructure/Local.cpp +++ b/lib/Analysis/DataStructure/Local.cpp @@ -24,7 +24,6 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Timer.h" -#include <iostream> // FIXME: This should eventually be a FunctionPass that is automatically // aggregated into a Pass. @@ -435,7 +434,7 @@ void GraphBuilder::visitGetElementPtrInst(User &GEP) { // Variable index into a node. We must merge all of the elements of the // sequential type here. if (isa<PointerType>(STy)) - std::cerr << "Pointer indexing not handled yet!\n"; + llvm_cerr << "Pointer indexing not handled yet!\n"; else { const ArrayType *ATy = cast<ArrayType>(STy); unsigned ElSize = TD.getTypeSize(CurTy); @@ -1062,7 +1061,7 @@ void GraphBuilder::visitCallSite(CallSite CS) { if (DisableDirectCallOpt || !isa<Function>(Callee)) { CalleeNode = getValueDest(*Callee).getNode(); if (CalleeNode == 0) { - std::cerr << "WARNING: Program is calling through a null pointer?\n"<< *I; + llvm_cerr << "WARNING: Program is calling through a null pointer?\n"<< *I; return; // Calling a null pointer? } } diff --git a/lib/Analysis/DataStructure/Printer.cpp b/lib/Analysis/DataStructure/Printer.cpp index b425e4e4729..ef3ed755559 100644 --- a/lib/Analysis/DataStructure/Printer.cpp +++ b/lib/Analysis/DataStructure/Printer.cpp @@ -19,9 +19,10 @@ #include "llvm/Assembly/Writer.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/GraphWriter.h" +#include "llvm/Support/Streams.h" #include "llvm/ADT/Statistic.h" #include "llvm/Config/config.h" -#include <iostream> +#include <ostream> #include <fstream> #include <sstream> using namespace llvm; @@ -36,7 +37,7 @@ namespace { Statistic<> NumFoldedNodes ("dsa", "Number of folded nodes (in final graph)"); } -void DSNode::dump() const { print(std::cerr, 0); } +void DSNode::dump() const { print(llvm_cerr, 0); } static std::string getCaption(const DSNode *N, const DSGraph *G) { std::stringstream OS; diff --git a/lib/Analysis/DataStructure/Steensgaard.cpp b/lib/Analysis/DataStructure/Steensgaard.cpp index eb5b74ca022..292dfffa0dc 100644 --- a/lib/Analysis/DataStructure/Steensgaard.cpp +++ b/lib/Analysis/DataStructure/Steensgaard.cpp @@ -20,7 +20,7 @@ #include "llvm/Analysis/Passes.h" #include "llvm/Module.h" #include "llvm/Support/Debug.h" -#include <iostream> +#include <ostream> using namespace llvm; namespace { @@ -53,6 +53,9 @@ namespace { } // print - Implement the Pass::print method... + void print(llvm_ostream O, const Module *M) const { + if (O.stream()) print(*O.stream(), M); + } void print(std::ostream &O, const Module *M) const { assert(ResultGraph && "Result graph has not yet been computed!"); ResultGraph->writeGraphToFile(O, "steensgaards"); @@ -188,7 +191,7 @@ bool Steens::runOnModule(Module &M) { // FIXME: We should be able to disable the globals graph for steens! //ResultGraph->removeDeadNodes(DSGraph::KeepUnreachableGlobals); - DEBUG(print(std::cerr, &M)); + print(DOUT, &M); return false; } |