I had thought of a tryDemangleNumber function but it didn’t really fit the style of code . (Ie I don’t really do that anywhere else so it felt a little out of place).  I can still do that if you think it’s better, I don’t have a strong preference<br><div class="gmail_quote"><div dir="ltr">On Sun, Jul 29, 2018 at 2:33 PM David Majnemer 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">majnemer added inline comments.<br>
<br>
<br>
================<br>
Comment at: llvm/lib/Demangle/MicrosoftDemangle.cpp:424-441<br>
+  // \?[0-9]\?<br>
+  if (Candidate.size() == 1)<br>
+    return Candidate[0] >= '0' && Candidate[0] <= '9';<br>
+<br>
+  // If it's not 0-9, then it's an encoded number terminated with an @<br>
+  if (Candidate.back() != '@')<br>
+    return false;<br>
----------------<br>
Do you think it makes sense to share this logic w/ Demangler::demangleNumber? Maybe add a tryDemangleNumber which returned the remaining portion of the string, the number, and whether or not an error occurred?<br>
<br>
<br>
<a href="https://reviews.llvm.org/D49965" rel="noreferrer" target="_blank">https://reviews.llvm.org/D49965</a><br>
<br>
<br>
<br>
</blockquote></div>