[PATCH] D59225: [profile] Support for GCDA profiling in Fuchsia

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 09:29:56 PDT 2019


davidxl added inline comments.


================
Comment at: compiler-rt/lib/profile/GCDAProfiling.c:258
 
+#ifndef __Fuchsia__
 static char *mangle_filename(const char *orig_filename) {
----------------
slightly prefer

#if defined(__Fuchia__) 
 // for now empty
#else /* other platforms */

Original code


#endif


================
Comment at: compiler-rt/lib/profile/GCDAProfiling.c:420
+  /* Create VMO to hold the profile data. */
+  zx_status_t status = _zx_vmo_create(WRITE_BUFFER_SIZE, 0, &output_file);
+  if (status != ZX_OK) {
----------------
This big chunk of platform specific code reduces readability. Perhaps wrap it into a helper function.   You can even add new file and put all platform specific code in there (starting from Fuchia -- other platforms can follow later).


Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59225/new/

https://reviews.llvm.org/D59225





More information about the llvm-commits mailing list