Simplify the VG_(get_filename_linenum) interface by removing
the dirname_available parameter. It's redundant. The value
of the returned directory name can be tested instead.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14814 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/cachegrind/cg_main.c b/cachegrind/cg_main.c
index 559eea9..685b973 100644
--- a/cachegrind/cg_main.c
+++ b/cachegrind/cg_main.c
@@ -210,10 +210,9 @@
 static void get_debug_info(Addr instr_addr, const HChar **dir,
                            const HChar **file, const HChar **fn, UInt* line)
 {
-   Bool found_dirname;
    Bool found_file_line = VG_(get_filename_linenum)(
                              instr_addr, 
-                             file, dir, &found_dirname,
+                             file, dir,
                              line
                           );
    Bool found_fn        = VG_(get_fnname)(instr_addr, fn);
diff --git a/callgrind/dump.c b/callgrind/dump.c
index 687f4df..6875614 100644
--- a/callgrind/dump.c
+++ b/callgrind/dump.c
@@ -363,7 +363,7 @@
 Bool get_debug_pos(BBCC* bbcc, Addr addr, AddrPos* p)
 {
     const HChar *file, *dir;
-    Bool found_file_line, found_dirname;
+    Bool found_file_line;
 
     int cachepos = addr % DEBUG_CACHE_SIZE;
     
@@ -376,7 +376,6 @@
 	found_file_line = VG_(get_filename_linenum)(addr,
 						    &file,
 						    &dir,
-						    &found_dirname,
 						    &(p->line));
 	if (!found_file_line) {
             file = "???";
diff --git a/callgrind/fn.c b/callgrind/fn.c
index b6dff08..c348fd7 100644
--- a/callgrind/fn.c
+++ b/callgrind/fn.c
@@ -429,7 +429,7 @@
                           const HChar **fn_name, UInt* line_num,
                           DebugInfo** pDebugInfo)
 {
-  Bool found_file_line, found_fn, found_dirname, result = True;
+  Bool found_file_line, found_fn, result = True;
   UInt line;
   
   CLG_DEBUG(6, "  + get_debug_info(%#lx)\n", instr_addr);
@@ -443,7 +443,6 @@
    found_file_line = VG_(get_filename_linenum)(instr_addr,
 					       file,
 					       dir,
-					       &found_dirname,
 					       &line);
    found_fn = VG_(get_fnname)(instr_addr, fn_name);
 
diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c
index 8df866d..e8df79c 100644
--- a/coregrind/m_debuginfo/debuginfo.c
+++ b/coregrind/m_debuginfo/debuginfo.c
@@ -2067,21 +2067,15 @@
 Bool VG_(get_filename_linenum) ( Addr a, 
                                  /*OUT*/const HChar** filename,
                                  /*OUT*/const HChar** dirname,
-                                 /*OUT*/Bool* dirname_available,
                                  /*OUT*/UInt* lineno )
 {
    DebugInfo* si;
    Word       locno;
    UInt       fndn_ix;
 
-   vg_assert( (dirname == NULL && dirname_available == NULL)
-              ||
-              (dirname != NULL && dirname_available != NULL) );
-
    search_all_loctabs ( a, &si, &locno );
    if (si == NULL) {
-      if (dirname_available) {
-         *dirname_available = False;
+      if (dirname) {
          *dirname = "";
       }
       *filename = "";      // this used to be not initialised....
@@ -2095,7 +2089,6 @@
    if (dirname) {
       /* caller wants directory info too .. */
       *dirname = ML_(fndn_ix2dirname) (si, fndn_ix);
-      *dirname_available = (*dirname)[0] != '\0';
    }
 
    return True;
@@ -2258,9 +2251,10 @@
       know_srcloc  = VG_(get_filename_linenum)(
                         eip, 
                         &buf_srcloc, 
-                        &buf_dirname, &know_dirinfo,
+                        &buf_dirname,
                         &lineno 
                      );
+      know_dirinfo = buf_dirname[0] != '\0';
    } else {
       const DiInlLoc *cur_inl = iipc && iipc->cur_inltab >= 0
          ? & iipc->di->inltab[iipc->cur_inltab]
diff --git a/coregrind/m_scheduler/scheduler.c b/coregrind/m_scheduler/scheduler.c
index 4ddf8a3..c45b147 100644
--- a/coregrind/m_scheduler/scheduler.c
+++ b/coregrind/m_scheduler/scheduler.c
@@ -2003,7 +2003,7 @@
          VG_(memset)(buf64, 0, 64);
          UInt linenum = 0;
          Bool ok = VG_(get_filename_linenum)(
-                      ip, &buf, NULL, NULL, &linenum
+                      ip, &buf, NULL, &linenum
                    );
          if (ok) {
             /* For backward compatibility truncate the filename to
diff --git a/include/pub_tool_debuginfo.h b/include/pub_tool_debuginfo.h
index 95b203a..91f3751 100644
--- a/include/pub_tool_debuginfo.h
+++ b/include/pub_tool_debuginfo.h
@@ -52,11 +52,10 @@
 /* This one is the most general.  It gives filename, line number and
    optionally directory name.  filename and linenum may not be NULL.
    dirname may be NULL, meaning that the caller does not want
-   directory name info, in which case dirname_available must also be
-   NULL.  If dirname is non-null, directory info is written to *dirname, if
+   directory name info.
+   If dirname is non-null, directory info is written to *dirname, if
    it is available; if not available, '\0' is written to the first
-   byte.  In either case *dirname_available is set to indicate whether
-   or not directory information was available.
+   byte.
 
    The character strings returned in *filename and *dirname are not
    persistent. They will be freed when the DebugInfo they belong to
@@ -68,7 +67,6 @@
                               ( Addr a, 
                                 /*OUT*/const HChar** filename,
                                 /*OUT*/const HChar** dirname,
-                                /*OUT*/Bool* dirname_available,
                                 /*OUT*/UInt* linenum );
 
 /* Succeeds only if we find from debug info that 'a' is the address of the