Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are

now cerr, cout, and NullStream resp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32298 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Bill Wendling
2006-12-07 01:30:32 +00:00
parent 85c671b908
commit e81561909d
112 changed files with 1853 additions and 1688 deletions

View File

@@ -693,8 +693,8 @@ static void ConvertOperandToType(User *U, Value *OldVal, Value *NewVal,
I->setName("");
Instruction *Res; // Result of conversion
//llvm_cerr << endl << endl << "Type:\t" << Ty << "\nInst: " << I
// << "BB Before: " << BB << endl;
//cerr << endl << endl << "Type:\t" << Ty << "\nInst: " << I
// << "BB Before: " << BB << endl;
// Prevent I from being removed...
ValueHandle IHandle(VMC, I);

View File

@@ -30,7 +30,7 @@ namespace {
HelloCounter++;
std::string fname = F.getName();
EscapeString(fname);
llvm_cerr << "Hello: " << fname << "\n";
cerr << "Hello: " << fname << "\n";
return false;
}
};
@@ -43,7 +43,7 @@ namespace {
HelloCounter++;
std::string fname = F.getName();
EscapeString(fname);
llvm_cerr << "Hello: " << fname << "\n";
cerr << "Hello: " << fname << "\n";
return false;
}

View File

@@ -494,17 +494,17 @@ static bool AllUsesOfValueWillTrapIfNull(Value *V) {
// Will trap.
} else if (StoreInst *SI = dyn_cast<StoreInst>(*UI)) {
if (SI->getOperand(0) == V) {
//llvm_cerr << "NONTRAPPING USE: " << **UI;
//cerr << "NONTRAPPING USE: " << **UI;
return false; // Storing the value.
}
} else if (CallInst *CI = dyn_cast<CallInst>(*UI)) {
if (CI->getOperand(0) != V) {
//llvm_cerr << "NONTRAPPING USE: " << **UI;
//cerr << "NONTRAPPING USE: " << **UI;
return false; // Not calling the ptr
}
} else if (InvokeInst *II = dyn_cast<InvokeInst>(*UI)) {
if (II->getOperand(0) != V) {
//llvm_cerr << "NONTRAPPING USE: " << **UI;
//cerr << "NONTRAPPING USE: " << **UI;
return false; // Not calling the ptr
}
} else if (CastInst *CI = dyn_cast<CastInst>(*UI)) {
@@ -515,7 +515,7 @@ static bool AllUsesOfValueWillTrapIfNull(Value *V) {
isa<ConstantPointerNull>(UI->getOperand(1))) {
// Ignore setcc X, null
} else {
//llvm_cerr << "NONTRAPPING USE: " << **UI;
//cerr << "NONTRAPPING USE: " << **UI;
return false;
}
return true;
@@ -533,7 +533,7 @@ static bool AllUsesOfLoadedValueWillTrapIfNull(GlobalVariable *GV) {
// Ignore stores to the global.
} else {
// We don't know or understand this user, bail out.
//llvm_cerr << "UNKNOWN USER OF GLOBAL!: " << **UI;
//cerr << "UNKNOWN USER OF GLOBAL!: " << **UI;
return false;
}
@@ -1206,25 +1206,25 @@ bool GlobalOpt::ProcessInternalGlobal(GlobalVariable *GV,
if (!AnalyzeGlobal(GV, GS, PHIUsers)) {
#if 0
llvm_cerr << "Global: " << *GV;
llvm_cerr << " isLoaded = " << GS.isLoaded << "\n";
llvm_cerr << " StoredType = ";
cerr << "Global: " << *GV;
cerr << " isLoaded = " << GS.isLoaded << "\n";
cerr << " StoredType = ";
switch (GS.StoredType) {
case GlobalStatus::NotStored: llvm_cerr << "NEVER STORED\n"; break;
case GlobalStatus::isInitializerStored: llvm_cerr << "INIT STORED\n"; break;
case GlobalStatus::isStoredOnce: llvm_cerr << "STORED ONCE\n"; break;
case GlobalStatus::isStored: llvm_cerr << "stored\n"; break;
case GlobalStatus::NotStored: cerr << "NEVER STORED\n"; break;
case GlobalStatus::isInitializerStored: cerr << "INIT STORED\n"; break;
case GlobalStatus::isStoredOnce: cerr << "STORED ONCE\n"; break;
case GlobalStatus::isStored: cerr << "stored\n"; break;
}
if (GS.StoredType == GlobalStatus::isStoredOnce && GS.StoredOnceValue)
llvm_cerr << " StoredOnceValue = " << *GS.StoredOnceValue << "\n";
cerr << " StoredOnceValue = " << *GS.StoredOnceValue << "\n";
if (GS.AccessingFunction && !GS.HasMultipleAccessingFunctions)
llvm_cerr << " AccessingFunction = " << GS.AccessingFunction->getName()
cerr << " AccessingFunction = " << GS.AccessingFunction->getName()
<< "\n";
llvm_cerr << " HasMultipleAccessingFunctions = "
cerr << " HasMultipleAccessingFunctions = "
<< GS.HasMultipleAccessingFunctions << "\n";
llvm_cerr << " HasNonInstructionUser = " << GS.HasNonInstructionUser<<"\n";
llvm_cerr << " isNotSuitableForSRA = " << GS.isNotSuitableForSRA << "\n";
llvm_cerr << "\n";
cerr << " HasNonInstructionUser = " << GS.HasNonInstructionUser<<"\n";
cerr << " isNotSuitableForSRA = " << GS.isNotSuitableForSRA << "\n";
cerr << "\n";
#endif
// If this is a first class global and has only one accessing function

View File

@@ -74,8 +74,7 @@ void InternalizePass::LoadFile(const char *Filename) {
// Load the APIFile...
std::ifstream In(Filename);
if (!In.good()) {
llvm_cerr << "WARNING: Internalize couldn't load file '" << Filename
<< "'!\n";
cerr << "WARNING: Internalize couldn't load file '" << Filename << "'!\n";
return; // Do not internalize anything...
}
while (In) {

View File

@@ -47,8 +47,8 @@ ModulePass *llvm::createFunctionProfilerPass() {
bool FunctionProfiler::runOnModule(Module &M) {
Function *Main = M.getMainFunction();
if (Main == 0) {
llvm_cerr << "WARNING: cannot insert function profiling into a module"
<< " with no main function!\n";
cerr << "WARNING: cannot insert function profiling into a module"
<< " with no main function!\n";
return false; // No main, no instrumentation!
}
@@ -90,8 +90,8 @@ ModulePass *llvm::createBlockProfilerPass() { return new BlockProfiler(); }
bool BlockProfiler::runOnModule(Module &M) {
Function *Main = M.getMainFunction();
if (Main == 0) {
llvm_cerr << "WARNING: cannot insert block profiling into a module"
<< " with no main function!\n";
cerr << "WARNING: cannot insert block profiling into a module"
<< " with no main function!\n";
return false; // No main, no instrumentation!
}

View File

@@ -17,6 +17,7 @@
//
//===----------------------------------------------------------------------===//
#include "ProfilingUtils.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
@@ -24,7 +25,6 @@
#include "llvm/Support/Streams.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Instrumentation.h"
#include "ProfilingUtils.h"
#include <set>
using namespace llvm;
@@ -42,8 +42,8 @@ ModulePass *llvm::createEdgeProfilerPass() { return new EdgeProfiler(); }
bool EdgeProfiler::runOnModule(Module &M) {
Function *Main = M.getMainFunction();
if (Main == 0) {
llvm_cerr << "WARNING: cannot insert edge profiling into a module"
<< " with no main function!\n";
cerr << "WARNING: cannot insert edge profiling into a module"
<< " with no main function!\n";
return false; // No main, no instrumentation!
}

View File

@@ -13,6 +13,7 @@
//
//===----------------------------------------------------------------------===//
#include "ProfilingUtils.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
@@ -20,7 +21,6 @@
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Instrumentation.h"
#include "llvm/Instructions.h"
#include "ProfilingUtils.h"
#include "llvm/Support/Debug.h"
#include <set>
using namespace llvm;
@@ -61,8 +61,8 @@ static void InsertInstrumentationCall (BasicBlock *BB,
bool TraceBasicBlocks::runOnModule(Module &M) {
Function *Main = M.getMainFunction();
if (Main == 0) {
llvm_cerr << "WARNING: cannot insert basic-block trace instrumentation"
<< " into a module with no main function!\n";
cerr << "WARNING: cannot insert basic-block trace instrumentation"
<< " into a module with no main function!\n";
return false; // No main, no instrumentation!
}

View File

@@ -7018,8 +7018,8 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
// If we are removing arguments to the function, emit an obnoxious warning...
if (FT->getNumParams() < NumActualArgs)
if (!FT->isVarArg()) {
llvm_cerr << "WARNING: While resolving call to function '"
<< Callee->getName() << "' arguments were dropped!\n";
cerr << "WARNING: While resolving call to function '"
<< Callee->getName() << "' arguments were dropped!\n";
} else {
// Add all of the arguments in their promoted form to the arg list...
for (unsigned i = FT->getNumParams(); i != NumActualArgs; ++i, ++AI) {

View File

@@ -507,12 +507,12 @@ namespace {
}
void BasedUser::dump() const {
llvm_cerr << " Base=" << *Base;
llvm_cerr << " Imm=" << *Imm;
cerr << " Base=" << *Base;
cerr << " Imm=" << *Imm;
if (EmittedBase)
llvm_cerr << " EB=" << *EmittedBase;
cerr << " EB=" << *EmittedBase;
llvm_cerr << " Inst: " << *Inst;
cerr << " Inst: " << *Inst;
}
Value *BasedUser::InsertCodeForBaseAtPosition(const SCEVHandle &NewBase,

View File

@@ -73,8 +73,7 @@ public:
/// @param I the unhandled instruction
void visitInstruction(Instruction &I) {
if (isa<PackedType>(I.getType()))
llvm_cerr << "Unhandled Instruction with Packed ReturnType: "
<< I << '\n';
cerr << "Unhandled Instruction with Packed ReturnType: " << I << '\n';
}
private:
/// @brief Retrieves lowered values for a packed value.

View File

@@ -350,7 +350,7 @@ private:
void visitInstruction(Instruction &I) {
// If a new instruction is added to LLVM that we don't handle...
llvm_cerr << "SCCP: Don't know how to handle: " << I;
cerr << "SCCP: Don't know how to handle: " << I;
markOverdefined(&I); // Just in case
}
};
@@ -400,7 +400,7 @@ void SCCPSolver::getFeasibleSuccessors(TerminatorInst &TI,
Succs[0] = true;
}
} else {
llvm_cerr << "SCCP: Don't know how to handle: " << TI;
cerr << "SCCP: Don't know how to handle: " << TI;
Succs.assign(TI.getNumSuccessors(), true);
}
}
@@ -459,7 +459,7 @@ bool SCCPSolver::isEdgeFeasible(BasicBlock *From, BasicBlock *To) {
}
return false;
} else {
llvm_cerr << "Unknown terminator instruction: " << *TI;
cerr << "Unknown terminator instruction: " << *TI;
abort();
}
}

View File

@@ -699,10 +699,10 @@ ExtractCodeRegion(const std::vector<BasicBlock*> &code) {
}
}
//llvm_cerr << "NEW FUNCTION: " << *newFunction;
//cerr << "NEW FUNCTION: " << *newFunction;
// verifyFunction(*newFunction);
// llvm_cerr << "OLD FUNCTION: " << *oldFunction;
// cerr << "OLD FUNCTION: " << *oldFunction;
// verifyFunction(*oldFunction);
DEBUG(if (verifyFunction(*newFunction)) abort());

View File

@@ -96,8 +96,7 @@ bool LowerSwitch::runOnFunction(Function &F) {
// operator<< - Used for debugging purposes.
//
llvm_ostream& operator<<(llvm_ostream &O,
const std::vector<LowerSwitch::Case> &C) {
OStream& operator<<(OStream &O, const std::vector<LowerSwitch::Case> &C) {
O << "[";
for (std::vector<LowerSwitch::Case>::const_iterator B = C.begin(),