我想从翻译单元(tu)转储诊断和修复。但是下面的代码不起作用。
def dump_fixits():
"""Return diagnostics with fixits of translation unit."""
result = []
for diag in tu.diagnostics:
diag_fixits = [repr(it) for it in diag.fixits]
location = diag.location
file = "" if location.file is None else location.file.name
result.append((file + ":"
+ str(location.line) + ":"
+ str(location.column) + ": "
+ severity_map[diag.severity] + ": "
+ diag.spelling,
diag_fixits))
return result
(我使用的是 llvm 3.4)
我每次都注意到conf.lib.clang_getDiagnosticNumFixIts()
退货。0
有什么解决办法吗?