GraphWriter: Provide an API for writing a graph into a specified file
GraphWriter: Provide an API for writing a graph into a specified file

Always generating a temporary file is not always suitable, especially for tests

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

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@343351 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit 441f6c802170f069d2706074d19c0d0ee4dba73e)

apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm