Chromium Code Reviews| 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..5abf99a08e7ce509f8544fb204b7c26468178940 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. |
| @@ -78,12 +78,12 @@ namespace bitc { |
| } // End bitc namespace |
|
jvoung (off chromium)
2013/05/01 23:41:13
naclbitc
Karl
2013/05/02 14:32:14
Done.
|
| -/// 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); |
| } |
| }; |