1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Bitcode: Reflow code to use early continues, NFC

llvm-svn: 233578
This commit is contained in:
Duncan P. N. Exon Smith 2015-03-30 18:29:18 +00:00
parent 1be15fef4c
commit e80754841d

View File

@ -2106,24 +2106,27 @@ static void WriteFunction(const Function &F, ValueEnumerator &VE,
// If the instruction has a debug location, emit it.
DebugLoc DL = I->getDebugLoc();
if (DL.isUnknown()) {
// nothing todo.
} else if (DL == LastDL) {
continue;
}
if (DL == LastDL) {
// Just repeat the same debug loc as last time.
Stream.EmitRecord(bitc::FUNC_CODE_DEBUG_LOC_AGAIN, Vals);
} else {
MDNode *Scope, *IA;
DL.getScopeAndInlinedAt(Scope, IA, I->getContext());
assert(Scope && "Expected valid scope");
Vals.push_back(DL.getLine());
Vals.push_back(DL.getCol());
Vals.push_back(VE.getMetadataOrNullID(Scope));
Vals.push_back(VE.getMetadataOrNullID(IA));
Stream.EmitRecord(bitc::FUNC_CODE_DEBUG_LOC, Vals);
Vals.clear();
LastDL = DL;
continue;
}
MDNode *Scope, *IA;
DL.getScopeAndInlinedAt(Scope, IA, I->getContext());
assert(Scope && "Expected valid scope");
Vals.push_back(DL.getLine());
Vals.push_back(DL.getCol());
Vals.push_back(VE.getMetadataOrNullID(Scope));
Vals.push_back(VE.getMetadataOrNullID(IA));
Stream.EmitRecord(bitc::FUNC_CODE_DEBUG_LOC, Vals);
Vals.clear();
LastDL = DL;
}
// Emit names for all the instructions etc.