Use separate ValueList for metadata.

This fixes PR4666.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78056 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2009-08-04 06:00:18 +00:00
parent 3b24c01720
commit d5ac40457b
7 changed files with 242 additions and 44 deletions

View File

@ -492,7 +492,7 @@ static void WriteMDNode(const MDNode *N,
static void WriteModuleMetadata(const ValueEnumerator &VE,
BitstreamWriter &Stream) {
const ValueEnumerator::ValueList &Vals = VE.getValues();
const ValueEnumerator::ValueList &Vals = VE.getMDValues();
bool StartedMetadataBlock = false;
unsigned MDSAbbrev = 0;
SmallVector<uint64_t, 64> Record;
@ -601,8 +601,6 @@ static void WriteConstants(unsigned FirstVal, unsigned LastVal,
const Type *LastTy = 0;
for (unsigned i = FirstVal; i != LastVal; ++i) {
const Value *V = Vals[i].first;
if (isa<MetadataBase>(V))
continue;
// If we need to switch types, do so now.
if (V->getType() != LastTy) {
LastTy = V->getType();