From 597d451feace38e5847a26719eafd93db3d82684 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 28 Nov 2006 22:46:12 +0000 Subject: Removed some of the iostream #includes. Moved towards converting to using llvm streams llvm-svn: 31983 --- llvm/lib/Analysis/ProfileInfoLoader.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'llvm/lib/Analysis/ProfileInfoLoader.cpp') diff --git a/llvm/lib/Analysis/ProfileInfoLoader.cpp b/llvm/lib/Analysis/ProfileInfoLoader.cpp index 15e9c1338c6..3c19f5e9b9f 100644 --- a/llvm/lib/Analysis/ProfileInfoLoader.cpp +++ b/llvm/lib/Analysis/ProfileInfoLoader.cpp @@ -16,10 +16,9 @@ #include "llvm/Analysis/ProfileInfoTypes.h" #include "llvm/Module.h" #include "llvm/InstrTypes.h" +#include "llvm/Support/Streams.h" #include -#include #include - using namespace llvm; // ByteSwap - Byteswap 'Var' if 'Really' is true. @@ -38,7 +37,7 @@ static void ReadProfilingBlock(const char *ToolName, FILE *F, // Read the number of entries... unsigned NumEntries; if (fread(&NumEntries, sizeof(unsigned), 1, F) != 1) { - std::cerr << ToolName << ": data packet truncated!\n"; + llvm_cerr << ToolName << ": data packet truncated!\n"; perror(0); exit(1); } @@ -49,7 +48,7 @@ static void ReadProfilingBlock(const char *ToolName, FILE *F, // Read in the block of data... if (fread(&TempSpace[0], sizeof(unsigned)*NumEntries, 1, F) != 1) { - std::cerr << ToolName << ": data packet truncated!\n"; + llvm_cerr << ToolName << ": data packet truncated!\n"; perror(0); exit(1); } @@ -76,7 +75,7 @@ ProfileInfoLoader::ProfileInfoLoader(const char *ToolName, Module &TheModule) : M(TheModule) { FILE *F = fopen(Filename.c_str(), "r"); if (F == 0) { - std::cerr << ToolName << ": Error opening '" << Filename << "': "; + llvm_cerr << ToolName << ": Error opening '" << Filename << "': "; perror(0); exit(1); } @@ -94,7 +93,7 @@ ProfileInfoLoader::ProfileInfoLoader(const char *ToolName, case ArgumentInfo: { unsigned ArgLength; if (fread(&ArgLength, sizeof(unsigned), 1, F) != 1) { - std::cerr << ToolName << ": arguments packet truncated!\n"; + llvm_cerr << ToolName << ": arguments packet truncated!\n"; perror(0); exit(1); } @@ -105,7 +104,7 @@ ProfileInfoLoader::ProfileInfoLoader(const char *ToolName, if (ArgLength) if (fread(&Chars[0], (ArgLength+3) & ~3, 1, F) != 1) { - std::cerr << ToolName << ": arguments packet truncated!\n"; + llvm_cerr << ToolName << ": arguments packet truncated!\n"; perror(0); exit(1); } @@ -130,7 +129,7 @@ ProfileInfoLoader::ProfileInfoLoader(const char *ToolName, break; default: - std::cerr << ToolName << ": Unknown packet type #" << PacketType << "!\n"; + llvm_cerr << ToolName << ": Unknown packet type #" << PacketType << "!\n"; exit(1); } } @@ -157,7 +156,7 @@ void ProfileInfoLoader::getFunctionCounts(std::vectorgetParent(), BlockCounts[i].second)); } else { - std::cerr << "Function counts are not available!\n"; + llvm_cerr << "Function counts are not available!\n"; } return; } @@ -201,7 +200,7 @@ void ProfileInfoLoader::getBlockCounts(std::vector= TI->getNumSuccessors()) { static bool Warned = false; if (!Warned) { - std::cerr << "WARNING: profile info doesn't seem to match" + llvm_cerr << "WARNING: profile info doesn't seem to match" << " the program!\n"; Warned = true; } @@ -227,7 +226,7 @@ void ProfileInfoLoader::getBlockCounts(std::vector > &Counts) { if (EdgeCounts.empty()) { - std::cerr << "Edge counts not available, and no synthesis " + llvm_cerr << "Edge counts not available, and no synthesis " << "is implemented yet!\n"; return; } @@ -269,9 +268,9 @@ void ProfileInfoLoader::getEdgeCounts(std::vector &Trace) { if (BBTrace.empty ()) { - std::cerr << "Basic block trace is not available!\n"; + llvm_cerr << "Basic block trace is not available!\n"; return; } - std::cerr << "Basic block trace loading is not implemented yet!\n"; + llvm_cerr << "Basic block trace loading is not implemented yet!\n"; } -- cgit v1.2.3