[cfe-dev] [clangd-dev] How to identify a Clang QualType is a function pointer?

Keane, Erich via cfe-dev cfe-dev at lists.llvm.org
Wed Sep 12 07:35:28 PDT 2018


Note that it is being called with the ‘->’ operator.  QualType’s dereference operator returns a Type*.  SO, ‘isFunctionPointerType’ is a part of the Type class: https://clang.llvm.org/doxygen/classclang_1_1Type.html

From: cfe-dev [mailto:cfe-dev-bounces at lists.llvm.org] On Behalf Of Mustakimur Rahman Khandaker via cfe-dev
Sent: Wednesday, September 12, 2018 7:33 AM
To: Sam McCall <sammccall at google.com>; cfe-dev at lists.llvm.org
Subject: Re: [cfe-dev] [clangd-dev] How to identify a Clang QualType is a function pointer?

Thanks, it works. I wonder why this funtion is not listed under document: https://clang.llvm.org/doxygen/classclang_1_1QualType.html<https://link.getmailspring.com/link/1536762231.local-91091396-b610-v1.4.2-f587b7b7@getmailspring.com/0?redirect=https%3A%2F%2Fclang.llvm.org%2Fdoxygen%2Fclassclang_1_1QualType.html&recipient=Y2ZlLWRldkBsaXN0cy5sbHZtLm9yZw%3D%3D>
is that because it is inline?

Sent from Mailspring<https://link.getmailspring.com/link/1536762231.local-91091396-b610-v1.4.2-f587b7b7@getmailspring.com/1?redirect=https%3A%2F%2Fgetmailspring.com%2F&recipient=Y2ZlLWRldkBsaXN0cy5sbHZtLm9yZw%3D%3D>, the best free email app for work
On Sep 12 2018, at 10:12 am, Sam McCall via cfe-dev <cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>> wrote:

Doh, of course I meant cfe-dev.
On Wed, Sep 12, 2018 at 4:04 PM Sam McCall <sammccall at google.com<https://link.getmailspring.com/link/1536762231.local-91091396-b610-v1.4.2-f587b7b7@getmailspring.com/2?redirect=mailto%3Asammccall%40google.com&recipient=Y2ZlLWRldkBsaXN0cy5sbHZtLm9yZw%3D%3D>> wrote:
(bcc clangd-dev, I think you want clang-dev)

QType->isFunctionPointerType()?

On Wed, Sep 12, 2018 at 3:55 PM Mustakimur Rahman Khandaker (Mustakim) via clangd-dev <clangd-dev at lists.llvm.org<https://link.getmailspring.com/link/1536762231.local-91091396-b610-v1.4.2-f587b7b7@getmailspring.com/3?redirect=mailto%3Aclangd-dev%40lists.llvm.org&recipient=Y2ZlLWRldkBsaXN0cy5sbHZtLm9yZw%3D%3D>> wrote:
Hi
I am trying to identify a function pointer connected to any expression. I am working in Clang code. Assume, I know the QualType of the value, and now want to know if the value is originally a function pointer type, not any other. Like I want to distinguish between void (*)() and int *. Can anyone suggest what functionality (standard, not want to use getAsString and parse it) I can use?
................
Mustakim
[Open Tracking]
_______________________________________________
clangd-dev mailing list
clangd-dev at lists.llvm.org<https://link.getmailspring.com/link/1536762231.local-91091396-b610-v1.4.2-f587b7b7@getmailspring.com/4?redirect=mailto%3Aclangd-dev%40lists.llvm.org&recipient=Y2ZlLWRldkBsaXN0cy5sbHZtLm9yZw%3D%3D>
http://lists.llvm.org/cgi-bin/mailman/listinfo/clangd-dev<https://link.getmailspring.com/link/1536762231.local-91091396-b610-v1.4.2-f587b7b7@getmailspring.com/5?redirect=https%3A%2F%2Furldefense.proofpoint.com%2Fv2%2Furl%3Fu%3Dhttp-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_clangd-2Ddev%26d%3DDwMFaQ%26c%3DMNHwOqQ8N1u91SoMLfIblwuGXKgp50OPUXjl8uRAbak%26r%3DJKwm4etMSQMsahOzPNr2LefnHNJnFri63zemZ-7B3PI%26m%3DjN7977-HIZNE6o-kw3kfBBPvXMF8q7Uxyk46NtS-LEE%26s%3DD9-vAg1cfAAFNMAkwwtoQEOv5P2BipJZCxg8tBkXJyE%26e%3D&recipient=Y2ZlLWRldkBsaXN0cy5sbHZtLm9yZw%3D%3D>
_______________________________________________
cfe-dev mailing list
cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_cfe-2Ddev&d=DwIGaQ&c=MNHwOqQ8N1u91SoMLfIblwuGXKgp50OPUXjl8uRAbak&r=JKwm4etMSQMsahOzPNr2LefnHNJnFri63zemZ-7B3PI&m=jN7977-HIZNE6o-kw3kfBBPvXMF8q7Uxyk46NtS-LEE&s=q3JEP9ZvWBPJniK8ABSvi56jILF3cNWAFzYkF9mXKrI&e=
[Open Tracking]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180912/6b63c61b/attachment.html>


More information about the cfe-dev mailing list