mheinsen / seec

Program visualization and debugging for novice C programmers
http://seec-team.github.io/seec/
MIT License
3 stars 0 forks source link

Regenerate Clang ASTs from stored source code. #19

Closed mheinsen closed 11 years ago

mheinsen commented 11 years ago

When opening a SeeC-Clang mapped trace, we currently regenerate ASTs from the source code that is in the original location. If the source code is changed or removed then this will cause problems for us. We saved the source code used during compilation into the trace for this purpose, so use this when building the AST.

mheinsen commented 11 years ago

When we construct a seec::seec_clang::MappedModule, we load compile information from the module. This information includes the path and contents of all source files used. Currently we load this after we create the ASTs, but we can load it beforehand.

If we have loaded it beforehand then when we are creating the ASTs, we can get the used source files and insert them as virtual files:

It seems that if we create the ASTUnit before compiling, we'll be able to access the FileManager and SourceManager to set these things up, and then we can finish loading the ASTUnit.