[llvm-commits] CVS: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
Chris Lattner
sabre at nondot.org
Thu May 3 19:59:22 PDT 2007
Changes in directory llvm/lib/Bitcode/Writer:
BitcodeWriter.cpp updated: 1.25 -> 1.26
---
Log message:
add writer support for param attrs
---
Diffs of the changes: (+15 -1)
BitcodeWriter.cpp | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletion(-)
Index: llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff -u llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.25 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.26
--- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:1.25 Thu May 3 19:44:52 2007
+++ llvm/lib/Bitcode/Writer/BitcodeWriter.cpp Thu May 3 21:59:04 2007
@@ -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 @@
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.
More information about the llvm-commits
mailing list