aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-30 18:29:18 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-03-30 18:29:18 +0000
commit1facf7a13db0e6989ddec31ab336d7f89e057c43 (patch)
tree6971945189fadaa43fb23193805e2ba974d7eb27 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parentb525e1c07c304a600bccd22b7993bdc842bc1258 (diff)
downloadllvm-1facf7a13db0e6989ddec31ab336d7f89e057c43.zip
llvm-1facf7a13db0e6989ddec31ab336d7f89e057c43.tar.gz
llvm-1facf7a13db0e6989ddec31ab336d7f89e057c43.tar.bz2
Bitcode: Reflow code to use early continues, NFC
llvm-svn: 233578
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 0123fb2..d80d21d 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -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.