Skip to content

Commit 60d8bd6

Browse files
authored
Merge pull request swiftlang#12822 from anemet/opt-remark-skip-without-debugloc
2 parents c8c7d2b + b6f9270 commit 60d8bd6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/SIL/OptimizationRemark.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ Emitter::Emitter(StringRef PassName, SILModule &M)
7777
template <typename RemarkT, typename... ArgTypes>
7878
static void emitRemark(SILModule &Module, const Remark<RemarkT> &R,
7979
Diag<ArgTypes...> ID, bool DiagEnabled) {
80+
if (R.getLocation().isInvalid())
81+
return;
8082
if (auto *Out = Module.getOptRecordStream())
8183
// YAMLTraits takes a non-const reference even when outputting.
8284
*Out << const_cast<Remark<RemarkT> &>(R);

0 commit comments

Comments
 (0)