aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bitcode/Writer
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-05-04 02:59:04 +0000
committerChris Lattner <sabre@nondot.org>2007-05-04 02:59:04 +0000
commitf0a653199798978b869a29bd776d9a3b06828484 (patch)
tree3788e61882bc96ede344610fc5017332ef40ec52 /lib/Bitcode/Writer
parentc8f8a242e40b22871241e37a2b1a935c2db7fe1b (diff)
downloadexternal_llvm-f0a653199798978b869a29bd776d9a3b06828484.zip
external_llvm-f0a653199798978b869a29bd776d9a3b06828484.tar.gz
external_llvm-f0a653199798978b869a29bd776d9a3b06828484.tar.bz2
add writer support for param attrs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36724 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Writer')
-rw-r--r--lib/Bitcode/Writer/BitcodeWriter.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp
index 1e899e1..0217e36 100644
--- a/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -19,6 +19,7 @@
#include "llvm/DerivedTypes.h"
#include "llvm/Instructions.h"
#include "llvm/Module.h"
+#include "llvm/ParameterAttributes.h"
#include "llvm/TypeSymbolTable.h"
#include "llvm/ValueSymbolTable.h"
#include "llvm/Support/MathExtras.h"
@@ -86,8 +87,21 @@ static void WriteParamAttrTable(const ValueEnumerator &VE,
const std::vector<const ParamAttrsList*> &Attrs = VE.getParamAttrs();
if (Attrs.empty()) return;
+ Stream.EnterSubblock(bitc::PARAMATTR_BLOCK_ID, 3);
+
+ SmallVector<uint64_t, 64> Record;
+ for (unsigned i = 0, e = Attrs.size(); i != e; ++i) {
+ const ParamAttrsList *A = Attrs[i];
+ for (unsigned op = 0, e = A->size(); op != e; ++op) {
+ Record.push_back(A->getParamIndex(op));
+ Record.push_back(A->getParamAttrs(op));
+ }
+
+ Stream.EmitRecord(bitc::PARAMATTR_CODE_ENTRY, Record);
+ Record.clear();
+ }
-
+ Stream.ExitBlock();
}
/// WriteTypeTable - Write out the type table for a module.