summaryrefslogtreecommitdiffstats
path: root/include/llvm/Bitcode
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2010-09-17 15:48:55 +0000
committerdim <dim@FreeBSD.org>2010-09-17 15:48:55 +0000
commit5d5cc59cc77afe655b3707cb0e69e0827b444cad (patch)
tree36453626c792cccd91f783a38a169d610a6b9db9 /include/llvm/Bitcode
parent786a18553586229ad99ecb5ecde8a9d914c45e27 (diff)
downloadFreeBSD-src-5d5cc59cc77afe655b3707cb0e69e0827b444cad.zip
FreeBSD-src-5d5cc59cc77afe655b3707cb0e69e0827b444cad.tar.gz
Vendor import of llvm r114020 (from the release_28 branch):
http://llvm.org/svn/llvm-project/llvm/branches/release_28@114020 Approved by: rpaulo (mentor)
Diffstat (limited to 'include/llvm/Bitcode')
-rw-r--r--include/llvm/Bitcode/Archive.h6
-rw-r--r--include/llvm/Bitcode/BitstreamWriter.h8
-rw-r--r--include/llvm/Bitcode/LLVMBitCodes.h31
3 files changed, 29 insertions, 16 deletions
diff --git a/include/llvm/Bitcode/Archive.h b/include/llvm/Bitcode/Archive.h
index 83a3758..934e764 100644
--- a/include/llvm/Bitcode/Archive.h
+++ b/include/llvm/Bitcode/Archive.h
@@ -297,7 +297,7 @@ class Archive {
/// its symbol table without reading in any of the archive's members. This
/// reduces both I/O and cpu time in opening the archive if it is to be used
/// solely for symbol lookup (e.g. during linking). The \p Filename must
- /// exist and be an archive file or an exception will be thrown. This form
+ /// exist and be an archive file or an error will be returned. This form
/// of opening the archive is intended for read-only operations that need to
/// locate members via the symbol table for link editing. Since the archve
/// members are not read by this method, the archive will appear empty upon
@@ -306,8 +306,7 @@ class Archive {
/// if this form of opening the archive is used that only the symbol table
/// lookup methods (getSymbolTable, findModuleDefiningSymbol, and
/// findModulesDefiningSymbols) be used.
- /// @throws std::string if an error occurs opening the file
- /// @returns an Archive* that represents the archive file.
+ /// @returns an Archive* that represents the archive file, or null on error.
/// @brief Open an existing archive and load its symbols.
static Archive* OpenAndLoadSymbols(
const sys::Path& Filename, ///< Name of the archive file to open
@@ -319,7 +318,6 @@ class Archive {
/// closes files. It does nothing with the archive file on disk. If you
/// haven't used the writeToDisk method by the time the destructor is
/// called, all changes to the archive will be lost.
- /// @throws std::string if an error occurs
/// @brief Destruct in-memory archive
~Archive();
diff --git a/include/llvm/Bitcode/BitstreamWriter.h b/include/llvm/Bitcode/BitstreamWriter.h
index 31d513c..bfb3a4e 100644
--- a/include/llvm/Bitcode/BitstreamWriter.h
+++ b/include/llvm/Bitcode/BitstreamWriter.h
@@ -88,7 +88,7 @@ public:
//===--------------------------------------------------------------------===//
void Emit(uint32_t Val, unsigned NumBits) {
- assert(NumBits <= 32 && "Invalid value size!");
+ assert(NumBits && NumBits <= 32 && "Invalid value size!");
assert((Val & ~(~0U >> (32-NumBits))) == 0 && "High bits set!");
CurValue |= Val << CurBit;
if (CurBit + NumBits < 32) {
@@ -277,10 +277,12 @@ private:
switch (Op.getEncoding()) {
default: assert(0 && "Unknown encoding!");
case BitCodeAbbrevOp::Fixed:
- Emit((unsigned)V, (unsigned)Op.getEncodingData());
+ if (Op.getEncodingData())
+ Emit((unsigned)V, (unsigned)Op.getEncodingData());
break;
case BitCodeAbbrevOp::VBR:
- EmitVBR64(V, (unsigned)Op.getEncodingData());
+ if (Op.getEncodingData())
+ EmitVBR64(V, (unsigned)Op.getEncodingData());
break;
case BitCodeAbbrevOp::Char6:
Emit(BitCodeAbbrevOp::EncodeChar6((char)V), 6);
diff --git a/include/llvm/Bitcode/LLVMBitCodes.h b/include/llvm/Bitcode/LLVMBitCodes.h
index de9b64d..4f9b783 100644
--- a/include/llvm/Bitcode/LLVMBitCodes.h
+++ b/include/llvm/Bitcode/LLVMBitCodes.h
@@ -94,8 +94,7 @@ namespace bitc {
TYPE_CODE_FP128 = 14, // LONG DOUBLE (112 bit mantissa)
TYPE_CODE_PPC_FP128= 15, // PPC LONG DOUBLE (2 doubles)
- TYPE_CODE_METADATA = 16, // METADATA
- TYPE_CODE_UNION = 17 // UNION: [eltty x N]
+ TYPE_CODE_METADATA = 16 // METADATA
};
// The type symbol table only has one code (TST_ENTRY_CODE).
@@ -111,12 +110,20 @@ namespace bitc {
enum MetadataCodes {
METADATA_STRING = 1, // MDSTRING: [values]
- METADATA_NODE = 2, // MDNODE: [n x (type num, value num)]
- METADATA_FN_NODE = 3, // FN_MDNODE: [n x (type num, value num)]
+ // FIXME: Remove NODE in favor of NODE2 in LLVM 3.0
+ METADATA_NODE = 2, // NODE with potentially invalid metadata
+ // FIXME: Remove FN_NODE in favor of FN_NODE2 in LLVM 3.0
+ METADATA_FN_NODE = 3, // FN_NODE with potentially invalid metadata
METADATA_NAME = 4, // STRING: [values]
- METADATA_NAMED_NODE = 5, // NAMEDMDNODE: [n x mdnodes]
+ // FIXME: Remove NAMED_NODE in favor of NAMED_NODE2 in LLVM 3.0
+ METADATA_NAMED_NODE = 5, // NAMED_NODE with potentially invalid metadata
METADATA_KIND = 6, // [n x [id, name]]
- METADATA_ATTACHMENT = 7 // [m x [value, [n x [id, mdnode]]]
+ // FIXME: Remove ATTACHMENT in favor of ATTACHMENT2 in LLVM 3.0
+ METADATA_ATTACHMENT = 7, // ATTACHMENT with potentially invalid metadata
+ METADATA_NODE2 = 8, // NODE2: [n x (type num, value num)]
+ METADATA_FN_NODE2 = 9, // FN_NODE2: [n x (type num, value num)]
+ METADATA_NAMED_NODE2 = 10, // NAMED_NODE2: [n x mdnodes]
+ METADATA_ATTACHMENT2 = 11 // [m x [value, [n x [id, mdnode]]]
};
// The constants block (CONSTANTS_BLOCK_ID) describes emission for each
// constant and maintains an implicit current type value.
@@ -224,7 +231,8 @@ namespace bitc {
FUNC_CODE_INST_LOAD = 20, // LOAD: [opty, op, align, vol]
// FIXME: Remove STORE in favor of STORE2 in LLVM 3.0
FUNC_CODE_INST_STORE = 21, // STORE: [valty,val,ptr, align, vol]
- FUNC_CODE_INST_CALL = 22, // CALL: [attr, fnty, fnid, args...]
+ // FIXME: Remove CALL in favor of CALL2 in LLVM 3.0
+ FUNC_CODE_INST_CALL = 22, // CALL with potentially invalid metadata
FUNC_CODE_INST_VAARG = 23, // VAARG: [valistty, valist, instty]
// This store code encodes the pointer type, rather than the value type
// this is so information only available in the pointer type (e.g. address
@@ -242,8 +250,13 @@ namespace bitc {
FUNC_CODE_INST_INBOUNDS_GEP= 30, // INBOUNDS_GEP: [n x operands]
FUNC_CODE_INST_INDIRECTBR = 31, // INDIRECTBR: [opty, op0, op1, ...]
- FUNC_CODE_DEBUG_LOC = 32, // DEBUG_LOC: [Line,Col,ScopeVal, IAVal]
- FUNC_CODE_DEBUG_LOC_AGAIN = 33 // DEBUG_LOC_AGAIN
+ // FIXME: Remove DEBUG_LOC in favor of DEBUG_LOC2 in LLVM 3.0
+ FUNC_CODE_DEBUG_LOC = 32, // DEBUG_LOC with potentially invalid metadata
+ FUNC_CODE_DEBUG_LOC_AGAIN = 33, // DEBUG_LOC_AGAIN
+
+ FUNC_CODE_INST_CALL2 = 34, // CALL2: [attr, fnty, fnid, args...]
+
+ FUNC_CODE_DEBUG_LOC2 = 35 // DEBUG_LOC2: [Line,Col,ScopeVal, IAVal]
};
} // End bitc namespace
} // End llvm namespace
OpenPOWER on IntegriCloud