Back to index

enigmail  1.4.3
Functions
build.win32.pgomerge Namespace Reference

Functions

def MergePGOFiles

Function Documentation

def build.win32.pgomerge.MergePGOFiles (   basename,
  pgddir,
  pgcdir 
)
Merge pgc files produced from an instrumented binary
   into the pgd file for the second pass of profile-guided optimization
   with MSVC.  |basename| is the name of the DLL or EXE without the
   extension.  |pgddir| is the path that contains <basename>.pgd
   (should be the objdir it was built in).  |pgcdir| is the path
   containing basename!N.pgc files, which is probably dist/bin.
   Calls pgomgr to merge each pgc file into the pgd, then deletes
   the pgc files.

Definition at line 11 of file pgomerge.py.

00011 
00012 def MergePGOFiles(basename, pgddir, pgcdir):
00013   """Merge pgc files produced from an instrumented binary
00014      into the pgd file for the second pass of profile-guided optimization
00015      with MSVC.  |basename| is the name of the DLL or EXE without the
00016      extension.  |pgddir| is the path that contains <basename>.pgd
00017      (should be the objdir it was built in).  |pgcdir| is the path
00018      containing basename!N.pgc files, which is probably dist/bin.
00019      Calls pgomgr to merge each pgc file into the pgd, then deletes
00020      the pgc files."""
00021   if not os.path.isdir(pgddir) or not os.path.isdir(pgcdir):
00022     return
00023   pgdfile = os.path.abspath(os.path.join(pgddir, basename + ".pgd"))
00024   if not os.path.isfile(pgdfile):
00025     return
00026   for file in os.listdir(pgcdir):
00027     if file.startswith(basename+"!") and file.endswith(".pgc"):
00028       try:
00029         pgcfile = os.path.normpath(os.path.join(pgcdir, file))
00030         subprocess.call(['pgomgr', '-merge',
00031                          pgcfile,
00032                          pgdfile])
00033         os.remove(pgcfile)
00034       except OSError:
00035         pass