simplify to reduce indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68460 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-04-06 21:12:29 +00:00
parent 5ce1b11412
commit 40728791f5

View File

@ -285,7 +285,17 @@ public:
template<typename uintty>
void EmitRecord(unsigned Code, SmallVectorImpl<uintty> &Vals,
unsigned Abbrev = 0) {
if (Abbrev) {
if (!Abbrev) {
// If we don't have an abbrev to use, emit this in its fully unabbreviated
// form.
EmitCode(bitc::UNABBREV_RECORD);
EmitVBR(Code, 6);
EmitVBR(static_cast<uint32_t>(Vals.size()), 6);
for (unsigned i = 0, e = static_cast<unsigned>(Vals.size()); i != e; ++i)
EmitVBR64(Vals[i], 6);
return;
}
unsigned AbbrevNo = Abbrev-bitc::FIRST_APPLICATION_ABBREV;
assert(AbbrevNo < CurAbbrevs.size() && "Invalid abbrev #!");
BitCodeAbbrev *Abbv = CurAbbrevs[AbbrevNo];
@ -317,15 +327,6 @@ public:
}
}
assert(RecordIdx == Vals.size() && "Not all record operands emitted!");
} else {
// If we don't have an abbrev to use, emit this in its fully unabbreviated
// form.
EmitCode(bitc::UNABBREV_RECORD);
EmitVBR(Code, 6);
EmitVBR(static_cast<uint32_t>(Vals.size()), 6);
for (unsigned i = 0, e = static_cast<unsigned>(Vals.size()); i != e; ++i)
EmitVBR64(Vals[i], 6);
}
}
//===--------------------------------------------------------------------===//