【发布时间】:2016-06-17 07:44:26
【问题描述】:
我正在为 .m 文件上的 Objective C 代码生成 AST
命令大致类似于clang-check -ast-dump /source/file.m &> /output/file.txt
它有一个错误说
Error while trying to load a compilation database: Could not auto-detect compilation database for file '/source/file.m'
No compilation database found in /source or any parent directory
json-compilation-database: Error while opening JSON database: No such file or directory
Running without flags.
In file included from /source .. fatal error:'UIKit/UIKit.h' file not found
我不确定这是否与上面抛出的错误有关,但我的许多 CompoundStmt 块都是空的。如果它们包含 C 或 C++ 代码,则它们会反映在 CompoundStmt 中,但当它包含 NSString *query = [NSString stringWithFormat:@"select * from peopleInfo where peopleInfoID=%d, self.recordIDToEdit] 甚至 NSString *abc = "ABC" 之类的代码时则不会反映
【问题讨论】:
-
你成功了吗?即使在生成编译命令文件后,我也会收到错误消息。
fatal error: no handler registered for module format 'obj' LLVM ERROR: unknown module format
标签: ios objective-c clang llvm-clang clang-static-analyzer