Ejemplo n.º 1
0
/**
 * \brief Retrieve a diagnostic associated with the given translation unit.
 *
 * \param Unit the translation unit to query.
 * \param Index the zero-based diagnostic number to retrieve.
 *
 * \returns the requested diagnostic. This diagnostic must be freed
 * via a call to \c clang_disposeDiagnostic().
 */
func (tu TranslationUnit) Diagnostics() (ret Diagnostics) {
	ret = make(Diagnostics, C.clang_getNumDiagnostics(tu.c))
	for i := range ret {
		ret[i].c = C.clang_getDiagnostic(tu.c, C.uint(i))
	}
	return
}
Ejemplo n.º 2
0
// Determine the number of diagnostics produced for the given translation unit.
func (tu TranslationUnit) NumDiagnostics() uint32 {
	return uint32(C.clang_getNumDiagnostics(tu.c))
}