[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/Local.cpp Printer.cpp Steensgaard.cpp
Bill Wendling
isanbard at gmail.com
Tue Nov 28 16:20:28 PST 2006
Changes in directory llvm/lib/Analysis/DataStructure:
Local.cpp updated: 1.161 -> 1.162
Printer.cpp updated: 1.87 -> 1.88
Steensgaard.cpp updated: 1.65 -> 1.66
---
Log message:
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.
---
Diffs of the changes: (+10 -7)
Local.cpp | 5 ++---
Printer.cpp | 5 +++--
Steensgaard.cpp | 7 +++++--
3 files changed, 10 insertions(+), 7 deletions(-)
Index: llvm/lib/Analysis/DataStructure/Local.cpp
diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.161 llvm/lib/Analysis/DataStructure/Local.cpp:1.162
--- llvm/lib/Analysis/DataStructure/Local.cpp:1.161 Sun Nov 26 19:05:09 2006
+++ llvm/lib/Analysis/DataStructure/Local.cpp Tue Nov 28 18:19:40 2006
@@ -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 @@
// 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 @@
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?
}
}
Index: llvm/lib/Analysis/DataStructure/Printer.cpp
diff -u llvm/lib/Analysis/DataStructure/Printer.cpp:1.87 llvm/lib/Analysis/DataStructure/Printer.cpp:1.88
--- llvm/lib/Analysis/DataStructure/Printer.cpp:1.87 Fri Nov 17 03:44:28 2006
+++ llvm/lib/Analysis/DataStructure/Printer.cpp Tue Nov 28 18:19:40 2006
@@ -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 @@
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;
Index: llvm/lib/Analysis/DataStructure/Steensgaard.cpp
diff -u llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.65 llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.66
--- llvm/lib/Analysis/DataStructure/Steensgaard.cpp:1.65 Sun Aug 27 20:02:49 2006
+++ llvm/lib/Analysis/DataStructure/Steensgaard.cpp Tue Nov 28 18:19:40 2006
@@ -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 @@
}
// 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 @@
// 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;
}
More information about the llvm-commits
mailing list