[cfe-dev] How to create a SourceLocation from line number?
Welson Sun
welson.sun at gmail.com
Fri Jan 9 10:13:04 PST 2015
Ah, SourceManager has it:
http://clang.llvm.org/doxygen/classclang_1_1SourceManager.html#a49b472113f3678f52fb1ed54247cada3
On Fri, Jan 9, 2015 at 10:09 AM, Welson Sun <welson.sun at gmail.com> wrote:
> A related question: how do you get the line number from a SourceLocation.
> There is something in FullSourceLocation, but you can only get the
> SourceLocation from a Stmt.
>
> -Welson
>
> On Thu, Jan 8, 2015 at 5:35 PM, Richard Smith <richard at metafoo.co.uk>
> wrote:
>
>> On Thu, Jan 8, 2015 at 1:14 PM, Sean Silva <chisophugis at gmail.com> wrote:
>>
>>>
>>>
>>> On Thu, Jan 8, 2015 at 12:44 AM, Csaba Raduly <rcsaba at gmail.com> wrote:
>>>
>>>> On Wed, Jan 7, 2015 at 10:22 PM, Sean Silva <chisophugis at gmail.com>
>>>> wrote:
>>>> > Does SourceManager::translateFileLineCol work for you?
>>>> >
>>>> >
>>>> http://clang.llvm.org/doxygen/classclang_1_1SourceManager.html#a5573aab1578a194e43c7934e6902aeec
>>>>
>>>> Which says:
>>>> "
>>>> If the source file is included multiple times, the source location
>>>> will be based upon the first inclusion.
>>>> If the source file is included multiple times, the source location
>>>> will be based upon an arbitrary inclusion.
>>>> "
>>>>
>>>> These two sentences contradict each other.
>>>>
>>>>
>>> Indeed. Which one is it?
>>>
>>
>> ... and that's why you don't duplicate function comments between header
>> and source file. =)
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>>
>
>
> --
> - Welson
>
>
--
- Welson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150109/2278132b/attachment.html>
More information about the cfe-dev
mailing list