Changed to using llvm streams.

llvm-svn: 31954
This commit is contained in:
Bill Wendling 2006-11-28 02:08:17 +00:00
parent cd2f1a897f
commit 3f6f0fd028
2 changed files with 14 additions and 15 deletions

View File

@ -11,14 +11,13 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "llvm/CodeGen/IntrinsicLowering.h"
#include "llvm/Constants.h" #include "llvm/Constants.h"
#include "llvm/DerivedTypes.h" #include "llvm/DerivedTypes.h"
#include "llvm/Module.h" #include "llvm/Module.h"
#include "llvm/Instructions.h" #include "llvm/Instructions.h"
#include "llvm/Type.h" #include "llvm/Type.h"
#include <iostream> #include "llvm/CodeGen/IntrinsicLowering.h"
#include "llvm/Support/Streams.h"
using namespace llvm; using namespace llvm;
template <class ArgIt> template <class ArgIt>
@ -275,11 +274,11 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
switch (Callee->getIntrinsicID()) { switch (Callee->getIntrinsicID()) {
case Intrinsic::not_intrinsic: case Intrinsic::not_intrinsic:
std::cerr << "Cannot lower a call to a non-intrinsic function '" llvm_cerr << "Cannot lower a call to a non-intrinsic function '"
<< Callee->getName() << "'!\n"; << Callee->getName() << "'!\n";
abort(); abort();
default: default:
std::cerr << "Error: Code generator does not support intrinsic function '" llvm_cerr << "Error: Code generator does not support intrinsic function '"
<< Callee->getName() << "'!\n"; << Callee->getName() << "'!\n";
abort(); abort();
@ -357,9 +356,9 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
case Intrinsic::stackrestore: { case Intrinsic::stackrestore: {
static bool Warned = false; static bool Warned = false;
if (!Warned) if (!Warned)
std::cerr << "WARNING: this target does not support the llvm.stack" llvm_cerr << "WARNING: this target does not support the llvm.stack"
<< (Callee->getIntrinsicID() == Intrinsic::stacksave ? << (Callee->getIntrinsicID() == Intrinsic::stacksave ?
"save" : "restore") << " intrinsic.\n"; "save" : "restore") << " intrinsic.\n";
Warned = true; Warned = true;
if (Callee->getIntrinsicID() == Intrinsic::stacksave) if (Callee->getIntrinsicID() == Intrinsic::stacksave)
CI->replaceAllUsesWith(Constant::getNullValue(CI->getType())); CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
@ -368,7 +367,7 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
case Intrinsic::returnaddress: case Intrinsic::returnaddress:
case Intrinsic::frameaddress: case Intrinsic::frameaddress:
std::cerr << "WARNING: this target does not support the llvm." llvm_cerr << "WARNING: this target does not support the llvm."
<< (Callee->getIntrinsicID() == Intrinsic::returnaddress ? << (Callee->getIntrinsicID() == Intrinsic::returnaddress ?
"return" : "frame") << "address intrinsic.\n"; "return" : "frame") << "address intrinsic.\n";
CI->replaceAllUsesWith(ConstantPointerNull::get( CI->replaceAllUsesWith(ConstantPointerNull::get(
@ -381,7 +380,7 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
case Intrinsic::pcmarker: case Intrinsic::pcmarker:
break; // Simply strip out pcmarker on unsupported architectures break; // Simply strip out pcmarker on unsupported architectures
case Intrinsic::readcyclecounter: { case Intrinsic::readcyclecounter: {
std::cerr << "WARNING: this target does not support the llvm.readcyclecoun" llvm_cerr << "WARNING: this target does not support the llvm.readcyclecoun"
<< "ter intrinsic. It is being lowered to a constant 0\n"; << "ter intrinsic. It is being lowered to a constant 0\n";
CI->replaceAllUsesWith(ConstantInt::get(Type::ULongTy, 0)); CI->replaceAllUsesWith(ConstantInt::get(Type::ULongTy, 0));
break; break;

View File

@ -18,8 +18,9 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/ADT/STLExtras.h" #include "llvm/ADT/STLExtras.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/Support/Streams.h"
#include "llvm/Target/MRegisterInfo.h" #include "llvm/Target/MRegisterInfo.h"
#include <algorithm> #include <algorithm>
#include <iostream> #include <iostream>
@ -466,16 +467,15 @@ void LiveInterval::MergeValueNumberInto(unsigned V1, unsigned V2) {
} }
} }
std::ostream& llvm::operator<<(std::ostream& os, const LiveRange &LR) { std::ostream& llvm::operator<<(std::ostream& os, const LiveRange &LR) {
return os << '[' << LR.start << ',' << LR.end << ':' << LR.ValId << ")"; return os << '[' << LR.start << ',' << LR.end << ':' << LR.ValId << ")";
} }
void LiveRange::dump() const { void LiveRange::dump() const {
std::cerr << *this << "\n"; llvm_cerr << *this << "\n";
} }
void LiveInterval::print(std::ostream &OS, const MRegisterInfo *MRI) const { void LiveInterval::print(llvm_ostream &OS, const MRegisterInfo *MRI) const {
if (MRI && MRegisterInfo::isPhysicalRegister(reg)) if (MRI && MRegisterInfo::isPhysicalRegister(reg))
OS << MRI->getName(reg); OS << MRI->getName(reg);
else else
@ -508,5 +508,5 @@ void LiveInterval::print(std::ostream &OS, const MRegisterInfo *MRI) const {
} }
void LiveInterval::dump() const { void LiveInterval::dump() const {
std::cerr << *this << "\n"; llvm_cerr << *this << "\n";
} }