{
vector_.quick_push (xstrdup (gcov_read_string ()));
map_[vector_.last ()] = i;
+ if (gcov_is_error ())
+ return false;
}
return true;
}
/* autofdo_source_profile. */
afdo_source_profile = autofdo_source_profile::create ();
- if (afdo_source_profile == NULL)
+ if (afdo_source_profile == NULL
+ || gcov_is_error ())
{
error ("cannot read function profile from %s", auto_profile_file);
+ delete afdo_source_profile;
+ afdo_source_profile = NULL;
return;
}
/* autofdo_module_profile. */
fake_read_autofdo_module_profile ();
+ if (gcov_is_error ())
+ {
+ error ("cannot read module profile from %s", auto_profile_file);
+ return;
+ }
}
/* From AutoFDO profiles, find values inside STMT for that we want to measure
/* Return nonzero if the error flag is set. */
/* We need to expose this function when compiling for gcov-tool. */
-#ifndef IN_GCOV_TOOL
+#if !defined (IN_GCOV_TOOL) && !defined (IN_GCC)
static inline
#endif
int
/* Available outside gcov */
GCOV_LINKAGE void gcov_write (const void *, unsigned) ATTRIBUTE_HIDDEN;
GCOV_LINKAGE void gcov_write_unsigned (gcov_unsigned_t) ATTRIBUTE_HIDDEN;
+GCOV_LINKAGE int gcov_is_error (void);
#endif
#if !IN_GCOV && !IN_LIBGCOV