[all-commits] [llvm/llvm-project] 89c745: Fix SelectionDAG Graph Printing on Windows

Reid Kleckner via All-commits all-commits at lists.llvm.org
Tue May 5 17:01:46 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 89c7451c35919a95aa654c6ff5204d3ceb37dd3d
      https://github.com/llvm/llvm-project/commit/89c7451c35919a95aa654c6ff5204d3ceb37dd3d
  Author: Justice Adams <justice.adams at sony.com>
  Date:   2020-05-05 (Tue, 05 May 2020)

  Changed paths:
    M llvm/include/llvm/Support/GraphWriter.h
    M llvm/lib/Support/GraphWriter.cpp

  Log Message:
  -----------
  Fix SelectionDAG Graph Printing on Windows

Currently, when compiling to IR (presumably at the clang level) LLVM
mangles symbols and sometimes they have illegal file characters
including `?`'s in them. This causes a problem when building a graph via
llc on Windows because the code currently passes the machine function
name all the way down to the Windows API which frequently returns error
123  **ERROR_INVALID_NAME**
https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-

Thus, we need to remove those illegal characters from the machine
function name before generating a graph, which is the purpose of this
patch.
https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file

I've created a static helper function replace_illegal_filename_chars
which within GraphWriter.cpp to help with replacing illegal file
character names before generating a dot graph filename.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D76863




More information about the All-commits mailing list