[LLVMdev] Proposal for GSoC project for clang front end

Argiris Kirtzidis akyrtzi at gmail.com
Thu Mar 20 13:52:02 PDT 2008

Thanks for your feedback Chris,

Chris Lattner wrote:
> If I were going to pick, I would suggest focusing on getting simple 
> methods implemented, along with instance variables, etc through 
> -fsyntax-only.  This should be a reasonable amount of work for a summer. 
> Something like this should work for example:
> class foo {
>    int X;
>    typedef float Z;
>    int test(Z a) { return a+X; }
>    int test2(q r);
>    tyepdef float q;
> };
> int foo::test2(q r) {
>    return X+r;
> }
> No overloading, not templates, but handling the basic "class issues". 
> Static methods would be a bonus :)
Ok, adding basic class support sounds great. It will include:

1) declaring methods, nested classes, enumerations and typedefs. (nested 
types will be accessible
    only by class methods, unless class scope resolution is implemented; 
see below)
2) member access control ("public:" etc)
3) calling instance methods.
> int foo::test2(q r) {
>    return X+r;
> }
This is actually quite tricky, because clang currently assumes that a 
declaration can be "found"
only by using an identifier (support for '::' in "foo::test2" needed), 
and for name lookup it
assumes that the declaration is accessible at the current scope or at an 
enclosing scope of the
current one (support for resolving X in "return X+r;" needed).

So either a kind of "hack" would be employed to get correct parsing for 
this situation only,
or "proper" C++ name lookup would be developed to also accommodate 
access to class nested types
and static members. Personally I'd prefer the latter, but I'd like to 
hear your opinion whether
[1) - 3)] plus "C++ name lookup" is a reasonable amount of work for the 
summer or something
should be dropped or simplified.


More information about the llvm-dev mailing list