Author Topic: How should I set up the project for dev?  (Read 7114 times)

lerno

  • Full Member
  • ***
  • Posts: 247
    • View Profile
How should I set up the project for dev?
« on: October 21, 2018, 03:49:29 PM »
I like to set up things in an IDE for nice code reading. Are there any instructions (or ideas) how to set it up in a way that could work on Mac OS X (in XCode / AppCode) without actually pulling the Clang / LLVM sources in? (Needless to say, the size of those will break most AST building IDEs)

bas

  • Full Member
  • ***
  • Posts: 220
    • View Profile
Re: How should I set up the project for dev?
« Reply #1 on: October 24, 2018, 02:36:48 PM »
I'm mostly developing in Linux, so I'm using Vim as main editor. That (and Emacs) in the only editor I know that really handles big codebases well.
I'm sure many Clang/LLVM developers are using Xcode on a Mac, so that should be fine as well.

For C2 development, you don't really need to go into LLVM/Clang code that well. Just following the INSTALL.md in the project root does the trick.
Only when changing the Tokenizer or adding/changing diagnostic messages are changes to Clang needed. No changes were needed in LLVM at all.
I've discussed merging the C2 changes upstream, some Clang developers were (quite surprisingly) open to it. Clang and LLVM have a great
development ecosystem with a good vibe.

lerno

  • Full Member
  • ***
  • Posts: 247
    • View Profile
Re: How should I set up the project for dev?
« Reply #2 on: October 24, 2018, 04:43:58 PM »
I'm going to do my best ;D but it would have been nice if C2 was possible to work on independent of LLVM/Clang.

bas

  • Full Member
  • ***
  • Posts: 220
    • View Profile
Re: How should I set up the project for dev?
« Reply #3 on: October 25, 2018, 09:46:52 PM »
The link between C2C and LLVM/Clang is pretty thin. Most of the work involves the AST and that is C2 specific

lerno

  • Full Member
  • ***
  • Posts: 247
    • View Profile
Re: How should I set up the project for dev?
« Reply #4 on: October 25, 2018, 11:59:42 PM »
I got things up and running. As usual AppCode is very reluctant to search paths in a larger project :( So I'm using a mixture of AppCode and Xcode to actually code things. An XCode project can be generated by CMake. Unfortunately I made that one in /build and then did a regular make-based one in /build2. Later on I discovered that "make tests" seemed to rely on it being run in /build

Anyway, I'm fairly happy about today's venture into the code. I managed to write a wrapper for DiagosticsEngine (mostly anyway) and get that to actually compile and pass the tests. Not actually adding anything to the code, but following all uses game me a tour through the source code at the very least.

bas

  • Full Member
  • ***
  • Posts: 220
    • View Profile
Re: How should I set up the project for dev?
« Reply #5 on: October 26, 2018, 10:00:04 AM »
Nice! It's always frustrating if this part is hard. Getting into the change-build-test loop should be easy, but since we're based on LLVM (a complex project) it will always require some hassle