<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Aug 29, 2017 at 1:54 PM Jonas Devlieghere 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">JDevlieghere added a comment.<br>
<br>
In <a href="https://reviews.llvm.org/D36993#855777" rel="noreferrer" target="_blank">https://reviews.llvm.org/D36993#855777</a>, @dblaikie wrote:<br>
<br>
> In <a href="https://reviews.llvm.org/D36993#855144" rel="noreferrer" target="_blank">https://reviews.llvm.org/D36993#855144</a>, @JDevlieghere wrote:<br>
><br>
> > In <a href="https://reviews.llvm.org/D36993#854984" rel="noreferrer" target="_blank">https://reviews.llvm.org/D36993#854984</a>, @dblaikie wrote:<br>
> ><br>
> > > Where's the 'const' being printed from (couldn't spot it from a quick glance at the code) for the test cases like "const Struct"?<br>
> ><br>
> ><br>
> > The function `dumpTypeTagName` extracts the 'type name' from a tag. For the example the function dumps `DW_TAG_const_type` as `const`.<br>
><br>
><br>
> That seems a bit subtle - does that codepath trigger/do things for other tag types, or just const? Especially if it's just const, I'd probably handle const where reference, array, pointer, etc, are handled. Seems clearer.<br>
<br>
<br>
It works for all tag types, but some (such as pointers and references) are handled explicitly in the switch because we don't want to print their "type name" but rather a `*` or `&`. I totally agree that it's a little subtle. However originally every tag had a corresponding switch case but this was really verbose and not very maintainable. Personally I feel it's worth the trade-off, but I'd definitely be open to a different alternative!<br></blockquote><div><br>Which other tag types go through this path, though?<br><br>struct and class don't get "struct" or "class", so I guess they don't go through it?<br><br>Volatile presumably goes through it (const/volatile being very similar)?<br><br>Anything else, though? Wondering how big/what was in this switch that was there before.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D36993" rel="noreferrer" target="_blank">https://reviews.llvm.org/D36993</a><br>
<br>
<br>
<br>
</blockquote></div></div>