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

Unified Diff: include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.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
« no previous file with comments | « include/llvm/Bitcode/NaCl/NaClBitstreamReader.h ('k') | include/llvm/Bitcode/NaCl/NaClReaderWriter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h
diff --git a/include/llvm/Bitcode/LLVMBitCodes.h b/include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h
similarity index 92%
copy from include/llvm/Bitcode/LLVMBitCodes.h
copy to include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h
index f9690d5b779c0113468753d6f95aefdd9651cb97..2a82185c98c12b5818736412df9065f76f1af551 100644
--- a/include/llvm/Bitcode/LLVMBitCodes.h
+++ b/include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h
@@ -1,4 +1,5 @@
-//===- LLVMBitCodes.h - Enum values for the LLVM bitcode format -*- C++ -*-===//
+//===- NaClBitCodes.h -------------------------------------------*- C++ -*-===//
jvoung (off chromium) 2013/05/01 17:33:36 NaClLLVMBitCodes.h
Karl 2013/05/01 17:43:06 Done.
+// Enum values for the NaCl bitcode wire format
//
// The LLVM Compiler Infrastructure
//
@@ -7,7 +8,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This header defines Bitcode enum values for LLVM IR bitcode files.
+// This header defines Bitcode enum values for NaCl bitcode wire format.
//
// The enum values defined in this file should be considered permanent. If
// new features are added, they should have values added at the end of the
@@ -15,17 +16,19 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_BITCODE_LLVMBITCODES_H
-#define LLVM_BITCODE_LLVMBITCODES_H
+#ifndef LLVM_BITCODE_NACL_NACLBITCODES_H
jvoung (off chromium) 2013/05/01 17:33:36 NACLLLVMBITCODES_H
Karl 2013/05/01 17:43:06 Done.
jvoung (off chromium) 2013/05/01 17:48:09 I don't see this part of the change in patchset 5?
+#define LLVM_BITCODE_NACL_NACLBITCODES_H
+// TODO(kschimpf) Make a NaCl version of BitCodes.h, so that block id's
+// and abbreviations can be modified.
#include "llvm/Bitcode/BitCodes.h"
Karl 2013/05/01 16:23:23 Added TODO here to move BitCodes.h into NaCl subdi
namespace llvm {
-namespace bitc {
+namespace naclbitc {
// The only top-level block type defined is for a module.
- enum BlockIDs {
+ enum NaClBlockIDs {
// Blocks
- MODULE_BLOCK_ID = FIRST_APPLICATION_BLOCKID,
+ MODULE_BLOCK_ID = bitc::FIRST_APPLICATION_BLOCKID,
// Module sub-block id's.
PARAMATTR_BLOCK_ID,
@@ -47,7 +50,7 @@ namespace bitc {
/// MODULE blocks have a number of optional fields and subblocks.
- enum ModuleCodes {
+ enum NaClModuleCodes {
MODULE_CODE_VERSION = 1, // VERSION: [version#]
MODULE_CODE_TRIPLE = 2, // TRIPLE: [strchr x N]
MODULE_CODE_DATALAYOUT = 3, // DATALAYOUT: [strchr x N]
@@ -75,7 +78,7 @@ namespace bitc {
};
/// PARAMATTR blocks have code for defining a parameter attribute set.
- enum AttributeCodes {
+ enum NaClAttributeCodes {
// FIXME: Remove `PARAMATTR_CODE_ENTRY_OLD' in 4.0
PARAMATTR_CODE_ENTRY_OLD = 1, // ENTRY: [paramidx0, attr0,
// paramidx1, attr1...]
@@ -85,7 +88,7 @@ namespace bitc {
};
/// TYPE blocks have codes for each type primitive they use.
- enum TypeCodes {
+ enum NaClTypeCodes {
TYPE_CODE_NUMENTRY = 1, // NUMENTRY: [numentries]
// Type Codes
@@ -124,17 +127,17 @@ namespace bitc {
};
// The type symbol table only has one code (TST_ENTRY_CODE).
- enum TypeSymtabCodes {
+ enum NaClTypeSymtabCodes {
TST_CODE_ENTRY = 1 // TST_ENTRY: [typeid, namechar x N]
};
// The value symbol table only has one code (VST_ENTRY_CODE).
- enum ValueSymtabCodes {
+ enum NaClValueSymtabCodes {
VST_CODE_ENTRY = 1, // VST_ENTRY: [valid, namechar x N]
VST_CODE_BBENTRY = 2 // VST_BBENTRY: [bbid, namechar x N]
};
- enum MetadataCodes {
+ enum NaClMetadataCodes {
METADATA_STRING = 1, // MDSTRING: [values]
// 2 is unused.
// 3 is unused.
@@ -150,7 +153,7 @@ namespace bitc {
// The constants block (CONSTANTS_BLOCK_ID) describes emission for each
// constant and maintains an implicit current type value.
- enum ConstantsCodes {
+ enum NaClConstantsCodes {
CST_CODE_SETTYPE = 1, // SETTYPE: [typeid]
CST_CODE_NULL = 2, // NULL
CST_CODE_UNDEF = 3, // UNDEF
@@ -182,7 +185,7 @@ namespace bitc {
/// cast a CST_CODE_CE_CAST or a XXX refers to. The values of these enums
/// have no fixed relation to the LLVM IR enum values. Changing these will
/// break compatibility with old files.
- enum CastOpcodes {
+ enum NaClCastOpcodes {
CAST_TRUNC = 0,
CAST_ZEXT = 1,
CAST_SEXT = 2,
@@ -201,7 +204,7 @@ namespace bitc {
/// binop a CST_CODE_CE_BINOP or a XXX refers to. The values of these enums
/// have no fixed relation to the LLVM IR enum values. Changing these will
/// break compatibility with old files.
- enum BinaryOpcodes {
+ enum NaClBinaryOpcodes {
BINOP_ADD = 0,
BINOP_SUB = 1,
BINOP_MUL = 2,
@@ -220,7 +223,7 @@ namespace bitc {
/// These are values used in the bitcode files to encode AtomicRMW operations.
/// The values of these enums have no fixed relation to the LLVM IR enum
/// values. Changing these will break compatibility with old files.
- enum RMWOperations {
+ enum NaClRMWOperations {
RMW_XCHG = 0,
RMW_ADD = 1,
RMW_SUB = 2,
@@ -236,19 +239,19 @@ namespace bitc {
/// OverflowingBinaryOperatorOptionalFlags - Flags for serializing
/// OverflowingBinaryOperator's SubclassOptionalData contents.
- enum OverflowingBinaryOperatorOptionalFlags {
+ enum NaClOverflowingBinaryOperatorOptionalFlags {
OBO_NO_UNSIGNED_WRAP = 0,
OBO_NO_SIGNED_WRAP = 1
};
/// PossiblyExactOperatorOptionalFlags - Flags for serializing
/// PossiblyExactOperator's SubclassOptionalData contents.
- enum PossiblyExactOperatorOptionalFlags {
+ enum NaClPossiblyExactOperatorOptionalFlags {
PEO_EXACT = 0
};
/// Encoded AtomicOrdering values.
- enum AtomicOrderingCodes {
+ enum NaClAtomicOrderingCodes {
ORDERING_NOTATOMIC = 0,
ORDERING_UNORDERED = 1,
ORDERING_MONOTONIC = 2,
@@ -259,14 +262,14 @@ namespace bitc {
};
/// Encoded SynchronizationScope values.
- enum AtomicSynchScopeCodes {
+ enum NaClAtomicSynchScopeCodes {
SYNCHSCOPE_SINGLETHREAD = 0,
SYNCHSCOPE_CROSSTHREAD = 1
};
// The function body block (FUNCTION_BLOCK_ID) describes function bodies. It
// can contain a constant block (CONSTANTS_BLOCK_ID).
- enum FunctionCodes {
+ enum NaClFunctionCodes {
FUNC_CODE_DECLAREBLOCKS = 1, // DECLAREBLOCKS: [n]
FUNC_CODE_INST_BINOP = 2, // BINOP: [opcode, ty, opval, opval]
@@ -327,10 +330,10 @@ namespace bitc {
// ordering, synchscope]
};
- enum UseListCodes {
+ enum NaClUseListCodes {
USELIST_CODE_ENTRY = 1 // USELIST_CODE_ENTRY: TBD.
};
-} // End bitc namespace
+} // End naclbitc namespace
} // End llvm namespace
#endif
« no previous file with comments | « include/llvm/Bitcode/NaCl/NaClBitstreamReader.h ('k') | include/llvm/Bitcode/NaCl/NaClReaderWriter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698