diff options
| author | Charlie Turner <charlie.turner@arm.com> | 2015-07-02 09:32:07 +0000 |
|---|---|---|
| committer | Charlie Turner <charlie.turner@arm.com> | 2015-07-02 09:32:07 +0000 |
| commit | 0912de3216b3b9cfe187816f7d7bc8fc2cb64dc3 (patch) | |
| tree | 953b25eeea4a0f0bdc41db5d1f6842a9b07077e1 /llvm | |
| parent | 5b41ea0d566e635e45229e0baa414a125783ca40 (diff) | |
| download | bcm5719-llvm-0912de3216b3b9cfe187816f7d7bc8fc2cb64dc3.tar.gz bcm5719-llvm-0912de3216b3b9cfe187816f7d7bc8fc2cb64dc3.zip | |
[GraphWriter] Don't wait on xdg-open when not on Apple.
By default, the GraphWriter code assumes that the generic file open
program (`open` on Apple, `xdg-open` on other systems) can wait on the
forked proces to complete. When the fork ends, the code would delete
the temporary dot files created, and return.
On GNU/Linux, the xdg-open program does not have a "wait for your fork
to complete before dying" option. So the behaviour was that xdg-open
would launch a process, quickly die itself, and then the GraphWriter
code would think its OK to quickly delete all the temporary files.
Once the temporary files were deleted, the dot viewers would get very
upset, and often give you weird errors.
This change only waits on the generic open program on Apple platforms.
Elsewhere, we don't wait on the process, and hence we don't try and
clean up the temporary files.
llvm-svn: 241250
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/Support/GraphWriter.h | 2 | ||||
| -rw-r--r-- | llvm/lib/Support/GraphWriter.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/include/llvm/Support/GraphWriter.h b/llvm/include/llvm/Support/GraphWriter.h index 7d1c273c988..b1af3d7c263 100644 --- a/llvm/include/llvm/Support/GraphWriter.h +++ b/llvm/include/llvm/Support/GraphWriter.h @@ -353,7 +353,7 @@ void ViewGraph(const GraphType &G, const Twine &Name, if (Filename.empty()) return; - DisplayGraph(Filename, true, Program); + DisplayGraph(Filename, false, Program); } } // End llvm namespace diff --git a/llvm/lib/Support/GraphWriter.cpp b/llvm/lib/Support/GraphWriter.cpp index 97aedc88473..a9b02204146 100644 --- a/llvm/lib/Support/GraphWriter.cpp +++ b/llvm/lib/Support/GraphWriter.cpp @@ -135,12 +135,12 @@ static const char *getProgramName(GraphProgram::Name program) { bool llvm::DisplayGraph(StringRef FilenameRef, bool wait, GraphProgram::Name program) { std::string Filename = FilenameRef; - wait &= !ViewBackground; std::string ErrMsg; std::string ViewerPath; GraphSession S; #ifdef __APPLE__ + wait &= !ViewBackground; if (S.TryFindProgram("open", ViewerPath)) { std::vector<const char *> args; args.push_back(ViewerPath.c_str()); |

