[cfe-dev] Getting fully qualified names of random qualtypes.

Sterling Augustine via cfe-dev cfe-dev at lists.llvm.org
Thu Oct 22 13:57:51 PDT 2015


I copied these file directly from Cling to Tooling/Core/, and renamed them
QualTypeNames.[cpp|h].

It compiles and works just fine as a direct copy.

I have made a couple of very minor changes, such as moving the enclosing
namespace from cling to clang. Shall I do a more substantial clang-style
edit?



On Thu, Oct 22, 2015 at 5:29 AM, Manuel Klimek <klimek at google.com> wrote:

> Specifially, Benjamin has a patch out that adds a Tooling/Core/Lookup.h
> where this would fit in quite nicely.
>
> On Wed, Oct 21, 2015 at 5:31 PM Daniel Berlin <dannyb at google.com> wrote:
>
>> The license itself is fine.
>>
>>
>> On Wed, Oct 21, 2015 at 1:04 AM, Manuel Klimek <klimek at google.com> wrote:
>>
>>> On Wed, Oct 21, 2015 at 8:08 AM Richard Smith <richard at metafoo.co.uk>
>>> wrote:
>>>
>>>> ASTContext isn't appropriate for utility code for tooling support; that
>>>> should go in libTooling instead. The question is whether any of this
>>>> functionality is useful for the compiler itself or just for tools that use
>>>> it as a library, and I suspect it's only really useful for the latter.
>>>>
>>>
>>> Good point, in that case I'd put it somewhere in Tooling/Core. cc'ing
>>> Benjamin, who had (planned) a patch to open up a new source file there
>>> anyway.
>>>
>>>
>>>>
>>>> Danny, can you comment on the licensing question?
>>>>
>>>> On Tue, Oct 20, 2015 at 9:13 PM, Manuel Klimek via cfe-dev <
>>>> cfe-dev at lists.llvm.org> wrote:
>>>>
>>>>> I think it should probably be part of ASTContext. I have no idea about
>>>>> the license. Richard?
>>>>>
>>>>> On Wed, Oct 21, 2015, 2:27 AM Sterling Augustine via cfe-dev <
>>>>> cfe-dev at lists.llvm.org> wrote:
>>>>>
>>>>>> So clang folks, where should this new code to calculate the complete,
>>>>>> fully qualified name of arbitrary qualtypes go?
>>>>>>
>>>>>> My best guess is as a new file in clang/lib/AST, but it's not a great
>>>>>> fit.
>>>>>>
>>>>>> Does the license as listed in the file (reproduced below) create any
>>>>>> issues?
>>>>>>
>>>>>> // This file is dual-licensed: you can choose to license it under the
>>>>>> University
>>>>>> // of Illinois Open Source License or the GNU Lesser General Public
>>>>>> License. See
>>>>>> // LICENSE.TXT for details.
>>>>>>
>>>>>> On Thu, Oct 15, 2015 at 8:47 AM, Philippe Canal <pcanal at fnal.gov>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi Sterling,
>>>>>>>
>>>>>>> > Would you all be amenable to contributing cling/lib/Utils/AST.cpp
>>>>>>> to clang?
>>>>>>>
>>>>>>> Of course :).  I agree that this feature belongs in clang proper.
>>>>>>>
>>>>>>> AST.cpp is pretty much standalone (depends only on clang and llvm)
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Philippe.
>>>>>>>
>>>>>>> PS.  A part that has not yet been integrated in AST.cpp is the
>>>>>>> adding of default
>>>>>>> template parameters (for user classes where that parameter might
>>>>>>> matter for I/O)
>>>>>>> and can be found in:
>>>>>>>
>>>>>>> https://root.cern.ch/gitweb?p=root.git;a=blob;f=core/metautils/src/TMetaUtils.cxx
>>>>>>> in the routines
>>>>>>>     ROOT::TMetaUtils::GetNormalizedType
>>>>>>>     ROOT::TMetaUtils::AddDefaultParameters
>>>>>>>     ROOT::TMetaUtils::KeepNParams
>>>>>>>
>>>>>>>
>>>>>>> On 10/14/15 11:53 AM, Sterling Augustine wrote:
>>>>>>>
>>>>>>> On Tue, Oct 13, 2015 at 2:48 PM, Philippe Canal < <pcanal at fnal.gov>
>>>>>>> pcanal at fnal.gov> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> We also discovered that we could not find in clang a routine that
>>>>>>>> reliably generate the name (or the equivalent
>>>>>>>> decl/type) corresponding to a type as it would need to be typed
>>>>>>>> from the global namespace (i.e. a unique identifier
>>>>>>>> of the class);
>>>>>>>>
>>>>>>>
>>>>>>> Philippe,
>>>>>>>
>>>>>>> Would you all be amenable to contributing cling/lib/Utils/AST.cpp to
>>>>>>> clang?
>>>>>>>
>>>>>>> I would be willing to write-up the patch if that would be helpful.
>>>>>>> I'm not sure how deep the dependencies go.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> _______________________________________________
>>>>>> cfe-dev mailing list
>>>>>> cfe-dev at lists.llvm.org
>>>>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> cfe-dev mailing list
>>>>> cfe-dev at lists.llvm.org
>>>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>>>>
>>>>>
>>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151022/9b74fda2/attachment.html>


More information about the cfe-dev mailing list