[cfe-dev] to judge whether a function it is a C/C++ standard library function or not

Gábor Kozár kozargabor at gmail.com
Tue Jun 11 06:56:32 PDT 2013


Hi,

The simplest is to check whether the function is in the std:: namespace -
although this only works for C++ headers.
A better method might be to get the SourceLocation of the FunctionDecl
(e.g. with getLocStart()) and then use SourceManager :: isInSystemHeader
and isInExternCSystemHeader.

Gabor


2013/6/11 Rambo <hunanlwm at sina.cn>

> hello,everyone
> I want to judge  whether a function it is a C/C++ standard library function
> or not,that is to say,I want to distinguish a function is a C/C++ standard
> library function or written by users in his program.which clang API can I
> use? thank you!
>
> Rambo
>
>
>
> --
> View this message in context:
> http://clang-developers.42468.n3.nabble.com/to-judge-whether-a-function-it-is-a-C-C-standard-library-function-or-not-tp4032564.html
> Sent from the Clang Developers mailing list archive at Nabble.com.
> _______________________________________________
> 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/20130611/15b70ab5/attachment.html>


More information about the cfe-dev mailing list