<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>In the clang padding checker, I use this snippet of code...</p>
<p> Os << "Excessive padding in '";<br>
Os << QualType::getAsString(RD->getTypeForDecl(),
Qualifiers()) << "'";<br>
</p>
<p>RD is a RecordDecl. I get text like this:</p>
<p> Excessive padding in 'tstr'<br>
</p>
<br>
<div class="moz-cite-prefix">On 8/22/2016 11:44 AM, Himanshu via
cfe-dev wrote:<br>
</div>
<blockquote
cite="mid:CAPUasvX7Nig8SEpW6JVib4GOskeuxudwSDNWPaJvbuq_0UnLEw@mail.gmail.com"
type="cite">
<div dir="ltr">Hi all,
<div><br>
</div>
<div>I tried both RecordDecl as well as TypedefNameDecl to
extract names of such struct declarations, but I always get an
empty string. Could you please let me know how to extract the
struct name? </div>
<div><br>
</div>
<div>For example: </div>
<div><br>
</div>
<div>typedef struct {</div>
<div>...</div>
<div>} tstr;</div>
<div><br>
</div>
<div>I want to extract 'tstr' name for this struct typedef. </div>
<div><br>
</div>
<div>Thanks! </div>
<div>--</div>
<div>
<div>
<div class="gmail_signature"
data-smartmail="gmail_signature">
<div>Himanshu</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project
</pre>
</body>
</html>