<html>
<head>
<meta name="generator" content="Windows Mail 17.5.9600.20689">
<style data-externalstyle="true"><!--
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
}
p.MsoNormal, li.MsoNormal, div.MsoNormal {
margin:0in;
margin-bottom:.0001pt;
}
p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphCxSpFirst,
p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagraphCxSpMiddle,
p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxSpLast {
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
line-height:115%;
}
--></style></head>
<body dir="ltr">
<div data-externalstyle="false" dir="ltr" style="font-family: 'Calibri', 'Segoe UI', 'Meiryo', 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'sans-serif';font-size:12pt;"><div style="font-size: 13pt;">Dear Nikola:</div><div style="font-size: 13pt;"><br></div><div style="font-size: 13pt;">Thanks a bunch for the help, this is what I was looking for. I was trying to do it with Context.Idents. Basically, at the moment it’s sort of like a built-in function, but the reason I need to lookup the function is because I’m rewriting parts of the AST to be calls into these built-ins instead of what they would be originally.<br></div><div style="font-size: 13pt;" data-signatureblock="true"><div style="font-size: 13pt;"><br></div><div style="font-size: 13pt;">-- <br>Aaron W. Hsu | arcfide@sacrideo.us | http://www.sacrideo.us<br>Please support my work: https://www.gratipay.com/arcfide/<br>לֵ֤ב חֲכָמִים֙ בְּבֵ֣ית אֵ֔בֶל וְלֵ֥ב כְּסִילִ֖ים בְּבֵ֥ית שִׂמְחָֽה׃</div><div style="font-size: 13pt;"><br></div></div><div style="padding-top: 5px; border-top-color: rgb(229, 229, 229); border-top-width: 1px; border-top-style: solid;"><div><font face=" 'Calibri', 'Segoe UI', 'Meiryo', 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'sans-serif'" style='line-height: 15pt; letter-spacing: 0.02em; font-family: "Calibri", "Segoe UI", "Meiryo", "Microsoft YaHei UI", "Microsoft JhengHei UI", "Malgun Gothic", "sans-serif"; font-size: 12pt;'><b>From:</b> <a href="mailto:popizdeh@gmail.com" target="_parent">Nikola Smiljanic</a><br><b>Sent:</b> Monday, December 1, 2014 10:30 PM<br><b>To:</b> <a href="mailto:arcfide@sacrideo.us" target="_parent">Aaron W.Hsu</a><br><b>Cc:</b> <a href="mailto:cfe-dev@cs.uiuc.edu" target="_parent">Clang Dev List</a></font></div></div><div><br></div><div dir=""><div dir="ltr">Where is this function name coming from? Is it some kind of built-in?<div><br></div><div>You should be able to construct DeclarationName from IdentifierInfo. Call PP.getIdentiferInfo inside Sema to get the identifier.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 2, 2014 at 1:03 PM, Aaron W.Hsu <span dir="ltr"><<a href="mailto:arcfide@sacrideo.us" target="_parent">arcfide@sacrideo.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;">
<div dir="ltr">
<div style='font-family: "Calibri","Segoe UI","Meiryo","Microsoft YaHei UI","Microsoft JhengHei UI","Malgun Gothic","sans-serif"; font-size: 12pt;' dir="ltr"><div style="font-size: 13pt;">Dear Nikola:</div><div style="font-size: 13pt;"><br></div><div style="font-size: 13pt;">Thanks for the introduction to LookupName() and LookupResult. I think this is exactly what I want, especially LookupSingleName(). However, I seem to require a DeclarationName, which I don’t have yet. I’m not sure how to get one. I just have a string which is the name of the function I wish to lookup (this is in C), and I don’t know how to get from there to a DeclarationName and the other information I need. <br></div><span><div style="font-size: 13pt;"><div style="font-size: 13pt;"><br></div><div style="font-size: 13pt;">-- <br>Aaron W. Hsu | <a href="mailto:arcfide@sacrideo.us" target="_parent">arcfide@sacrideo.us</a> | <a href="http://www.sacrideo.us" target="_parent">http://www.sacrideo.us</a><br>Please support my work: <a href="https://www.gratipay.com/arcfide/" target="_parent">https://www.gratipay.com/arcfide/</a><br>לֵ֤ב חֲכָמִים֙ בְּבֵ֣ית אֵ֔בֶל וְלֵ֥ב כְּסִילִ֖ים בְּבֵ֥ית שִׂמְחָֽה׃</div><div style="font-size: 13pt;"><br></div></div></span><div style="padding-top: 5px; border-top-color: rgb(229, 229, 229); border-top-width: 1px; border-top-style: solid;"><div><font face=" 'Calibri', 'Segoe UI', 'Meiryo', 'Microsoft YaHei UI', 'Microsoft JhengHei UI', 'Malgun Gothic', 'sans-serif'" style='line-height: 15pt; letter-spacing: 0.02em; font-family: "Calibri","Segoe UI","Meiryo","Microsoft YaHei UI","Microsoft JhengHei UI","Malgun Gothic","sans-serif"; font-size: 12pt;'><b>From:</b> <a href="mailto:popizdeh@gmail.com" target="_parent">Nikola Smiljanic</a><br><b>Sent:</b> Monday, December 1, 2014 6:19 PM<br><b>To:</b> <a href="mailto:arcfide@sacrideo.us" target="_parent">Aaron W.Hsu</a><br><b>Cc:</b> <a href="mailto:cfe-dev@cs.uiuc.edu" target="_parent">Clang Dev List</a></font></div></div><div><div class="h5"><div><br></div><div dir=""><div dir="ltr">Create LookupResult and call LookupName on it passing appropriate DeclarationContext into which you're performing the lookup (can be a scope or record decl).</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 2, 2014 at 10:00 AM, Aaron W.Hsu <span dir="ltr"><<a href="mailto:arcfide@sacrideo.us" target="_parent">arcfide@sacrideo.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;">
<div dir="ltr">
<div style='font-family: "Calibri","Segoe UI","Meiryo","Microsoft YaHei UI","Microsoft JhengHei UI","Malgun Gothic","sans-serif"; font-size: 12pt;' dir="ltr"><div style="font-size: 13pt;">Dear Clang Developers:</div><div style="font-size: 13pt;"><br></div><div style="font-size: 13pt;">Inside of SemaExpr.cpp when handling BinOps, I want to lookup the (Expr *) and (NamedDecl) of a function by its name. How can I do this?</div><div style="font-size: 13pt;"><br></div><blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px;" dir="ltr"><div style="font-size: 13pt;">Yours truly,</div><div style="font-size: 13pt;"><br></div><blockquote style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px;" dir="ltr"><div style="font-size: 13pt;">Aaron W. Hsu<span><font color="#888888"><br></font></span></div></blockquote></blockquote><span><font color="#888888"><div style="font-size: 13pt;"><br></div><div style="font-size: 13pt;">-- <br>Aaron W. Hsu | <a href="mailto:arcfide@sacrideo.us" target="_parent">arcfide@sacrideo.us</a> | <a href="http://www.sacrideo.us" target="_parent">http://www.sacrideo.us</a><br>Please support my work: <a href="https://www.gratipay.com/arcfide/" target="_parent">https://www.gratipay.com/arcfide/</a><br>לֵ֤ב חֲכָמִים֙ בְּבֵ֣ית אֵ֔בֶל וְלֵ֥ב כְּסִילִ֖ים בְּבֵ֥ית שִׂמְחָֽה׃</div><div style="font-size: 13pt;"><br></div></font></span></div>
</div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_parent">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_parent">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>
</div></div></div></div>
</div>
</blockquote></div><br></div>
</div></div>
</body>
</html>