[cfe-dev] Function Lookup in SemaExpr

Aaron W.Hsu arcfide at sacrideo.us
Mon Dec 1 18:03:54 PST 2014


Dear Nikola:


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. 






-- 
Aaron W. Hsu | arcfide at sacrideo.us | http://www.sacrideo.us
Please support my work: https://www.gratipay.com/arcfide/
לֵ֤ב חֲכָמִים֙ בְּבֵ֣ית אֵ֔בֶל וְלֵ֥ב כְּסִילִ֖ים בְּבֵ֥ית שִׂמְחָֽה׃





From: Nikola Smiljanic
Sent: ‎Monday‎, ‎December‎ ‎1‎, ‎2014 ‎6‎:‎19‎ ‎PM
To: Aaron W.Hsu
Cc: Clang Dev List





Create LookupResult and call LookupName on it passing appropriate DeclarationContext into which you're performing the lookup (can be a scope or record decl).



On Tue, Dec 2, 2014 at 10:00 AM, Aaron W.Hsu <arcfide at sacrideo.us> wrote:




Dear Clang Developers:




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?





Yours truly,





Aaron W. Hsu





-- 
Aaron W. Hsu | arcfide at sacrideo.us | http://www.sacrideo.us
Please support my work: https://www.gratipay.com/arcfide/
לֵ֤ב חֲכָמִים֙ בְּבֵ֣ית אֵ֔בֶל וְלֵ֥ב כְּסִילִ֖ים בְּבֵ֥ית שִׂמְחָֽה׃




_______________________________________________
cfe-dev mailing list
cfe-dev at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141202/adbe7636/attachment.html>


More information about the cfe-dev mailing list