mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
remove uses of llvm/Support/Streams.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79838 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2e35bec78a
commit
a81d29b391
@ -23,8 +23,7 @@
|
|||||||
#include "llvm/Analysis/ValueTracking.h"
|
#include "llvm/Analysis/ValueTracking.h"
|
||||||
#include "llvm/Support/Dwarf.h"
|
#include "llvm/Support/Dwarf.h"
|
||||||
#include "llvm/Support/DebugLoc.h"
|
#include "llvm/Support/DebugLoc.h"
|
||||||
#include "llvm/Support/Streams.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
using namespace llvm::dwarf;
|
using namespace llvm::dwarf;
|
||||||
|
|
||||||
@ -342,17 +341,17 @@ bool DISubprogram::describes(const Function *F) {
|
|||||||
|
|
||||||
/// dump - Print descriptor.
|
/// dump - Print descriptor.
|
||||||
void DIDescriptor::dump() const {
|
void DIDescriptor::dump() const {
|
||||||
cerr << "[" << dwarf::TagString(getTag()) << "] ";
|
errs() << "[" << dwarf::TagString(getTag()) << "] [GV:";
|
||||||
cerr << std::hex << "[GV:" << DbgGV << "]" << std::dec;
|
errs().write_hex((intptr_t)DbgGV) << ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
/// dump - Print compile unit.
|
/// dump - Print compile unit.
|
||||||
void DICompileUnit::dump() const {
|
void DICompileUnit::dump() const {
|
||||||
if (getLanguage())
|
if (getLanguage())
|
||||||
cerr << " [" << dwarf::LanguageString(getLanguage()) << "] ";
|
errs() << " [" << dwarf::LanguageString(getLanguage()) << "] ";
|
||||||
|
|
||||||
std::string Res1, Res2;
|
std::string Res1, Res2;
|
||||||
cerr << " [" << getDirectory(Res1) << "/" << getFilename(Res2) << " ]";
|
errs() << " [" << getDirectory(Res1) << "/" << getFilename(Res2) << " ]";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// dump - Print type.
|
/// dump - Print type.
|
||||||
@ -361,27 +360,27 @@ void DIType::dump() const {
|
|||||||
|
|
||||||
std::string Res;
|
std::string Res;
|
||||||
if (!getName(Res).empty())
|
if (!getName(Res).empty())
|
||||||
cerr << " [" << Res << "] ";
|
errs() << " [" << Res << "] ";
|
||||||
|
|
||||||
unsigned Tag = getTag();
|
unsigned Tag = getTag();
|
||||||
cerr << " [" << dwarf::TagString(Tag) << "] ";
|
errs() << " [" << dwarf::TagString(Tag) << "] ";
|
||||||
|
|
||||||
// TODO : Print context
|
// TODO : Print context
|
||||||
getCompileUnit().dump();
|
getCompileUnit().dump();
|
||||||
cerr << " ["
|
errs() << " ["
|
||||||
<< getLineNumber() << ", "
|
<< getLineNumber() << ", "
|
||||||
<< getSizeInBits() << ", "
|
<< getSizeInBits() << ", "
|
||||||
<< getAlignInBits() << ", "
|
<< getAlignInBits() << ", "
|
||||||
<< getOffsetInBits()
|
<< getOffsetInBits()
|
||||||
<< "] ";
|
<< "] ";
|
||||||
|
|
||||||
if (isPrivate())
|
if (isPrivate())
|
||||||
cerr << " [private] ";
|
errs() << " [private] ";
|
||||||
else if (isProtected())
|
else if (isProtected())
|
||||||
cerr << " [protected] ";
|
errs() << " [protected] ";
|
||||||
|
|
||||||
if (isForwardDecl())
|
if (isForwardDecl())
|
||||||
cerr << " [fwd] ";
|
errs() << " [fwd] ";
|
||||||
|
|
||||||
if (isBasicType(Tag))
|
if (isBasicType(Tag))
|
||||||
DIBasicType(DbgGV).dump();
|
DIBasicType(DbgGV).dump();
|
||||||
@ -390,21 +389,21 @@ void DIType::dump() const {
|
|||||||
else if (isCompositeType(Tag))
|
else if (isCompositeType(Tag))
|
||||||
DICompositeType(DbgGV).dump();
|
DICompositeType(DbgGV).dump();
|
||||||
else {
|
else {
|
||||||
cerr << "Invalid DIType\n";
|
errs() << "Invalid DIType\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cerr << "\n";
|
errs() << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// dump - Print basic type.
|
/// dump - Print basic type.
|
||||||
void DIBasicType::dump() const {
|
void DIBasicType::dump() const {
|
||||||
cerr << " [" << dwarf::AttributeEncodingString(getEncoding()) << "] ";
|
errs() << " [" << dwarf::AttributeEncodingString(getEncoding()) << "] ";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// dump - Print derived type.
|
/// dump - Print derived type.
|
||||||
void DIDerivedType::dump() const {
|
void DIDerivedType::dump() const {
|
||||||
cerr << "\n\t Derived From: "; getTypeDerivedFrom().dump();
|
errs() << "\n\t Derived From: "; getTypeDerivedFrom().dump();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// dump - Print composite type.
|
/// dump - Print composite type.
|
||||||
@ -412,32 +411,32 @@ void DICompositeType::dump() const {
|
|||||||
DIArray A = getTypeArray();
|
DIArray A = getTypeArray();
|
||||||
if (A.isNull())
|
if (A.isNull())
|
||||||
return;
|
return;
|
||||||
cerr << " [" << A.getNumElements() << " elements]";
|
errs() << " [" << A.getNumElements() << " elements]";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// dump - Print global.
|
/// dump - Print global.
|
||||||
void DIGlobal::dump() const {
|
void DIGlobal::dump() const {
|
||||||
std::string Res;
|
std::string Res;
|
||||||
if (!getName(Res).empty())
|
if (!getName(Res).empty())
|
||||||
cerr << " [" << Res << "] ";
|
errs() << " [" << Res << "] ";
|
||||||
|
|
||||||
unsigned Tag = getTag();
|
unsigned Tag = getTag();
|
||||||
cerr << " [" << dwarf::TagString(Tag) << "] ";
|
errs() << " [" << dwarf::TagString(Tag) << "] ";
|
||||||
|
|
||||||
// TODO : Print context
|
// TODO : Print context
|
||||||
getCompileUnit().dump();
|
getCompileUnit().dump();
|
||||||
cerr << " [" << getLineNumber() << "] ";
|
errs() << " [" << getLineNumber() << "] ";
|
||||||
|
|
||||||
if (isLocalToUnit())
|
if (isLocalToUnit())
|
||||||
cerr << " [local] ";
|
errs() << " [local] ";
|
||||||
|
|
||||||
if (isDefinition())
|
if (isDefinition())
|
||||||
cerr << " [def] ";
|
errs() << " [def] ";
|
||||||
|
|
||||||
if (isGlobalVariable(Tag))
|
if (isGlobalVariable(Tag))
|
||||||
DIGlobalVariable(DbgGV).dump();
|
DIGlobalVariable(DbgGV).dump();
|
||||||
|
|
||||||
cerr << "\n";
|
errs() << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// dump - Print subprogram.
|
/// dump - Print subprogram.
|
||||||
@ -447,19 +446,21 @@ void DISubprogram::dump() const {
|
|||||||
|
|
||||||
/// dump - Print global variable.
|
/// dump - Print global variable.
|
||||||
void DIGlobalVariable::dump() const {
|
void DIGlobalVariable::dump() const {
|
||||||
cerr << " ["; getGlobal()->dump(); cerr << "] ";
|
errs() << " [";
|
||||||
|
getGlobal()->dump();
|
||||||
|
errs() << "] ";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// dump - Print variable.
|
/// dump - Print variable.
|
||||||
void DIVariable::dump() const {
|
void DIVariable::dump() const {
|
||||||
std::string Res;
|
std::string Res;
|
||||||
if (!getName(Res).empty())
|
if (!getName(Res).empty())
|
||||||
cerr << " [" << Res << "] ";
|
errs() << " [" << Res << "] ";
|
||||||
|
|
||||||
getCompileUnit().dump();
|
getCompileUnit().dump();
|
||||||
cerr << " [" << getLineNumber() << "] ";
|
errs() << " [" << getLineNumber() << "] ";
|
||||||
getType().dump();
|
getType().dump();
|
||||||
cerr << "\n";
|
errs() << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include "llvm/Analysis/Dominators.h"
|
#include "llvm/Analysis/Dominators.h"
|
||||||
#include "llvm/Assembly/Writer.h"
|
#include "llvm/Assembly/Writer.h"
|
||||||
#include "llvm/Support/CFG.h"
|
#include "llvm/Support/CFG.h"
|
||||||
#include "llvm/Support/Streams.h"
|
|
||||||
#include "llvm/ADT/DepthFirstIterator.h"
|
#include "llvm/ADT/DepthFirstIterator.h"
|
||||||
#include "llvm/ADT/SmallPtrSet.h"
|
#include "llvm/ADT/SmallPtrSet.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include "llvm/Analysis/ProfileInfoTypes.h"
|
#include "llvm/Analysis/ProfileInfoTypes.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "llvm/InstrTypes.h"
|
#include "llvm/InstrTypes.h"
|
||||||
#include "llvm/Support/Streams.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <map>
|
#include <map>
|
||||||
@ -38,7 +38,7 @@ static void ReadProfilingBlock(const char *ToolName, FILE *F,
|
|||||||
// Read the number of entries...
|
// Read the number of entries...
|
||||||
unsigned NumEntries;
|
unsigned NumEntries;
|
||||||
if (fread(&NumEntries, sizeof(unsigned), 1, F) != 1) {
|
if (fread(&NumEntries, sizeof(unsigned), 1, F) != 1) {
|
||||||
cerr << ToolName << ": data packet truncated!\n";
|
errs() << ToolName << ": data packet truncated!\n";
|
||||||
perror(0);
|
perror(0);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -49,7 +49,7 @@ static void ReadProfilingBlock(const char *ToolName, FILE *F,
|
|||||||
|
|
||||||
// Read in the block of data...
|
// Read in the block of data...
|
||||||
if (fread(&TempSpace[0], sizeof(unsigned)*NumEntries, 1, F) != 1) {
|
if (fread(&TempSpace[0], sizeof(unsigned)*NumEntries, 1, F) != 1) {
|
||||||
cerr << ToolName << ": data packet truncated!\n";
|
errs() << ToolName << ": data packet truncated!\n";
|
||||||
perror(0);
|
perror(0);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -78,7 +78,7 @@ ProfileInfoLoader::ProfileInfoLoader(const char *ToolName,
|
|||||||
M(TheModule), Warned(false) {
|
M(TheModule), Warned(false) {
|
||||||
FILE *F = fopen(Filename.c_str(), "r");
|
FILE *F = fopen(Filename.c_str(), "r");
|
||||||
if (F == 0) {
|
if (F == 0) {
|
||||||
cerr << ToolName << ": Error opening '" << Filename << "': ";
|
errs() << ToolName << ": Error opening '" << Filename << "': ";
|
||||||
perror(0);
|
perror(0);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -96,7 +96,7 @@ ProfileInfoLoader::ProfileInfoLoader(const char *ToolName,
|
|||||||
case ArgumentInfo: {
|
case ArgumentInfo: {
|
||||||
unsigned ArgLength;
|
unsigned ArgLength;
|
||||||
if (fread(&ArgLength, sizeof(unsigned), 1, F) != 1) {
|
if (fread(&ArgLength, sizeof(unsigned), 1, F) != 1) {
|
||||||
cerr << ToolName << ": arguments packet truncated!\n";
|
errs() << ToolName << ": arguments packet truncated!\n";
|
||||||
perror(0);
|
perror(0);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -107,7 +107,7 @@ ProfileInfoLoader::ProfileInfoLoader(const char *ToolName,
|
|||||||
|
|
||||||
if (ArgLength)
|
if (ArgLength)
|
||||||
if (fread(&Chars[0], (ArgLength+3) & ~3, 1, F) != 1) {
|
if (fread(&Chars[0], (ArgLength+3) & ~3, 1, F) != 1) {
|
||||||
cerr << ToolName << ": arguments packet truncated!\n";
|
errs() << ToolName << ": arguments packet truncated!\n";
|
||||||
perror(0);
|
perror(0);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ ProfileInfoLoader::ProfileInfoLoader(const char *ToolName,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
cerr << ToolName << ": Unknown packet type #" << PacketType << "!\n";
|
errs() << ToolName << ": Unknown packet type #" << PacketType << "!\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include "llvm/Analysis/ProfileInfoLoader.h"
|
#include "llvm/Analysis/ProfileInfoLoader.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
#include "llvm/Support/Compiler.h"
|
#include "llvm/Support/Compiler.h"
|
||||||
#include "llvm/Support/Streams.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
static cl::opt<std::string>
|
static cl::opt<std::string>
|
||||||
@ -92,8 +92,8 @@ bool LoaderPass::runOnModule(Module &M) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ei != ECs.size()) {
|
if (ei != ECs.size()) {
|
||||||
cerr << "WARNING: profile information is inconsistent with "
|
errs() << "WARNING: profile information is inconsistent with "
|
||||||
<< "the current program!\n";
|
<< "the current program!\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,8 +108,8 @@ bool LoaderPass::runOnModule(Module &M) {
|
|||||||
BlockInformation[F][BB] = BCs[bi++];
|
BlockInformation[F][BB] = BCs[bi++];
|
||||||
}
|
}
|
||||||
if (bi != BCs.size()) {
|
if (bi != BCs.size()) {
|
||||||
cerr << "WARNING: profile information is inconsistent with "
|
errs() << "WARNING: profile information is inconsistent with "
|
||||||
<< "the current program!\n";
|
<< "the current program!\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,8 +123,8 @@ bool LoaderPass::runOnModule(Module &M) {
|
|||||||
FunctionInformation[F] = FCs[fi++];
|
FunctionInformation[F] = FCs[fi++];
|
||||||
}
|
}
|
||||||
if (fi != FCs.size()) {
|
if (fi != FCs.size()) {
|
||||||
cerr << "WARNING: profile information is inconsistent with "
|
errs() << "WARNING: profile information is inconsistent with "
|
||||||
<< "the current program!\n";
|
<< "the current program!\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user