// Same as clang_createTranslationUnit2, but returns the CXTranslationUnit instead of an error code. In case of an error this routine returns a NULL CXTranslationUnit, without further detailed error codes. func (i Index) TranslationUnit(astFilename string) TranslationUnit { c_astFilename := C.CString(astFilename) defer C.free(unsafe.Pointer(c_astFilename)) return TranslationUnit{C.clang_createTranslationUnit(i.c, c_astFilename)} }
/** * \brief Create a translation unit from an AST file (-emit-ast). */ func (idx Index) CreateTranslationUnit(fname string) TranslationUnit { cstr := C.CString(fname) defer C.free(unsafe.Pointer(cstr)) o := C.clang_createTranslationUnit(idx.c, cstr) return TranslationUnit{o} }