bool Error = false;
for (unsigned i = 0, e = tri_->getNumRegs(); i != e; ++i) {
if (regUse_[i] != 0) {
- cerr << tri_->getName(i) << " is still in use!\n";
+ errs() << tri_->getName(i) << " is still in use!\n";
Error = true;
}
}
#define DEBUG_TYPE "virtregrewriter"
#include "VirtRegRewriter.h"
+#include "llvm/Function.h"
+#include "llvm/CodeGen/MachineFrameInfo.h"
+#include "llvm/CodeGen/MachineInstrBuilder.h"
+#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/Support/Compiler.h"
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/Statistic.h"
-#include "llvm/ADT/STLExtras.h"
#include <algorithm>
using namespace llvm;
#ifndef LLVM_CODEGEN_VIRTREGREWRITER_H
#define LLVM_CODEGEN_VIRTREGREWRITER_H
-#include "llvm/Target/TargetRegisterInfo.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/IndexedMap.h"
-#include "llvm/ADT/SmallPtrSet.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/Support/Streams.h"
-#include "llvm/Function.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
-#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/MachineInstrBuilder.h"
-#include "llvm/CodeGen/MachineRegisterInfo.h"
-#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/Debug.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/DenseMap.h"
-#include "llvm/ADT/SmallSet.h"
#include "VirtRegMap.h"
-#include <map>
namespace llvm {
//===----------------------------------------------------------------------===//
#include "llvm/Support/StringPool.h"
-#include "llvm/Support/Streams.h"
#include "llvm/ADT/StringRef.h"
using namespace llvm;
#include "llvm/Pass.h"
#include "llvm/Function.h"
#include "llvm/ADT/StringExtras.h"
-#include "llvm/Support/Streams.h"
+#include "llvm/Support/raw_ostream.h"
#include "llvm/ADT/Statistic.h"
using namespace llvm;
HelloCounter++;
std::string fname = F.getName();
EscapeString(fname);
- cerr << "Hello: " << fname << "\n";
+ errs() << "Hello: " << fname << "\n";
return false;
}
};
HelloCounter++;
std::string fname = F.getName();
EscapeString(fname);
- cerr << "Hello: " << fname << "\n";
+ errs() << "Hello: " << fname << "\n";
return false;
}
//
//===----------------------------------------------------------------------===//
-#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
-#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
#include "llvm/Pass.h"
#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Streams.h"
+#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Instrumentation.h"
#include "RSProfiling.h"
#include "ProfilingUtils.h"
bool FunctionProfiler::runOnModule(Module &M) {
Function *Main = M.getFunction("main");
if (Main == 0) {
- cerr << "WARNING: cannot insert function profiling into a module"
- << " with no main function!\n";
+ errs() << "WARNING: cannot insert function profiling into a module"
+ << " with no main function!\n";
return false; // No main, no instrumentation!
}
bool BlockProfiler::runOnModule(Module &M) {
Function *Main = M.getFunction("main");
if (Main == 0) {
- cerr << "WARNING: cannot insert block profiling into a module"
- << " with no main function!\n";
+ errs() << "WARNING: cannot insert block profiling into a module"
+ << " with no main function!\n";
return false; // No main, no instrumentation!
}
//===----------------------------------------------------------------------===//
#include "ProfilingUtils.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
#include "llvm/Pass.h"
#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Streams.h"
+#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Instrumentation.h"
#include <set>
bool EdgeProfiler::runOnModule(Module &M) {
Function *Main = M.getFunction("main");
if (Main == 0) {
- cerr << "WARNING: cannot insert edge profiling into a module"
- << " with no main function!\n";
+ errs() << "WARNING: cannot insert edge profiling into a module"
+ << " with no main function!\n";
return false; // No main, no instrumentation!
}
#define DEBUG_TYPE "condprop"
#include "llvm/Transforms/Scalar.h"
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
#include "llvm/Instructions.h"
#include "llvm/IntrinsicInst.h"
#include "llvm/Pass.h"
#include "llvm/Type.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Local.h"
-#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/Compiler.h"
-#include "llvm/Support/Streams.h"
using namespace llvm;
STATISTIC(NumBrThread, "Number of CFG edges threaded through branches");
#include "llvm/ADT/FoldingSet.h"
#include "llvm/System/Atomic.h"
#include "llvm/System/Mutex.h"
-#include "llvm/Support/Streams.h"
#include "llvm/Support/ManagedStatic.h"
+#include "llvm/Support/raw_ostream.h"
using namespace llvm;
//===----------------------------------------------------------------------===//
}
void AttrListPtr::dump() const {
- cerr << "PAL[ ";
+ errs() << "PAL[ ";
for (unsigned i = 0; i < getNumSlots(); ++i) {
const AttributeWithIndex &PAWI = getSlot(i);
- cerr << "{" << PAWI.Index << "," << PAWI.Attrs << "} ";
+ errs() << "{" << PAWI.Index << "," << PAWI.Attrs << "} ";
}
- cerr << "]\n";
+ errs() << "]\n";
}
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/Streams.h"
#include "llvm/System/Mutex.h"
#include "llvm/System/Threading.h"
#include "llvm/Value.h"
// use non-short-circuit version so that both checks are performed
if (Objects->hasGarbage(Message) |
pImpl->LLVMObjects.hasGarbage(Message))
- cerr << "\nThis is probably because you removed an object, but didn't "
- << "delete it. Please check your code for memory leaks.\n";
+ errs() << "\nThis is probably because you removed an object, but didn't "
+ << "delete it. Please check your code for memory leaks.\n";
// Clear out results so we don't get duplicate warnings on
// next call...
#include "llvm/Module.h"
#include "llvm/ModuleProvider.h"
#include "llvm/Support/ErrorHandling.h"
-#include "llvm/Support/Streams.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/System/Mutex.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ManagedStatic.h"
-#include "llvm/Support/Streams.h"
+#include "llvm/Support/raw_ostream.h"
#include "llvm/System/RWMutex.h"
#include "llvm/System/Threading.h"
#include <algorithm>
#if DEBUG_SYMBOL_TABLE
dump();
- cerr << " Removing Value: " << Result->getName() << "\n";
+ errs() << " Removing Value: " << Result->getName() << "\n";
#endif
tmap.erase(Entry);
// list...
if (Result->isAbstract()) {
#if DEBUG_ABSTYPE
- cerr << "Removing abstract type from symtab"
- << Result->getDescription()
- << "\n";
+ errs() << "Removing abstract type from symtab"
+ << Result->getDescription()
+ << "\n";
#endif
cast<DerivedType>(Result)->removeAbstractTypeUser(this);
}
#if DEBUG_SYMBOL_TABLE
dump();
- cerr << " Inserted type: " << Name << ": " << T->getDescription() << "\n";
+ errs() << " Inserted type: " << Name << ": " << T->getDescription() << "\n";
#endif
} else {
// If there is a name conflict...
#if DEBUG_SYMBOL_TABLE
dump();
- cerr << " Inserting type: " << UniqueName << ": "
- << T->getDescription() << "\n";
+ errs() << " Inserting type: " << UniqueName << ": "
+ << T->getDescription() << "\n";
#endif
// Insert the tmap entry
if (T->isAbstract()) {
cast<DerivedType>(T)->addAbstractTypeUser(this);
#if DEBUG_ABSTYPE
- cerr << "Added abstract type to ST: " << T->getDescription() << "\n";
+ errs() << "Added abstract type to ST: " << T->getDescription() << "\n";
#endif
}
}
for (iterator I = begin(), E = end(); I != E; ++I) {
if (I->second == (Type*)OldType) { // FIXME when Types aren't const.
#if DEBUG_ABSTYPE
- cerr << "Removing type " << OldType->getDescription() << "\n";
+ errs() << "Removing type " << OldType->getDescription() << "\n";
#endif
OldType->removeAbstractTypeUser(this);
I->second = (Type*)NewType; // TODO FIXME when types aren't const
if (NewType->isAbstract()) {
#if DEBUG_ABSTYPE
- cerr << "Added type " << NewType->getDescription() << "\n";
+ errs() << "Added type " << NewType->getDescription() << "\n";
#endif
cast<DerivedType>(NewType)->addAbstractTypeUser(this);
}
}
static void DumpTypes(const std::pair<const std::string, const Type*>& T ) {
- cerr << " '" << T.first << "' = ";
+ errs() << " '" << T.first << "' = ";
T.second->dump();
- cerr << "\n";
+ errs() << "\n";
}
void TypeSymbolTable::dump() const {
- cerr << "TypeSymbolPlane: ";
+ errs() << "TypeSymbolPlane: ";
sys::SmartScopedReader<true> Reader(*TypeSymbolTableLock);
for_each(tmap.begin(), tmap.end(), DumpTypes);
}
#include "llvm/Support/CallSite.h"
#include "llvm/Support/CFG.h"
#include "llvm/Support/InstVisitor.h"
-#include "llvm/Support/Streams.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
for (Function::iterator I = F.begin(), E = F.end(); I != E; ++I) {
if (I->empty() || !I->back().isTerminator()) {
- cerr << "Basic Block does not have terminator!\n";
+ errs() << "Basic Block does not have terminator!\n";
WriteAsOperand(errs(), I, true);
- cerr << "\n";
+ errs() << "\n";
Broken = true;
}
}