Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1018)

Unified Diff: lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h

Issue 14314016: Copy LLVM bitcode reader to generate a PNaCl wire format reader. (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h
diff --git a/lib/Bitcode/Reader/BitcodeReader.h b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h
similarity index 91%
copy from lib/Bitcode/Reader/BitcodeReader.h
copy to lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h
index 28674eb14ef2aece9f43a142d7283ed3ad1ec9ec..022e254dc9ae398a2099954703a9920aa31f216e 100644
--- a/lib/Bitcode/Reader/BitcodeReader.h
+++ b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.h
@@ -1,4 +1,5 @@
-//===- BitcodeReader.h - Internal BitcodeReader impl ------------*- C++ -*-===//
+//===- NaClBitcodeReader.h ------------------------------------*- C++ -*-===//
+// Internal NaClBitcodeReader implementation
//
// The LLVM Compiler Infrastructure
//
@@ -7,16 +8,16 @@
//
//===----------------------------------------------------------------------===//
//
-// This header defines the BitcodeReader class.
+// This header defines the NaClBitcodeReader class.
//
//===----------------------------------------------------------------------===//
-#ifndef BITCODE_READER_H
-#define BITCODE_READER_H
+#ifndef NACL_BITCODE_READER_H
+#define NACL_BITCODE_READER_H
#include "llvm/ADT/DenseMap.h"
-#include "llvm/Bitcode/BitstreamReader.h"
-#include "llvm/Bitcode/LLVMBitCodes.h"
+#include "llvm/Bitcode/NaCl/NaClBitstreamReader.h"
+#include "llvm/Bitcode/NaCl/NaClBitCodes.h"
#include "llvm/GVMaterializer.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/OperandTraits.h"
@@ -29,10 +30,10 @@ namespace llvm {
class LLVMContext;
//===----------------------------------------------------------------------===//
-// BitcodeReaderValueList Class
+// NaClBitcodeReaderValueList Class
//===----------------------------------------------------------------------===//
-class BitcodeReaderValueList {
+class NaClBitcodeReaderValueList {
std::vector<WeakVH> ValuePtrs;
/// ResolveConstants - As we resolve forward-referenced constants, we add
@@ -46,8 +47,8 @@ class BitcodeReaderValueList {
ResolveConstantsTy ResolveConstants;
LLVMContext &Context;
public:
- BitcodeReaderValueList(LLVMContext &C) : Context(C) {}
- ~BitcodeReaderValueList() {
+ NaClBitcodeReaderValueList(LLVMContext &C) : Context(C) {}
+ ~NaClBitcodeReaderValueList() {
assert(ResolveConstants.empty() && "Constants not resolved?");
}
@@ -88,15 +89,15 @@ public:
//===----------------------------------------------------------------------===//
-// BitcodeReaderMDValueList Class
+// NaClBitcodeReaderMDValueList Class
//===----------------------------------------------------------------------===//
-class BitcodeReaderMDValueList {
+class NaClBitcodeReaderMDValueList {
std::vector<WeakVH> MDValuePtrs;
LLVMContext &Context;
public:
- BitcodeReaderMDValueList(LLVMContext& C) : Context(C) {}
+ NaClBitcodeReaderMDValueList(LLVMContext& C) : Context(C) {}
// vector compatibility methods
unsigned size() const { return MDValuePtrs.size(); }
@@ -121,13 +122,13 @@ public:
void AssignValue(Value *V, unsigned Idx);
};
-class BitcodeReader : public GVMaterializer {
+class NaClBitcodeReader : public GVMaterializer {
LLVMContext &Context;
Module *TheModule;
MemoryBuffer *Buffer;
bool BufferOwned;
- OwningPtr<BitstreamReader> StreamFile;
- BitstreamCursor Stream;
+ OwningPtr<NaClBitstreamReader> StreamFile;
+ NaClBitstreamCursor Stream;
DataStreamer *LazyStreamer;
uint64_t NextUnreadBit;
bool SeenValueSymbolTable;
@@ -135,8 +136,8 @@ class BitcodeReader : public GVMaterializer {
const char *ErrorString;
std::vector<Type*> TypeList;
- BitcodeReaderValueList ValueList;
- BitcodeReaderMDValueList MDValueList;
+ NaClBitcodeReaderValueList ValueList;
+ NaClBitcodeReaderMDValueList MDValueList;
SmallVector<Instruction *, 64> InstructionList;
SmallVector<SmallVector<uint64_t, 64>, 64> UseListRecords;
@@ -192,19 +193,19 @@ class BitcodeReader : public GVMaterializer {
bool UseRelativeIDs;
public:
- explicit BitcodeReader(MemoryBuffer *buffer, LLVMContext &C)
+ explicit NaClBitcodeReader(MemoryBuffer *buffer, LLVMContext &C)
: Context(C), TheModule(0), Buffer(buffer), BufferOwned(false),
LazyStreamer(0), NextUnreadBit(0), SeenValueSymbolTable(false),
ErrorString(0), ValueList(C), MDValueList(C),
SeenFirstFunctionBody(false), UseRelativeIDs(false) {
}
- explicit BitcodeReader(DataStreamer *streamer, LLVMContext &C)
+ explicit NaClBitcodeReader(DataStreamer *streamer, LLVMContext &C)
: Context(C), TheModule(0), Buffer(0), BufferOwned(false),
LazyStreamer(streamer), NextUnreadBit(0), SeenValueSymbolTable(false),
ErrorString(0), ValueList(C), MDValueList(C),
SeenFirstFunctionBody(false), UseRelativeIDs(false) {
}
- ~BitcodeReader() {
+ ~NaClBitcodeReader() {
FreeState();
}

Powered by Google App Engine
This is Rietveld 408576698