summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode
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
commite72bf9fda66dd3f9df5e7b8f2e2a621e93266f9c (patch)
treed1eea9fba0e78e0b5d8a7a7597788d4062b8f749 /llvm/lib/Bitcode
parentdea02bd840b410e92d271226e1d5a9df84db6e44 (diff)
downloadbcm5719-llvm-e72bf9fda66dd3f9df5e7b8f2e2a621e93266f9c.tar.gz
bcm5719-llvm-e72bf9fda66dd3f9df5e7b8f2e2a621e93266f9c.zip
add writer support for param attrs
llvm-svn: 36724
Diffstat (limited to 'llvm/lib/Bitcode')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 1e899e153d2..0217e362afd 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud