diff options
Diffstat (limited to 'lib/Bitcode/Writer/ValueEnumerator.cpp')
-rw-r--r-- | lib/Bitcode/Writer/ValueEnumerator.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Bitcode/Writer/ValueEnumerator.cpp b/lib/Bitcode/Writer/ValueEnumerator.cpp index cf3839d4b0..6c43f433b8 100644 --- a/lib/Bitcode/Writer/ValueEnumerator.cpp +++ b/lib/Bitcode/Writer/ValueEnumerator.cpp @@ -95,7 +95,7 @@ ValueEnumerator::ValueEnumerator(const Module *M) { I->getAllMetadataOtherThanDebugLoc(MDs); for (unsigned i = 0, e = MDs.size(); i != e; ++i) EnumerateMetadata(MDs[i].second); - + if (!I->getDebugLoc().isUnknown()) { MDNode *Scope, *IA; I->getDebugLoc().getScopeAndInlinedAt(Scope, IA, I->getContext()); @@ -363,16 +363,16 @@ void ValueEnumerator::EnumerateType(Type *Ty) { if (StructType *STy = dyn_cast<StructType>(Ty)) if (!STy->isLiteral()) *TypeID = ~0U; - + // Enumerate all of the subtypes before we enumerate this type. This ensures // that the type will be enumerated in an order that can be directly built. for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end(); I != E; ++I) EnumerateType(*I); - + // Refresh the TypeID pointer in case the table rehashed. TypeID = &TypeMap[Ty]; - + // Check to see if we got the pointer another way. This can happen when // enumerating recursive types that hit the base case deeper than they start. // @@ -380,10 +380,10 @@ void ValueEnumerator::EnumerateType(Type *Ty) { // then emit the definition now that all of its contents are available. if (*TypeID && *TypeID != ~0U) return; - + // Add this type now that its contents are all happily enumerated. Types.push_back(Ty); - + *TypeID = Types.size(); } @@ -391,7 +391,7 @@ void ValueEnumerator::EnumerateType(Type *Ty) { // walk through it, enumerating the types of the constant. void ValueEnumerator::EnumerateOperandType(const Value *V) { EnumerateType(V->getType()); - + if (const Constant *C = dyn_cast<Constant>(V)) { // If this constant is already enumerated, ignore it, we know its type must // be enumerated. @@ -401,11 +401,11 @@ void ValueEnumerator::EnumerateOperandType(const Value *V) { // them. for (unsigned i = 0, e = C->getNumOperands(); i != e; ++i) { const Value *Op = C->getOperand(i); - + // Don't enumerate basic blocks here, this happens as operands to // blockaddress. if (isa<BasicBlock>(Op)) continue; - + EnumerateOperandType(Op); } @@ -482,7 +482,7 @@ void ValueEnumerator::incorporateFunction(const Function &F) { if (N->isFunctionLocal() && N->getFunction()) FnLocalMDVector.push_back(N); } - + if (!I->getType()->isVoidTy()) EnumerateValue(I); } |