mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
Changed to using LLVM streams.
llvm-svn: 31955
This commit is contained in:
parent
7e9cea955c
commit
aa02717a76
@ -26,10 +26,11 @@
|
|||||||
#include "llvm/Instructions.h"
|
#include "llvm/Instructions.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/SymbolTable.h"
|
#include "llvm/SymbolTable.h"
|
||||||
#include "llvm/Support/CFG.h"
|
|
||||||
#include "llvm/ADT/StringExtras.h"
|
#include "llvm/ADT/StringExtras.h"
|
||||||
#include "llvm/ADT/STLExtras.h"
|
#include "llvm/ADT/STLExtras.h"
|
||||||
|
#include "llvm/Support/CFG.h"
|
||||||
#include "llvm/Support/MathExtras.h"
|
#include "llvm/Support/MathExtras.h"
|
||||||
|
#include "llvm/Support/Streams.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
@ -866,7 +867,7 @@ void AssemblyWriter::printGlobal(const GlobalVariable *GV) {
|
|||||||
case GlobalValue::ExternalWeakLinkage: Out << "extern_weak "; break;
|
case GlobalValue::ExternalWeakLinkage: Out << "extern_weak "; break;
|
||||||
case GlobalValue::ExternalLinkage: break;
|
case GlobalValue::ExternalLinkage: break;
|
||||||
case GlobalValue::GhostLinkage:
|
case GlobalValue::GhostLinkage:
|
||||||
std::cerr << "GhostLinkage not allowed in AsmWriter!\n";
|
llvm_cerr << "GhostLinkage not allowed in AsmWriter!\n";
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -965,7 +966,7 @@ void AssemblyWriter::printFunction(const Function *F) {
|
|||||||
case GlobalValue::ExternalWeakLinkage: Out << "extern_weak "; break;
|
case GlobalValue::ExternalWeakLinkage: Out << "extern_weak "; break;
|
||||||
case GlobalValue::ExternalLinkage: break;
|
case GlobalValue::ExternalLinkage: break;
|
||||||
case GlobalValue::GhostLinkage:
|
case GlobalValue::GhostLinkage:
|
||||||
std::cerr << "GhostLinkage not allowed in AsmWriter!\n";
|
llvm_cerr << "GhostLinkage not allowed in AsmWriter!\n";
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1358,11 +1359,11 @@ void Argument::print(std::ostream &o) const {
|
|||||||
|
|
||||||
// Value::dump - allow easy printing of Values from the debugger.
|
// Value::dump - allow easy printing of Values from the debugger.
|
||||||
// Located here because so much of the needed functionality is here.
|
// Located here because so much of the needed functionality is here.
|
||||||
void Value::dump() const { print(std::cerr); std::cerr << '\n'; }
|
void Value::dump() const { print(std::cerr); llvm_cerr << '\n'; }
|
||||||
|
|
||||||
// Type::dump - allow easy printing of Values from the debugger.
|
// Type::dump - allow easy printing of Values from the debugger.
|
||||||
// Located here because so much of the needed functionality is here.
|
// Located here because so much of the needed functionality is here.
|
||||||
void Type::dump() const { print(std::cerr); std::cerr << '\n'; }
|
void Type::dump() const { print(std::cerr); llvm_cerr << '\n'; }
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// CachedWriter Class Implementation
|
// CachedWriter Class Implementation
|
||||||
@ -1413,7 +1414,7 @@ CachedWriter& CachedWriter::operator<<(const Type &Ty) {
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
#define SC_DEBUG(X) std::cerr << X
|
#define SC_DEBUG(X) llvm_cerr << X
|
||||||
#else
|
#else
|
||||||
#define SC_DEBUG(X)
|
#define SC_DEBUG(X)
|
||||||
#endif
|
#endif
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "llvm/Assembly/AutoUpgrade.h"
|
#include "llvm/Assembly/AutoUpgrade.h"
|
||||||
|
#include "llvm/Support/Streams.h"
|
||||||
#include "llvm/Constants.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/Function.h"
|
#include "llvm/Function.h"
|
||||||
@ -19,7 +20,6 @@
|
|||||||
#include "llvm/Instructions.h"
|
#include "llvm/Instructions.h"
|
||||||
#include "llvm/Intrinsics.h"
|
#include "llvm/Intrinsics.h"
|
||||||
#include "llvm/SymbolTable.h"
|
#include "llvm/SymbolTable.h"
|
||||||
#include <iostream>
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
static Function *getUpgradedUnaryFn(Function *F) {
|
static Function *getUpgradedUnaryFn(Function *F) {
|
||||||
@ -193,7 +193,7 @@ Function *llvm::UpgradeIntrinsicFunction(Function* F) {
|
|||||||
// See if its one of the name's we're interested in.
|
// See if its one of the name's we're interested in.
|
||||||
if (Function *R = getUpgradedIntrinsic(F)) {
|
if (Function *R = getUpgradedIntrinsic(F)) {
|
||||||
if (R->getName() != F->getName())
|
if (R->getName() != F->getName())
|
||||||
std::cerr << "WARNING: change " << F->getName() << " to "
|
llvm_cerr << "WARNING: change " << F->getName() << " to "
|
||||||
<< R->getName() << "\n";
|
<< R->getName() << "\n";
|
||||||
return R;
|
return R;
|
||||||
}
|
}
|
||||||
|
@ -11,22 +11,22 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "llvm/Support/LeakDetector.h"
|
|
||||||
#include "llvm/Support/Compiler.h"
|
#include "llvm/Support/Compiler.h"
|
||||||
|
#include "llvm/Support/LeakDetector.h"
|
||||||
|
#include "llvm/Support/Streams.h"
|
||||||
#include "llvm/Value.h"
|
#include "llvm/Value.h"
|
||||||
#include <iostream>
|
|
||||||
#include <set>
|
#include <set>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
template <class T>
|
template <class T>
|
||||||
struct VISIBILITY_HIDDEN PrinterTrait {
|
struct VISIBILITY_HIDDEN PrinterTrait {
|
||||||
static void print(const T* P) { std::cerr << P; }
|
static void print(const T* P) { llvm_cerr << P; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct VISIBILITY_HIDDEN PrinterTrait<Value> {
|
struct VISIBILITY_HIDDEN PrinterTrait<Value> {
|
||||||
static void print(const Value* P) { std::cerr << *P; }
|
static void print(const Value* P) { llvm_cerr << *P; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@ -59,15 +59,15 @@ namespace {
|
|||||||
assert(Cache == 0 && "No value should be cached anymore!");
|
assert(Cache == 0 && "No value should be cached anymore!");
|
||||||
|
|
||||||
if (!Ts.empty()) {
|
if (!Ts.empty()) {
|
||||||
std::cerr
|
llvm_cerr
|
||||||
<< "Leaked " << Name << " objects found: " << Message << ":\n";
|
<< "Leaked " << Name << " objects found: " << Message << ":\n";
|
||||||
for (typename std::set<const T*>::iterator I = Ts.begin(),
|
for (typename std::set<const T*>::iterator I = Ts.begin(),
|
||||||
E = Ts.end(); I != E; ++I) {
|
E = Ts.end(); I != E; ++I) {
|
||||||
std::cerr << "\t";
|
llvm_cerr << "\t";
|
||||||
PrinterTrait<T>::print(*I);
|
PrinterTrait<T>::print(*I);
|
||||||
std::cerr << "\n";
|
llvm_cerr << "\n";
|
||||||
}
|
}
|
||||||
std::cerr << '\n';
|
llvm_cerr << '\n';
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -123,8 +123,8 @@ void LeakDetector::checkForGarbageImpl(const std::string &Message) {
|
|||||||
// use non-short-circuit version so that both checks are performed
|
// use non-short-circuit version so that both checks are performed
|
||||||
if (getObjects().hasGarbage(Message) |
|
if (getObjects().hasGarbage(Message) |
|
||||||
getLLVMObjects().hasGarbage(Message))
|
getLLVMObjects().hasGarbage(Message))
|
||||||
std::cerr << "\nThis is probably because you removed an object, but didn't "
|
llvm_cerr << "\nThis is probably because you removed an object, but didn't "
|
||||||
"delete it. Please check your code for memory leaks.\n";
|
<< "delete it. Please check your code for memory leaks.\n";
|
||||||
|
|
||||||
// Clear out results so we don't get duplicate warnings on
|
// Clear out results so we don't get duplicate warnings on
|
||||||
// next call...
|
// next call...
|
||||||
|
@ -15,10 +15,9 @@
|
|||||||
#include "llvm/PassManager.h"
|
#include "llvm/PassManager.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/ModuleProvider.h"
|
#include "llvm/ModuleProvider.h"
|
||||||
|
#include "llvm/Support/Streams.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
@ -443,7 +442,7 @@ bool FunctionPassManager_New::runOnModule(Module &M) {
|
|||||||
bool FunctionPassManager_New::run(Function &F) {
|
bool FunctionPassManager_New::run(Function &F) {
|
||||||
std::string errstr;
|
std::string errstr;
|
||||||
if (MP->materializeFunction(&F, &errstr)) {
|
if (MP->materializeFunction(&F, &errstr)) {
|
||||||
std::cerr << "Error reading bytecode file: " << errstr << "\n";
|
llvm_cerr << "Error reading bytecode file: " << errstr << "\n";
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
return FPM->runOnFunction(F);
|
return FPM->runOnFunction(F);
|
||||||
|
@ -14,9 +14,8 @@
|
|||||||
#include "llvm/TypeSymbolTable.h"
|
#include "llvm/TypeSymbolTable.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
#include "llvm/ADT/StringExtras.h"
|
#include "llvm/ADT/StringExtras.h"
|
||||||
#include <iostream>
|
#include "llvm/Support/Streams.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
#define DEBUG_SYMBOL_TABLE 0
|
#define DEBUG_SYMBOL_TABLE 0
|
||||||
@ -67,7 +66,7 @@ Type* TypeSymbolTable::erase(iterator Entry) {
|
|||||||
|
|
||||||
#if DEBUG_SYMBOL_TABLE
|
#if DEBUG_SYMBOL_TABLE
|
||||||
dump();
|
dump();
|
||||||
std::cerr << " Removing Value: " << Result->getName() << "\n";
|
llvm_cerr << " Removing Value: " << Result->getName() << "\n";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
tmap.erase(Entry);
|
tmap.erase(Entry);
|
||||||
@ -76,7 +75,7 @@ Type* TypeSymbolTable::erase(iterator Entry) {
|
|||||||
// list...
|
// list...
|
||||||
if (Result->isAbstract()) {
|
if (Result->isAbstract()) {
|
||||||
#if DEBUG_ABSTYPE
|
#if DEBUG_ABSTYPE
|
||||||
std::cerr << "Removing abstract type from symtab" << Result->getDescription()<<"\n";
|
llvm_cerr << "Removing abstract type from symtab" << Result->getDescription()<<"\n";
|
||||||
#endif
|
#endif
|
||||||
cast<DerivedType>(Result)->removeAbstractTypeUser(this);
|
cast<DerivedType>(Result)->removeAbstractTypeUser(this);
|
||||||
}
|
}
|
||||||
@ -96,7 +95,7 @@ void TypeSymbolTable::insert(const std::string& Name, const Type* T) {
|
|||||||
|
|
||||||
#if DEBUG_SYMBOL_TABLE
|
#if DEBUG_SYMBOL_TABLE
|
||||||
dump();
|
dump();
|
||||||
std::cerr << " Inserting type: " << UniqueName << ": "
|
llvm_cerr << " Inserting type: " << UniqueName << ": "
|
||||||
<< T->getDescription() << "\n";
|
<< T->getDescription() << "\n";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -107,7 +106,7 @@ void TypeSymbolTable::insert(const std::string& Name, const Type* T) {
|
|||||||
if (T->isAbstract()) {
|
if (T->isAbstract()) {
|
||||||
cast<DerivedType>(T)->addAbstractTypeUser(this);
|
cast<DerivedType>(T)->addAbstractTypeUser(this);
|
||||||
#if DEBUG_ABSTYPE
|
#if DEBUG_ABSTYPE
|
||||||
std::cerr << "Added abstract type to ST: " << T->getDescription() << "\n";
|
llvm_cerr << "Added abstract type to ST: " << T->getDescription() << "\n";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -153,14 +152,14 @@ void TypeSymbolTable::refineAbstractType(const DerivedType *OldType,
|
|||||||
for (iterator I = begin(), E = end(); I != E; ++I) {
|
for (iterator I = begin(), E = end(); I != E; ++I) {
|
||||||
if (I->second == (Type*)OldType) { // FIXME when Types aren't const.
|
if (I->second == (Type*)OldType) { // FIXME when Types aren't const.
|
||||||
#if DEBUG_ABSTYPE
|
#if DEBUG_ABSTYPE
|
||||||
std::cerr << "Removing type " << OldType->getDescription() << "\n";
|
llvm_cerr << "Removing type " << OldType->getDescription() << "\n";
|
||||||
#endif
|
#endif
|
||||||
OldType->removeAbstractTypeUser(this);
|
OldType->removeAbstractTypeUser(this);
|
||||||
|
|
||||||
I->second = (Type*)NewType; // TODO FIXME when types aren't const
|
I->second = (Type*)NewType; // TODO FIXME when types aren't const
|
||||||
if (NewType->isAbstract()) {
|
if (NewType->isAbstract()) {
|
||||||
#if DEBUG_ABSTYPE
|
#if DEBUG_ABSTYPE
|
||||||
std::cerr << "Added type " << NewType->getDescription() << "\n";
|
llvm_cerr << "Added type " << NewType->getDescription() << "\n";
|
||||||
#endif
|
#endif
|
||||||
cast<DerivedType>(NewType)->addAbstractTypeUser(this);
|
cast<DerivedType>(NewType)->addAbstractTypeUser(this);
|
||||||
}
|
}
|
||||||
@ -180,13 +179,13 @@ void TypeSymbolTable::typeBecameConcrete(const DerivedType *AbsTy) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void DumpTypes(const std::pair<const std::string, const Type*>& T ) {
|
static void DumpTypes(const std::pair<const std::string, const Type*>& T ) {
|
||||||
std::cerr << " '" << T.first << "' = ";
|
llvm_cerr << " '" << T.first << "' = ";
|
||||||
T.second->dump();
|
T.second->dump();
|
||||||
std::cerr << "\n";
|
llvm_cerr << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
void TypeSymbolTable::dump() const {
|
void TypeSymbolTable::dump() const {
|
||||||
std::cerr << "TypeSymbolPlane: ";
|
llvm_cerr << "TypeSymbolPlane: ";
|
||||||
for_each(tmap.begin(), tmap.end(), DumpTypes);
|
for_each(tmap.begin(), tmap.end(), DumpTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,11 +55,11 @@
|
|||||||
#include "llvm/Analysis/Dominators.h"
|
#include "llvm/Analysis/Dominators.h"
|
||||||
#include "llvm/Support/CFG.h"
|
#include "llvm/Support/CFG.h"
|
||||||
#include "llvm/Support/InstVisitor.h"
|
#include "llvm/Support/InstVisitor.h"
|
||||||
|
#include "llvm/Support/Streams.h"
|
||||||
#include "llvm/ADT/StringExtras.h"
|
#include "llvm/ADT/StringExtras.h"
|
||||||
#include "llvm/ADT/STLExtras.h"
|
#include "llvm/ADT/STLExtras.h"
|
||||||
#include "llvm/Support/Compiler.h"
|
#include "llvm/Support/Compiler.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iostream>
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
@ -156,11 +156,11 @@ namespace { // Anonymous namespace for class
|
|||||||
switch (action) {
|
switch (action) {
|
||||||
case AbortProcessAction:
|
case AbortProcessAction:
|
||||||
msgs << "compilation aborted!\n";
|
msgs << "compilation aborted!\n";
|
||||||
std::cerr << msgs.str();
|
llvm_cerr << msgs.str();
|
||||||
abort();
|
abort();
|
||||||
case PrintMessageAction:
|
case PrintMessageAction:
|
||||||
msgs << "verification continues.\n";
|
msgs << "verification continues.\n";
|
||||||
std::cerr << msgs.str();
|
llvm_cerr << msgs.str();
|
||||||
return false;
|
return false;
|
||||||
case ReturnStatusAction:
|
case ReturnStatusAction:
|
||||||
msgs << "compilation terminated.\n";
|
msgs << "compilation terminated.\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user