r187994 - Add clang_Location_isFromMainFile() to libclang.

Du Toit, Stefanus stefanus.du.toit at intel.com
Wed Aug 21 17:16:06 PDT 2013

On 2013-08-21, at 8:10 PM, "Eli Friedman" <eli.friedman at gmail.com<mailto:eli.friedman at gmail.com>> wrote:

On Thu, Aug 8, 2013 at 10:48 AM, Stefanus Du Toit <stefanus.du.toit at intel.com<mailto:stefanus.du.toit at intel.com>> wrote:
Author: sdt
Date: Thu Aug  8 12:48:14 2013
New Revision: 187994

URL: http://llvm.org/viewvc/llvm-project?rev=187994&view=rev
Add clang_Location_isFromMainFile() to libclang.

Also bump the minor version number and update libclang.exports.

Reviewed by: Dmitri Gribenko, Doug Gregor

I'm currently working on a patch to split isFromMainFile into two versions; one which respects line markers (after '# 1 "XXX.h" 1', we treat the following lines as not part of the main file), and one which has the current behavior.  I think you want the behavior which respects line markers, but I'm not completely sure how you expect this to be used.

For the use case that led me to add this, I want to know if it's physically in the main source file. I can see how the line marker behaviour would be helpful too (actually I may want that behaviour in addition myself).

I think this should probably be exposed through a parameter in the libclang function (PhysicalOnly or RespectLineMarkers or something along those lines) and expect it should still be fine to change the API since it was added so recently (but I don't know if there's a specific rule about that).


More information about the cfe-commits mailing list