Chromium Code Reviews| Index: include/llvm/Bitcode/NaCl/NaClBitCodes.h |
| diff --git a/include/llvm/Bitcode/NaCl/NaClBitCodes.h b/include/llvm/Bitcode/NaCl/NaClBitCodes.h |
| index 8c0eb5e1a2484a95e1d1a13d58ecb5d1d07892a9..e1c00554dc168ce69d05c5ab152a6b78b2b814f9 100644 |
| --- a/include/llvm/Bitcode/NaCl/NaClBitCodes.h |
| +++ b/include/llvm/Bitcode/NaCl/NaClBitCodes.h |
| @@ -25,6 +25,8 @@ |
| #include <cassert> |
| namespace llvm { |
| +class raw_ostream; |
| + |
| namespace naclbitc { |
| enum StandardWidths { |
| BlockIDWidth = 8, // We use VBR-8 for block IDs. |
| @@ -147,6 +149,21 @@ public: |
| report_fatal_error("Invalid encoding"); |
| } |
| + bool isArrayOp() const { |
| + return isEncoding() && Enc == Array; |
| + } |
| + |
| + /// Returns the number of arguments expected by this abbrevation operator. |
| + unsigned NumArguments() const { |
| + if (isEncoding() && (Encoding)Enc == Array) |
|
jvoung (off chromium)
2014/02/06 20:37:19
same as isArrayOp() ?
Karl
2014/02/07 19:37:29
Done.
|
| + return 1; |
| + else |
| + return 0; |
| + } |
| + |
| + /// Prints out the abbreviation operator to the given stream. |
| + void Print(raw_ostream &Stream) const; |
| + |
| /// isChar6 - Return true if this character is legal in the Char6 encoding. |
| static bool isChar6(char C) { |
| if (C >= 'a' && C <= 'z') return true; |
| @@ -263,6 +280,10 @@ public: |
| OperandList.push_back(OpInfo); |
| } |
| + // Returns a simplified version of the abbreviation. Used |
| + // to recognize equivalent abbrevations. |
| + NaClBitCodeAbbrev *Simplify() const; |
| + |
| int Compare(const NaClBitCodeAbbrev &Abbrev) const { |
| // First order based on number of operands. |
| size_t OperandListSize = OperandList.size(); |
| @@ -280,6 +301,8 @@ public: |
| return 0; |
| } |
| + void Print(raw_ostream &Stream) const; |
| + |
| NaClBitCodeAbbrev *Copy() const { |
| NaClBitCodeAbbrev *AbbrevCopy = new NaClBitCodeAbbrev(); |
| for (unsigned I = 0, IEnd = getNumOperandInfos(); |