문제

my code visit the AST generated by libclang, and insert some code into it. I want to get the new AST, at the same time I want to avoid writing code to file, Is there any api in libclang to do this?

도움이 되었습니까?

해결책

You can use workaround - CXUnsavedFiles. Just place changed file in memory, add it to CXUnsavedFiles and pass to clang_reparseTranslationUnit.

You also can look to Rewriter and other non-stable API of clang.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top