<div><div dir="auto">0 only means “one of those two”, so I prefer your current patch then a change to genericUB.</div></div><div dir="auto"><br></div><div dir="auto">Your reasoning is good, and I’m ok with having different constants. Current patch almost LGTM:</div><div dir="auto">- I have questions about the tests and why not support the standalone runtime.</div><div dir="auto">- please add a mention that the 0 enumerator for the check kind was only emitted on llvm7.0</div><div dir="auto"><br></div><div dir="auto">Thank you,</div><div dir="auto"> Filipe</div><div><br><div class="gmail_quote"><div dir="ltr">On Sat, 29 Sep 2018 at 16:44, Roman Lebedev via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">lebedev.ri added inline comments.<br>
<br>
<br>
================<br>
Comment at: lib/ubsan/ubsan_handlers.cc:468<br>
+  case ICCK_IntegerTruncation: { // Legacy, no longer used.<br>
+    // Let's figure out what it should be as per the new types, and upgrade.<br>
+    // If both types are unsigned, then it's an unsigned truncation.<br>
----------------<br>
filcab wrote:<br>
> If we can unambiguously know which type of error we should emit, why not have the clang change, but always emit the ICCK_IntegerTruncation check type? Then we'd only get this small chunk of code added to compiler-rt.<br>
I think it shifts/duplicates the responsibilities.<br>
At the time of the `call void @__ubsan_handle_implicit_conversion` we already *know* the kind.<br>
If we pass some generic kind, we will then have to re-figure it out here in compiler-rt.<br>
And both the places will need to be kept in sync.<br>
And double the attention needs to be paid to the tests.<br>
I'd honestly better emit `ErrorType::GenericUB` in place of `ICCK_IntegerTruncation` instead of not passing the right `kind`..<br>
<br>
<br>
Repository:<br>
  rCRT Compiler Runtime<br>
<br>
<a href="https://reviews.llvm.org/D50902" rel="noreferrer" target="_blank">https://reviews.llvm.org/D50902</a><br>
<br>
<br>
<br>
</blockquote></div></div>