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

Unified Diff: include/llvm/Bitcode/NaCl/NaClBitCodes.h

Issue 14682013: Copy BitCodes.h to NaCl/NaClBitCodes.h (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
« no previous file with comments | « no previous file | include/llvm/Bitcode/NaCl/NaClBitstreamReader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/llvm/Bitcode/NaCl/NaClBitCodes.h
diff --git a/include/llvm/Bitcode/BitCodes.h b/include/llvm/Bitcode/NaCl/NaClBitCodes.h
similarity index 87%
copy from include/llvm/Bitcode/BitCodes.h
copy to include/llvm/Bitcode/NaCl/NaClBitCodes.h
index b510daf331470722684c08e5270cdbb33820b17f..4c0f754f7bab3ef33369679f15bdbe5b0bc829d9 100644
--- a/include/llvm/Bitcode/BitCodes.h
+++ b/include/llvm/Bitcode/NaCl/NaClBitCodes.h
@@ -1,4 +1,4 @@
-//===- BitCodes.h - Enum values for the bitcode format ----------*- C++ -*-===//
+//===- NaClBitCodes.h - Enum values for the bitcode format ------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -15,8 +15,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_BITCODE_BITCODES_H
-#define LLVM_BITCODE_BITCODES_H
+#ifndef LLVM_BITCODE_NACL_NACLBITCODES_H
+#define LLVM_BITCODE_NACL_NACLBITCODES_H
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/DataTypes.h"
@@ -24,7 +24,7 @@
#include <cassert>
namespace llvm {
-namespace bitc {
+namespace naclbitc {
enum StandardWidths {
BlockIDWidth = 8, // We use VBR-8 for block IDs.
CodeLenWidth = 4, // Codelen are VBR-4.
@@ -76,14 +76,14 @@ namespace bitc {
// [id, name]
};
-} // End bitc namespace
+} // End naclbitc namespace
-/// BitCodeAbbrevOp - This describes one or more operands in an abbreviation.
+/// NaClBitCodeAbbrevOp - This describes one or more operands in an abbreviation.
/// This is actually a union of two different things:
/// 1. It could be a literal integer value ("the operand is always 17").
/// 2. It could be an encoding specification ("this operand encoded like so").
///
-class BitCodeAbbrevOp {
+class NaClBitCodeAbbrevOp {
uint64_t Val; // A literal value or data for an encoding.
bool IsLiteral : 1; // Indicate whether this is a literal value or not.
unsigned Enc : 3; // The encoding to use.
@@ -96,8 +96,8 @@ public:
Blob = 5 // 32-bit aligned array of 8-bit characters.
};
- explicit BitCodeAbbrevOp(uint64_t V) : Val(V), IsLiteral(true) {}
- explicit BitCodeAbbrevOp(Encoding E, uint64_t Data = 0)
+ explicit NaClBitCodeAbbrevOp(uint64_t V) : Val(V), IsLiteral(true) {}
+ explicit NaClBitCodeAbbrevOp(Encoding E, uint64_t Data = 0)
: Val(Data), IsLiteral(false), Enc(E) {}
bool isLiteral() const { return IsLiteral; }
@@ -156,17 +156,19 @@ public:
};
-template <> struct isPodLike<BitCodeAbbrevOp> { static const bool value=true; };
+template <> struct isPodLike<NaClBitCodeAbbrevOp> {
+ static const bool value=true;
+};
-/// BitCodeAbbrev - This class represents an abbreviation record. An
+/// NaClBitCodeAbbrev - This class represents an abbreviation record. An
/// abbreviation allows a complex record that has redundancy to be stored in a
/// specialized format instead of the fully-general, fully-vbr, format.
-class BitCodeAbbrev {
- SmallVector<BitCodeAbbrevOp, 32> OperandList;
+class NaClBitCodeAbbrev {
+ SmallVector<NaClBitCodeAbbrevOp, 32> OperandList;
unsigned char RefCount; // Number of things using this.
- ~BitCodeAbbrev() {}
+ ~NaClBitCodeAbbrev() {}
public:
- BitCodeAbbrev() : RefCount(1) {}
+ NaClBitCodeAbbrev() : RefCount(1) {}
void addRef() { ++RefCount; }
void dropRef() { if (--RefCount == 0) delete this; }
@@ -174,11 +176,11 @@ public:
unsigned getNumOperandInfos() const {
return static_cast<unsigned>(OperandList.size());
}
- const BitCodeAbbrevOp &getOperandInfo(unsigned N) const {
+ const NaClBitCodeAbbrevOp &getOperandInfo(unsigned N) const {
return OperandList[N];
}
- void Add(const BitCodeAbbrevOp &OpInfo) {
+ void Add(const NaClBitCodeAbbrevOp &OpInfo) {
OperandList.push_back(OpInfo);
}
};
« no previous file with comments | « no previous file | include/llvm/Bitcode/NaCl/NaClBitstreamReader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698