changes to make it compatible with 64bit gcc

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2790 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Anand Shukla 2002-06-25 20:44:04 +00:00
parent a928403ca4
commit eea60fc59c
5 changed files with 14 additions and 10 deletions

View File

@ -14,8 +14,8 @@
#include "llvm/GlobalVariable.h" #include "llvm/GlobalVariable.h"
#include <algorithm> #include <algorithm>
#include <iostream> #include <iostream>
using std::make_pair; using std::make_pair;
using std::cerr;
const Type *BytecodeParser::parseTypeConstant(const uchar *&Buf, const Type *BytecodeParser::parseTypeConstant(const uchar *&Buf,
const uchar *EndBuf) { const uchar *EndBuf) {
@ -91,8 +91,9 @@ const Type *BytecodeParser::parseTypeConstant(const uchar *&Buf,
} }
default: default:
cerr << __FILE__ << ":" << __LINE__ << ": Don't know how to deserialize" std::cerr << __FILE__ << ":" << __LINE__
<< " primitive Type " << PrimType << "\n"; << ": Don't know how to deserialize"
<< " primitive Type " << PrimType << "\n";
return failure(Val); return failure(Val);
} }
} }
@ -325,9 +326,9 @@ bool BytecodeParser::parseConstantValue(const uchar *&Buf, const uchar *EndBuf,
} }
default: default:
cerr << __FILE__ << ":" << __LINE__ std::cerr << __FILE__ << ":" << __LINE__
<< ": Don't know how to deserialize constant value of type '" << ": Don't know how to deserialize constant value of type '"
<< Ty->getName() << "'\n"; << Ty->getName() << "'\n";
return failure(true); return failure(true);
} }

View File

@ -15,12 +15,13 @@
#include <map> #include <map>
#include <utility> #include <utility>
#include <list> #include <list>
#include <iostream>
// Enable to trace to figure out what the heck is going on when parsing fails // Enable to trace to figure out what the heck is going on when parsing fails
#define TRACE_LEVEL 0 #define TRACE_LEVEL 0
#if TRACE_LEVEL // ByteCodeReading_TRACEer #if TRACE_LEVEL // ByteCodeReading_TRACEer
#define BCR_TRACE(n, X) if (n < TRACE_LEVEL) cerr << std::string(n*2, ' ') << X #define BCR_TRACE(n, X) if (n < TRACE_LEVEL) std::cerr << std::string(n*2, ' ') << X
#else #else
#define BCR_TRACE(n, X) #define BCR_TRACE(n, X)
#endif #endif
@ -51,7 +52,7 @@ public:
std::string getError() const { return Error; } std::string getError() const { return Error; }
void dump() const { void dump() const {
cerr << "BytecodeParser instance!\n"; std::cerr << "BytecodeParser instance!\n";
} }
private: // All of this data is transient across calls to ParseBytecode private: // All of this data is transient across calls to ParseBytecode
@ -167,7 +168,7 @@ static inline bool readBlock(const uchar *&Buf, const uchar *EndBuf,
unsigned &Type, unsigned &Size) { unsigned &Type, unsigned &Size) {
#if DEBUG_OUTPUT #if DEBUG_OUTPUT
bool Result = read(Buf, EndBuf, Type) || read(Buf, EndBuf, Size); bool Result = read(Buf, EndBuf, Type) || read(Buf, EndBuf, Size);
cerr << "StartLoc = " << ((unsigned)Buf & 4095) std::cerr << "StartLoc = " << ((unsigned)Buf & 4095)
<< " Type = " << Type << " Size = " << Size << endl; << " Type = " << Type << " Size = " << Size << endl;
return Result; return Result;
#else #else

View File

@ -199,7 +199,7 @@ void BytecodeWriter::outputSymbolTable(const SymbolTable &MST) {
} }
} }
void WriteBytecodeToFile(const Module *C, ostream &Out) { void WriteBytecodeToFile(const Module *C, std::ostream &Out) {
assert(C && "You can't write a null module!!"); assert(C && "You can't write a null module!!");
std::deque<unsigned char> Buffer; std::deque<unsigned char> Buffer;

View File

@ -26,6 +26,7 @@
using std::string; using std::string;
using std::map; using std::map;
using std::ostream; using std::ostream;
using std::cerr;
static std::string getConstStrValue(const Constant* CPV); static std::string getConstStrValue(const Constant* CPV);

View File

@ -26,6 +26,7 @@
using std::string; using std::string;
using std::map; using std::map;
using std::ostream; using std::ostream;
using std::cerr;
static std::string getConstStrValue(const Constant* CPV); static std::string getConstStrValue(const Constant* CPV);