clang -ast-print-xml

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

clang -ast-print-xml

Brad LaFountain
I found an issue with the AST xml output.

Simple example:

class test {
public:
void doSomething() {
int i = 99;
}
};

clang -cc1 -ast-print-xml test.cpp

The resulting output doesn't have any reference to the implementation doSomething()
If you implement it outside the deceleration it works fine.

class test {
public:
void doSomething();
};

void test::doSomething() {
 int i = 99;
}

You get the correct <CXXMethodDecl> tag.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: clang -ast-print-xml

Olaf Krzikalla
Brad LaFountain schrieb:

> I found an issue with the AST xml output.
>
> Simple example:
>
> class test {
> public:
> void doSomething() {
> int i = 99;
> }
> };
>
> clang -cc1 -ast-print-xml test.cpp
>
> The resulting output doesn't have any reference to the implementation
> doSomething()
The problem is that when I developed the xml output 9 month ago I never
had C++ in mind.
Neither it was my main focus nor it was the main focus of clang at that
time.
Obvisiously the development has overrun me.
Anyway, attached there is a patch attached solving at least your issue.
Note that you now get all these implicit C++ methods too. However there are
still a lot of C++ things missing. And I don't even want to start
thinking about C++0x.
It would be nice if someone could commit the patch.

Best Olaf


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

xml_patch.patch (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: clang -ast-print-xml

Douglas Gregor

On Mar 8, 2010, at 10:59 AM, Olaf Krzikalla wrote:

> Brad LaFountain schrieb:
>> I found an issue with the AST xml output.
>>
>> Simple example:
>>
>> class test {
>> public:
>> void doSomething() {
>> int i = 99;
>> }
>> };
>>
>> clang -cc1 -ast-print-xml test.cpp
>>
>> The resulting output doesn't have any reference to the implementation doSomething()
>
> The problem is that when I developed the xml output 9 month ago I never had C++ in mind.
> Neither it was my main focus nor it was the main focus of clang at that time.
> Obvisiously the development has overrun me.
> Anyway, attached there is a patch attached solving at least your issue.
> Note that you now get all these implicit C++ methods too. However there are
> still a lot of C++ things missing. And I don't even want to start thinking about C++0x.
> It would be nice if someone could commit the patch.

Committed as r97954.

        - Doug
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev