HomePhabricator

Fix SelectionDAG Graph Printing on Windows

Authored by justice_adams on Tue, May 5, 4:58 PM.

Description

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

Details

Committed
rnkTue, May 5, 5:01 PM
Reviewer
rnk
Differential Revision
D76863: Fix SelectionDAG Graph Printing on Windows
Parents
rG0274c797c65a: [lldb/Utils] Serialize exit code in lldb-repro.py
Branches
Unknown
Tags
Unknown