diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-02-04 23:32:23 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-02-04 23:32:23 +0000 |
commit | f9271ea159b97e2febedcf095c3c4122cb24d077 (patch) | |
tree | 3c039e9f6223cafc13bb494584f6e434858fe6de /include/llvm | |
parent | 638c63ccf74807bbbff444d527a0acad592b3802 (diff) | |
download | external_llvm-f9271ea159b97e2febedcf095c3c4122cb24d077.zip external_llvm-f9271ea159b97e2febedcf095c3c4122cb24d077.tar.gz external_llvm-f9271ea159b97e2febedcf095c3c4122cb24d077.tar.bz2 |
Initial cleanups of the param-attribute code in the bitcode reader/writer.
Rename the PARAMATTR_CODE_ENTRY to PARAMATTR_CODE_ENTRY_OLD. It will be replaced
by another encoding. Keep around the current LLVM attribute encoder/decoder
code, but move it to the bitcode directories so that no one's tempted to use
them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174335 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Bitcode/LLVMBitCodes.h | 7 | ||||
-rw-r--r-- | include/llvm/IR/Attributes.h | 20 |
2 files changed, 9 insertions, 18 deletions
diff --git a/include/llvm/Bitcode/LLVMBitCodes.h b/include/llvm/Bitcode/LLVMBitCodes.h index 601777d..de8ac39 100644 --- a/include/llvm/Bitcode/LLVMBitCodes.h +++ b/include/llvm/Bitcode/LLVMBitCodes.h @@ -77,7 +77,11 @@ namespace bitc { /// PARAMATTR blocks have code for defining a parameter attribute set. enum AttributeCodes { - PARAMATTR_CODE_ENTRY = 1 // ENTRY: [paramidx0, attr0, paramidx1, attr1...] + // FIXME: Remove `PARAMATTR_CODE_ENTRY_OLD' in 4.0 + PARAMATTR_CODE_ENTRY_OLD = 1, // ENTRY: [paramidx0, attr0, + // paramidx1, attr1...] + PARAMATTR_CODE_ENTRY = 2 // ENTRY: [paramidx0, attrgrp0, + // paramidx1, attrgrp1...] }; /// TYPE blocks have codes for each type primitive they use. @@ -143,6 +147,7 @@ namespace bitc { METADATA_NAMED_NODE = 10, // NAMED_NODE: [n x mdnodes] METADATA_ATTACHMENT = 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. enum ConstantsCodes { diff --git a/include/llvm/IR/Attributes.h b/include/llvm/IR/Attributes.h index c5b5a47..c726020 100644 --- a/include/llvm/IR/Attributes.h +++ b/include/llvm/IR/Attributes.h @@ -345,8 +345,8 @@ class AttrBuilder { uint64_t StackAlignment; public: AttrBuilder() : Alignment(0), StackAlignment(0) {} - explicit AttrBuilder(uint64_t B) : Alignment(0), StackAlignment(0) { - addRawValue(B); + explicit AttrBuilder(uint64_t Val) : Alignment(0), StackAlignment(0) { + addRawValue(Val); } AttrBuilder(const Attribute &A) : Alignment(0), StackAlignment(0) { addAttribute(A); @@ -433,11 +433,9 @@ public: return !(*this == B); } - // FIXME: Remove these. + // FIXME: Remove this in 4.0. /// \brief Add the raw value to the internal representation. - /// - /// N.B. This should be used ONLY for decoding LLVM bitcode! AttrBuilder &addRawValue(uint64_t Val); }; @@ -446,18 +444,6 @@ namespace AttributeFuncs { /// \brief Which attributes cannot be applied to a type. AttributeSet typeIncompatible(Type *Ty, uint64_t Index); -/// \brief This returns an integer containing an encoding of all the LLVM -/// attributes found in the given attribute bitset. Any change to this encoding -/// is a breaking change to bitcode compatibility. -uint64_t encodeLLVMAttributesForBitcode(AttributeSet Attrs, unsigned Index); - -/// \brief This fills an AttrBuilder object with the LLVM attributes that have -/// been decoded from the given integer. This function must stay in sync with -/// 'encodeLLVMAttributesForBitcode'. -/// N.B. This should be used only by the bitcode reader! -void decodeLLVMAttributesForBitcode(LLVMContext &C, AttrBuilder &B, - uint64_t EncodedAttrs); - } // end AttributeFuncs namespace } // end llvm namespace |