[cfe-dev] Best way to know if a method declaration is defined in the source

via cfe-dev cfe-dev at lists.llvm.org
Thu Jun 14 07:26:47 PDT 2018


So, you want to exclude methods defined in system headers?  I think there is a way to detect whether a source location is considered to be in a system header; if you grep through clang/include/clang/* for 'SystemHeader' you should find it.
--paulr

From: Mustakimur Rahman Khandaker [mailto:mrk15e at my.fsu.edu]
Sent: Thursday, June 14, 2018 10:04 AM
To: Robinson, Paul
Cc: cfe-dev at lists.llvm.org
Subject: Re: [cfe-dev] Best way to know if a method declaration is defined in the source

What about if I want to include implicitly defined constructor and destructor with other user-defined method for a class that is defined in the source? Like I don't want to have ios_base constructor but I want Employee constructor that is either implicitly or explicitly defined because the class is user-defined.


Mustakimur Rahman Khandaker
Graduate Research Assistant
Department of Computer Science
Florida State University

mrk15e at my.fsu.edu<https://link.getmailspring.com/link/1528984836.local-a442f1ab-2f19-v1.2.2-96fb3a99@getmailspring.com/0?redirect=mailto%3Amustakcsecuet%40gmail.com&recipient=cGF1bC5yb2JpbnNvbkBzb255LmNvbQ%3D%3D>
http://www.dreamlandcoder.com/<https://link.getmailspring.com/link/1528984836.local-a442f1ab-2f19-v1.2.2-96fb3a99@getmailspring.com/1?redirect=http%3A%2F%2Fwww.dreamlandcoder.com%2F&recipient=cGF1bC5yb2JpbnNvbkBzb255LmNvbQ%3D%3D>

On Jun 14 2018, at 9:58 am, paul.robinson at sony.com wrote:

You probably want the `isUserProvided()` predicate, which is false for things like implicitly defined constructors and destructors.

--paulr



From: cfe-dev [mailto:cfe-dev-bounces at lists.llvm.org] On Behalf Of Mustakimur Rahman Khandaker via cfe-dev
Sent: Thursday, June 14, 2018 9:36 AM
To: cfe-dev at lists.llvm.org
Subject: [cfe-dev] Best way to know if a method declaration is defined in the source


Hi


I am working on clang codegen module and I would like to know how anyone can identify a CXXMethodDecl is defined in the compiled source. In the codegen, I have encountered number of methods thats are not part of my test source code, so if I try to modify them in codegen, they have broken down. Is there any flag or other way using sourcelocation to discard those method declaration from modification.




Mustakimur Rahman Khandaker

Graduate Research Assistant
Department of Computer Science
Florida State University


mrk15e at my.fsu.edu<https://link.getmailspring.com/link/1528984836.local-a442f1ab-2f19-v1.2.2-96fb3a99@getmailspring.com/2?redirect=https%3A%2F%2Flink.getmailspring.com%2Flink%2F1528982998.local-dae38628-7a1f-v1.2.2-96fb3a99%40getmailspring.com%2F0%3Fredirect%3Dmailto%253Amustakcsecuet%2540gmail.com%26recipient%3DY2ZlLWRldkBsaXN0cy5sbHZtLm9yZw%253D%253D&recipient=cGF1bC5yb2JpbnNvbkBzb255LmNvbQ%3D%3D>

http://www.dreamlandcoder.com/<https://link.getmailspring.com/link/1528984836.local-a442f1ab-2f19-v1.2.2-96fb3a99@getmailspring.com/3?redirect=https%3A%2F%2Flink.getmailspring.com%2Flink%2F1528982998.local-dae38628-7a1f-v1.2.2-96fb3a99%40getmailspring.com%2F1%3Fredirect%3Dhttp%253A%252F%252Fwww.dreamlandcoder.com%252F%26recipient%3DY2ZlLWRldkBsaXN0cy5sbHZtLm9yZw%253D%253D&recipient=cGF1bC5yb2JpbnNvbkBzb255LmNvbQ%3D%3D>

[Open Tracking]
[Open Tracking]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180614/1ba4a7d7/attachment.html>


More information about the cfe-dev mailing list