clang C++ volunteer

I understand that you are currently looking for developers to assist with clang, specifically for the C++ front-end and for code generation tasks.

I am willing to toss my hat in. I have some experience with compiler development, mainly in the area of source-to-source compilers. What are the current low-hanging fruit? There wouldn’t by chance be a developer FAQ yet?

While it is still very early for a definitive answer to this question, what is planned for the STL implementation for clang? This would be a rich source of test cases for the C++ front end.

Thanks,
Justin

"Justin Handville" <uniheliodem@gmail.com> writes:

I understand that you are currently looking for developers to assist with
clang, specifically for the C++ front-end and for code generation tasks.

I am willing to toss my hat in. I have some experience with compiler
development, mainly in the area of source-to-source compilers. What are the
current low-hanging fruit? There wouldn't by chance be a developer FAQ yet?

Yes, is there an open list of items it would be easier for new people to jump
into?

John

The C++ support is in an *extremely* early phase right now. There's only named operators, bool, parsing for C++ casts, and references in there right now. Some of the things to be done with the C++ casts and references are:

  - Do semantic analysis for reference initialization.
  - Do semantic analysis for casts.

There's obviously a lot more to do. I would suggest taking small steps; learning the code base and its architecture by adding smaller features of the language. As far as a specific list of items, there isn't any official one. Though I'd start with the two I mentioned above (I have some code for the second of those, if you'd like to see it) and proceed from there.

-bw

The C++ support is in an *extremely* early phase right now. There's
only named operators, bool, parsing for C++ casts, and references in
there right now. Some of the things to be done with the C++ casts and
references are:

        - Do semantic analysis for reference initialization.
        - Do semantic analysis for casts.

There's obviously a lot more to do. I would suggest taking small
steps; learning the code base and its architecture by adding smaller
features of the language. As far as a specific list of items, there
isn't any official one. Though I'd start with the two I mentioned
above (I have some code for the second of those, if you'd like to see
it) and proceed from there.

Yes, I would be interested in seeing what you have so far to implement
semantic analysis for casts. I'll start digging into the code base
tonight to see how the AST is implemented.

Hi!

STLPort would be a quick solution to adding STL functionality to
clang. Obviously, this is a long way off.

Advantages:
  * (mostly) complete implementation of ISO/IEC 14882 2003.
  * thoroughly tested.

Disadvantages:
  * lots of macro cruft for working with non-standard compilers and
other implementations of STL.
  * May need to be updated to properly detect clang.

As far as I know, STLPort would be the best library to use in this
case, unless we wanted to go through the long process of rolling our
own.

The C++ support is in an *extremely* early phase right now. There's
only named operators, bool, parsing for C++ casts, and references in
there right now. Some of the things to be done with the C++ casts and
references are:

  - Do semantic analysis for reference initialization.
  - Do semantic analysis for casts.

There's obviously a lot more to do. I would suggest taking small
steps; learning the code base and its architecture by adding smaller
features of the language. As far as a specific list of items, there
isn't any official one. Though I'd start with the two I mentioned
above (I have some code for the second of those, if you'd like to see
it) and proceed from there.

I also added preliminary support for parsing namespace declarations as well. Right now there is no semantic analysis or AST building happening for them (they are just parsed and ignored) but implementing this would be a great way to get familiar with sema and AST interfaces. Once we can represent namespaces decls in the AST (and decls inside of them are properly nested) the next step would be to resolve x::y::z to the appropriate decl, then add support for using.

The nice thing about C++ is that it's such a huge language that there are a large variety of parallel tasks that can be tackled at the same time :slight_smile:

-Chris

Working with STLport makes sense. We also plan to be compatible with GNU libstdc++ for ABI compatibility reasons. We're signing up to support GNU extensions, so we #define the "GNUC" macro, which means STLport shouldn't need an extra port for us (at least in GCC compat mode).

-Chris

Hi Justin,

Here's what I have so far for the C++ cast checking. Notice that the concept of "casting away constness" is not equivalent to checking that the const_cast operator is validly applied. It's a concept that's explain in the same section of the standard as the const_cast operator, though. The reinterpret_cast should be complete. The const_cast has a few more checks that need to be added to it. The static and dynamic casts are still undone (though dynamic_cast will have to wait until inheritance is supported).

Let me know if you have questions about the code!

-bw

cxx-cast.patch (21.3 KB)