summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-11-11 22:41:34 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-11-11 22:41:34 +0000
commit960707c335b85fa0df0bff6400fd4e5f19ac0df4 (patch)
treefcd6bd0a802eff2ba6d9bcfef369241d5b79d06a /llvm/lib/Bytecode
parentda3f675edd0b0ffa480c1bec97a2a701d31e4ca8 (diff)
downloadbcm5719-llvm-960707c335b85fa0df0bff6400fd4e5f19ac0df4.tar.gz
bcm5719-llvm-960707c335b85fa0df0bff6400fd4e5f19ac0df4.zip
Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
Diffstat (limited to 'llvm/lib/Bytecode')
-rw-r--r--llvm/lib/Bytecode/Reader/ArchiveReader.cpp5
-rw-r--r--llvm/lib/Bytecode/Reader/ConstantReader.cpp4
-rw-r--r--llvm/lib/Bytecode/Reader/InstructionReader.cpp6
-rw-r--r--llvm/lib/Bytecode/Reader/Reader.cpp4
-rw-r--r--llvm/lib/Bytecode/Reader/ReaderInternals.h4
-rw-r--r--llvm/lib/Bytecode/Reader/ReaderWrappers.cpp7
-rw-r--r--llvm/lib/Bytecode/Writer/ConstantWriter.cpp4
-rw-r--r--llvm/lib/Bytecode/Writer/InstructionWriter.cpp4
-rw-r--r--llvm/lib/Bytecode/Writer/Writer.cpp4
-rw-r--r--llvm/lib/Bytecode/Writer/WriterInternals.h3
10 files changed, 40 insertions, 5 deletions
diff --git a/llvm/lib/Bytecode/Reader/ArchiveReader.cpp b/llvm/lib/Bytecode/Reader/ArchiveReader.cpp
index d155b69beec..33ae24b60ea 100644
--- a/llvm/lib/Bytecode/Reader/ArchiveReader.cpp
+++ b/llvm/lib/Bytecode/Reader/ArchiveReader.cpp
@@ -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 @@ namespace {
};
}
-
// 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 @@ bool ReadArchiveFile(const std::string &Filename, std::vector<Module*> &Objects,
return Result;
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Bytecode/Reader/ConstantReader.cpp b/llvm/lib/Bytecode/Reader/ConstantReader.cpp
index 00f44b3665e..b4553548e8e 100644
--- a/llvm/lib/Bytecode/Reader/ConstantReader.cpp
+++ b/llvm/lib/Bytecode/Reader/ConstantReader.cpp
@@ -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 @@ void BytecodeParser::ParseConstantPool(const unsigned char *&Buf,
if (Buf > EndBuf) throw std::string("Read past end of buffer.");
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Bytecode/Reader/InstructionReader.cpp b/llvm/lib/Bytecode/Reader/InstructionReader.cpp
index a409ceebef9..ec8944e7a87 100644
--- a/llvm/lib/Bytecode/Reader/InstructionReader.cpp
+++ b/llvm/lib/Bytecode/Reader/InstructionReader.cpp
@@ -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 @@ namespace {
};
}
-
-
RawInst::RawInst(const unsigned char *&Buf, const unsigned char *EndBuf,
std::vector<unsigned> &Args) {
unsigned Op, Typ;
@@ -389,3 +389,5 @@ void BytecodeParser::ParseInstruction(const unsigned char *&Buf,
BB->getInstList().push_back(Result);
BCR_TRACE(4, *Result);
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Bytecode/Reader/Reader.cpp b/llvm/lib/Bytecode/Reader/Reader.cpp
index a36ea7a7348..9acb93d48a6 100644
--- a/llvm/lib/Bytecode/Reader/Reader.cpp
+++ b/llvm/lib/Bytecode/Reader/Reader.cpp
@@ -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 @@ void BytecodeParser::ParseBytecode(const unsigned char *Buf, unsigned Length,
throw;
}
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Bytecode/Reader/ReaderInternals.h b/llvm/lib/Bytecode/Reader/ReaderInternals.h
index c8905454e67..81ccde97fff 100644
--- a/llvm/lib/Bytecode/Reader/ReaderInternals.h
+++ b/llvm/lib/Bytecode/Reader/ReaderInternals.h
@@ -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
@@ -226,4 +228,6 @@ static inline void readBlock(const unsigned char *&Buf,
#endif
}
+} // End llvm namespace
+
#endif
diff --git a/llvm/lib/Bytecode/Reader/ReaderWrappers.cpp b/llvm/lib/Bytecode/Reader/ReaderWrappers.cpp
index 0df6ea5ff23..1cbead02e85 100644
--- a/llvm/lib/Bytecode/Reader/ReaderWrappers.cpp
+++ b/llvm/lib/Bytecode/Reader/ReaderWrappers.cpp
@@ -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 @@ BytecodeStdinReader::BytecodeStdinReader() {
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 @@ static ModuleProvider *CheckVarargs(ModuleProvider *MP) {
return MP;
}
-
//===----------------------------------------------------------------------===//
// Wrapper functions
//===----------------------------------------------------------------------===//
@@ -296,3 +297,5 @@ Module *ParseBytecodeFile(const std::string &Filename, std::string *ErrorStr) {
return 0;
}
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Bytecode/Writer/ConstantWriter.cpp b/llvm/lib/Bytecode/Writer/ConstantWriter.cpp
index a9aaffe3eca..303672d166f 100644
--- a/llvm/lib/Bytecode/Writer/ConstantWriter.cpp
+++ b/llvm/lib/Bytecode/Writer/ConstantWriter.cpp
@@ -17,6 +17,8 @@
#include "llvm/SymbolTable.h"
#include "llvm/DerivedTypes.h"
+namespace llvm {
+
void BytecodeWriter::outputType(const Type *T) {
output_vbr((unsigned)T->getPrimitiveID(), Out);
@@ -202,3 +204,5 @@ bool BytecodeWriter::outputConstant(const Constant *CPV) {
}
return false;
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Bytecode/Writer/InstructionWriter.cpp b/llvm/lib/Bytecode/Writer/InstructionWriter.cpp
index faa576ecb46..d52f24145f4 100644
--- a/llvm/lib/Bytecode/Writer/InstructionWriter.cpp
+++ b/llvm/lib/Bytecode/Writer/InstructionWriter.cpp
@@ -19,6 +19,8 @@
#include "Support/Statistic.h"
#include <algorithm>
+namespace llvm {
+
static Statistic<>
NumInstrs("bytecodewriter", "Number of instructions");
@@ -295,3 +297,5 @@ void BytecodeWriter::processInstruction(const Instruction &I) {
// operands or a large operand index that we are referring to.
outputInstructionFormat0(&I, Opcode, Table, Type, Out);
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Bytecode/Writer/Writer.cpp b/llvm/lib/Bytecode/Writer/Writer.cpp
index 9381e355f0e..9c9e1abcdd8 100644
--- a/llvm/lib/Bytecode/Writer/Writer.cpp
+++ b/llvm/lib/Bytecode/Writer/Writer.cpp
@@ -36,6 +36,8 @@
#include "Config/string.h"
#include <algorithm>
+namespace llvm {
+
static RegisterPass<WriteBytecodePass> X("emitbytecode", "Bytecode Writer");
static Statistic<>
@@ -304,3 +306,5 @@ void WriteBytecodeToFile(const Module *C, std::ostream &Out) {
Out.flush();
}
+
+} // End llvm namespace
diff --git a/llvm/lib/Bytecode/Writer/WriterInternals.h b/llvm/lib/Bytecode/Writer/WriterInternals.h
index 5564f4238ec..8cb4bfd8d6c 100644
--- a/llvm/lib/Bytecode/Writer/WriterInternals.h
+++ b/llvm/lib/Bytecode/Writer/WriterInternals.h
@@ -25,6 +25,8 @@
#include "llvm/SlotCalculator.h"
#include "llvm/Instruction.h"
+namespace llvm {
+
class BytecodeWriter {
std::deque<unsigned char> &Out;
SlotCalculator Table;
@@ -79,5 +81,6 @@ public:
}
};
+} // End llvm namespace
#endif
OpenPOWER on IntegriCloud