[llvm-commits] CVS: llvm/lib/Bytecode/Reader/ArchiveReader.cpp ConstantReader.cpp InstructionReader.cpp Reader.cpp ReaderInternals.h ReaderWrappers.cpp
Brian Gaeke
gaeke at cs.uiuc.edu
Tue Nov 11 16:44:45 PST 2003
Changes in directory llvm/lib/Bytecode/Reader:
ArchiveReader.cpp updated: 1.7 -> 1.8
ConstantReader.cpp updated: 1.61 -> 1.62
InstructionReader.cpp updated: 1.62 -> 1.63
Reader.cpp updated: 1.87 -> 1.88
ReaderInternals.h updated: 1.63 -> 1.64
ReaderWrappers.cpp updated: 1.16 -> 1.17
---
Log message:
Put all LLVM code into the llvm namespace, as per bug 109.
---
Diffs of the changes: (+25 -5)
Index: llvm/lib/Bytecode/Reader/ArchiveReader.cpp
diff -u llvm/lib/Bytecode/Reader/ArchiveReader.cpp:1.7 llvm/lib/Bytecode/Reader/ArchiveReader.cpp:1.8
--- llvm/lib/Bytecode/Reader/ArchiveReader.cpp:1.7 Mon Oct 20 14:43:14 2003
+++ llvm/lib/Bytecode/Reader/ArchiveReader.cpp Tue Nov 11 16:41:32 2003
@@ -22,6 +22,8 @@
#include "Config/sys/mman.h"
#include "Config/fcntl.h"
+namespace llvm {
+
namespace {
struct ar_hdr {
char name[16];
@@ -40,7 +42,6 @@
};
}
-
// getObjectType - Determine the type of object that this header represents.
// This is capable of parsing the variety of special sections used for various
// purposes.
@@ -173,3 +174,5 @@
return Result;
}
+
+} // End llvm namespace
Index: llvm/lib/Bytecode/Reader/ConstantReader.cpp
diff -u llvm/lib/Bytecode/Reader/ConstantReader.cpp:1.61 llvm/lib/Bytecode/Reader/ConstantReader.cpp:1.62
--- llvm/lib/Bytecode/Reader/ConstantReader.cpp:1.61 Wed Nov 5 13:53:03 2003
+++ llvm/lib/Bytecode/Reader/ConstantReader.cpp Tue Nov 11 16:41:32 2003
@@ -20,6 +20,8 @@
#include "llvm/Constants.h"
#include <algorithm>
+namespace llvm {
+
const Type *BytecodeParser::parseTypeConstant(const unsigned char *&Buf,
const unsigned char *EndBuf) {
unsigned PrimType;
@@ -356,3 +358,5 @@
if (Buf > EndBuf) throw std::string("Read past end of buffer.");
}
+
+} // End llvm namespace
Index: llvm/lib/Bytecode/Reader/InstructionReader.cpp
diff -u llvm/lib/Bytecode/Reader/InstructionReader.cpp:1.62 llvm/lib/Bytecode/Reader/InstructionReader.cpp:1.63
--- llvm/lib/Bytecode/Reader/InstructionReader.cpp:1.62 Mon Oct 20 14:43:14 2003
+++ llvm/lib/Bytecode/Reader/InstructionReader.cpp Tue Nov 11 16:41:32 2003
@@ -22,6 +22,8 @@
#include "llvm/iOther.h"
#include "llvm/Module.h"
+namespace llvm {
+
namespace {
struct RawInst { // The raw fields out of the bytecode stream...
unsigned NumOperands;
@@ -33,8 +35,6 @@
};
}
-
-
RawInst::RawInst(const unsigned char *&Buf, const unsigned char *EndBuf,
std::vector<unsigned> &Args) {
unsigned Op, Typ;
@@ -389,3 +389,5 @@
BB->getInstList().push_back(Result);
BCR_TRACE(4, *Result);
}
+
+} // End llvm namespace
Index: llvm/lib/Bytecode/Reader/Reader.cpp
diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.87 llvm/lib/Bytecode/Reader/Reader.cpp:1.88
--- llvm/lib/Bytecode/Reader/Reader.cpp:1.87 Mon Oct 20 14:43:15 2003
+++ llvm/lib/Bytecode/Reader/Reader.cpp Tue Nov 11 16:41:32 2003
@@ -32,6 +32,8 @@
#include <algorithm>
#include <memory>
+namespace llvm {
+
static inline void ALIGN32(const unsigned char *&begin,
const unsigned char *end) {
if (align32(begin, end))
@@ -693,3 +695,5 @@
throw;
}
}
+
+} // End llvm namespace
Index: llvm/lib/Bytecode/Reader/ReaderInternals.h
diff -u llvm/lib/Bytecode/Reader/ReaderInternals.h:1.63 llvm/lib/Bytecode/Reader/ReaderInternals.h:1.64
--- llvm/lib/Bytecode/Reader/ReaderInternals.h:1.63 Wed Nov 5 13:53:32 2003
+++ llvm/lib/Bytecode/Reader/ReaderInternals.h Tue Nov 11 16:41:32 2003
@@ -22,6 +22,8 @@
#include <utility>
#include <map>
+namespace llvm {
+
// Enable to trace to figure out what the heck is going on when parsing fails
//#define TRACE_LEVEL 10
//#define DEBUG_OUTPUT
@@ -225,5 +227,7 @@
if (read(Buf, EndBuf, Type) || read(Buf, EndBuf, Size)) throw Error_read;
#endif
}
+
+} // End llvm namespace
#endif
Index: llvm/lib/Bytecode/Reader/ReaderWrappers.cpp
diff -u llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.16 llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.17
--- llvm/lib/Bytecode/Reader/ReaderWrappers.cpp:1.16 Mon Oct 20 14:43:15 2003
+++ llvm/lib/Bytecode/Reader/ReaderWrappers.cpp Tue Nov 11 16:41:32 2003
@@ -21,6 +21,8 @@
#include "Config/unistd.h"
#include "Config/sys/mman.h"
+namespace llvm {
+
//===----------------------------------------------------------------------===//
// BytecodeFileReader - Read from an mmap'able file descriptor.
//
@@ -163,7 +165,7 @@
unsigned char Buffer[4096*4];
// Read in all of the data from stdin, we cannot mmap stdin...
- while ((BlockSize = read(0 /*stdin*/, Buffer, 4096*4))) {
+ while ((BlockSize = ::read(0 /*stdin*/, Buffer, 4096*4))) {
if (BlockSize == -1)
throw std::string("Error reading from stdin!");
@@ -249,7 +251,6 @@
return MP;
}
-
//===----------------------------------------------------------------------===//
// Wrapper functions
//===----------------------------------------------------------------------===//
@@ -296,3 +297,5 @@
return 0;
}
}
+
+} // End llvm namespace
More information about the llvm-commits
mailing list