I divided toy.cpp into several .cpp and .h files in several directories.
The purpose of this work is making it structured similar to clang.
And I put it up to github.
This is a brilliant idea. This is the perfect way to get familiar with
LLVM (and Clang, to some extent).
Now I wonder what license should this work follow or if it is rather
prohibited for others to distribute toy.cpp in different form like
You can just leave it under the LLVM UIUC license like most of the rest of LLVM.
I think this code can be put into llvm/project as another example of
If someone want I want to contribute.
I think that this would be a great idea at some point, after klang has
been polished a bit.
First of all, you probably want to add CMake files along with the makefiles.
Second, you will want to bring the code in line with the coding
standards <http://llvm.org/docs/CodingStandards.html>. In particular,
I am seeing hard tabs in the code. Also, IIRC, last I looked at
kaleidescope, there were memory leaks and nasty global variables which
should probably be fixed before merging this in.
You will also want to thoroughly document this project (using Sphinx
and _not_ HTML); describe the overall structure of the compiler and
which LLVM APIs it uses, give an overview of the directory hierarchy,
and put nice big documentation comments at the tops of files
explaining how they fit into the bigger picture of the project. Since
this project is primarily for helping people to learn LLVM, excellent
documentation is *absolutely essential*.
You will also want to set up tests, since tests are an integral part
of LLVM and Clang; tests will also serve another purpose which is to
catch when LLVM changes without klang being updated.
-- Sean Silva