fcd icon indicating copy to clipboard operation
fcd copied to clipboard

Refactoring AST generation

Open surovic opened this issue 7 years ago • 1 comments

The state of the AST generation algorithms and data structure codebase could be better and refactored with good programming practices in mind. The incorporation of libclang for it's AST should be considered instead of the custom AST data structure we now have.

The major points to consider when refactoring

  • Classes should adhere to rule of three (or rule of five, or rule of zero).
  • Classes should cooperate flawlessly with STL containers.
  • Use STL containers wherever possible.
  • Avoid explicit dynamic memory allocation (using new) whenever possible. If a custom allocation mechanism is needed, use allocators and STL containers.
  • Use glog's CHECK() and LOG() instead of relying on llvm_unreachable() and LLVM diagnostics.
  • Do not use goto.

surovic avatar Apr 23 '18 11:04 surovic

Update: Using clang AST has been deemed as the way forward and AST generation is being rewritten in dev-clang-ast. Issues related to the rewrite are coupled under this issues milestone.

surovic avatar Jun 10 '18 11:06 surovic