summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/GraphWriter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Refactor ExecuteAndWait to take StringRefs.Zachary Turner2018-06-121-37/+27
| | | | | | | | | | | | | | | | | | | This simplifies some code which had StringRefs to begin with, and makes other code more complicated which had const char* to begin with. In the end, I think this makes for a more idiomatic and platform agnostic API. Not all platforms launch process with null terminated c-string arrays for the environment pointer and argv, but the api was designed that way because it allowed easy pass-through for posix-based platforms. There's a little additional overhead now since on posix based platforms we'll be takign StringRefs which were constructed from null terminated strings and then copying them to null terminate them again, but from a readability and usability standpoint of the API user, I think this API signature is strictly better. llvm-svn: 334518
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-011-1/+1
| | | | | | | | | | | | | | | | We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46290 llvm-svn: 331272
* s/LLVM_ON_WIN32/_WIN32/, llvmNico Weber2018-04-291-2/+2
| | | | | | | | | | | | | | LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in HandleLLVMOptions.cmake, which is where _WIN32 defined too. Just use the default macro instead of a reinvented one. See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev. No intended behavior change. This moves over all uses of the macro, but doesn't remove the definition of it in (llvm-)config.h yet. llvm-svn: 331127
* Convenience/safety fix for llvm::sys::Execute(And|No)WaitAlexander Kornienko2017-09-131-2/+2
| | | | | | | | | | | | | | | | | | | | Summary: Change the type of the Redirects parameter of llvm::sys::ExecuteAndWait, ExecuteNoWait and other APIs that wrap them from `const StringRef **` to `ArrayRef<Optional<StringRef>>`, which is safer and simplifies the use of these APIs (no more local StringRef variables just to get a pointer to). Corresponding clang changes will be posted as a separate patch. Reviewers: bkramer Reviewed By: bkramer Subscribers: vsk, llvm-commits Differential Revision: https://reviews.llvm.org/D37563 llvm-svn: 313155
* [ProfileData, Support] Fix some Clang-tidy modernize-use-using and Include ↵Eugene Zelenko2017-06-211-2/+17
| | | | | | What You Use warnings; other minor fixes (NFC). llvm-svn: 305969
* Added LLVM_FALLTHROUGH to address gcc warning: this statement may fall through.Galina Kistanova2017-05-221-0/+1
| | | | llvm-svn: 303585
* [Support] Reapply r245289 "Always wait for GraphViz before opening the viewer"Michael Kruse2015-09-181-1/+1
| | | | | | | | | | | | | The change was accidentally undone by r245290. Original log message: When calling DisplayGraph and a PS viewer is chosen, two programs are executed: The GraphViz generator and the PostScript viewer. Always wait for the generator to finish to ensure that the .ps file is written before opening the viewer for that file. DisplayGraph's wait parameter refers to whether to wait until the user closes the viewer. This happened on Windows and if none of the options to open the .dot file directly applies, also on Linux. Differential Revision: http://reviews.llvm.org/D11876 llvm-svn: 247980
* [ADT] Switch a bunch of places in LLVM that were doing single-characterChandler Carruth2015-09-101-1/+1
| | | | | | | splits to actually use the single character split routine which does less work, and in a debug build is *substantially* faster. llvm-svn: 247245
* [Support] On Windows, generate PDF files for graphs and open with associated ↵Michael Kruse2015-08-181-23/+49
| | | | | | | | | | | | | | viewer Summary: Windows system rarely have good PostScript viewers installed, but PDF viewers are common. So for viewing graphs, generate PDF files and open with the associated PDF viewer using cmd.exe's start command. Reviewers: Bigcheese, aaron.ballman Subscribers: aaron.ballman, JakeVanAdrighem, dwiberg, llvm-commits Differential Revision: http://reviews.llvm.org/D11877 llvm-svn: 245290
* [Support] Always wait for GraphViz before opening the viewerMichael Kruse2015-08-181-1/+1
| | | | | | | | | | | | | | | Summary: When calling DisplayGraph and a PS viewer is chosen, two programs are executed: The GraphViz generator and the PostScript viewer. Always for the generator to finish to ensure that the .ps file is written before opening the viewer for that file. DisplayGraph's wait parameter refers to whether to wait until the user closes the viewer. This happened on Windows and if none of the options to open the .dot file directly applies, also on Linux. Reviewers: Bigcheese, chandlerc, aaron.ballman Subscribers: dwiberg, aaron.ballman, llvm-commits Differential Revision: http://reviews.llvm.org/D11876 llvm-svn: 245289
* [GraphWriter] Don't wait on xdg-open when not on Apple.Charlie Turner2015-07-021-1/+1
| | | | | | | | | | | | | | | | | | | | 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
* [GraphWriter] Attempt to open .dot files with xdg-open/open firstMatthias Braun2015-04-031-0/+23
| | | | | | | | | | Most desktop environments let the users specify his preferred application per file type. On mac/linux we can use open/xdg-open for that and should try this first before starting a heuristic search for various programs. Differential Revision: http://reviews.llvm.org/D6534 llvm-svn: 234031
* Remove more superfluous .str() and replace std::string concatenation with Twine.Yaron Keren2015-03-301-1/+1
| | | | | | Following r233392, http://llvm.org/viewvc/llvm-project?rev=233392&view=rev. llvm-svn: 233555
* Purge unused includes throughout libSupport.Benjamin Kramer2015-03-231-1/+0
| | | | | | NFC. llvm-svn: 232976
* Move private classes into anonymous namespacesBenjamin Kramer2015-03-231-0/+2
| | | | | | NFC. llvm-svn: 232944
* Fix style.Michael J. Spencer2014-11-071-2/+1
| | | | llvm-svn: 221547
* Use findProgramByName.Michael J. Spencer2014-11-041-2/+4
| | | | llvm-svn: 221221
* Don't use 'using std::error_code' in include/llvm.Rafael Espindola2014-06-121-1/+1
| | | | | | This should make sure that most new uses use the std prefix. llvm-svn: 210835
* GraphWriter: try gv before xdg-openAlp Toker2014-06-041-2/+2
| | | | | | | | | Avoid changing behaviour for everyone who's used to the traditional ghostview UI, especially since it knows how to stay in the foreground unlike xdg-open. Amendment to r210147. llvm-svn: 210148
* GraphWriter: support the XDG open utilityAlp Toker2014-06-041-2/+8
| | | | | | | This runs a suitable viewer on Unix desktop environments specified by Freedesktop.org (GNOME, KDE, Linux distributions etc.) llvm-svn: 210147
* Silence -Wreturn-type warningAlp Toker2014-06-021-0/+1
| | | | llvm-svn: 210005
* GraphWriter: tweak the program fallback orderAlp Toker2014-06-021-1/+1
| | | | | | | Amend r210001 to use the classic fallback order behaviour if the requested graphing program isn't found. llvm-svn: 210003
* GraphWriter: detect graph viewer programs at runtimeAlp Toker2014-06-021-119/+129
| | | | | | | | | | | | | | | | | | | | | | Replace the crufty build-time configure checks for program paths with equivalent runtime logic. This lets users install graphing tools as needed without having to reconfigure and rebuild LLVM, while eliminating a long chain of inappropriate compile dependencies that included GUI programs and the windowing system. Additional features: * Support the OS X 'open' command to view graphs generated by any of the Graphviz utilities. This is an alternative to the Graphviz OS X UI which is no longer available on Mountain Lion. * Produce informative log output upon failure to indicate which programs can be installed to view graphs. Ping me if this doesn't work for your particular environment. llvm-svn: 210001
* [C++11] Make use of 'nullptr' in the Support library.Craig Topper2014-04-071-3/+3
| | | | llvm-svn: 205697
* Use the simpler version of sys::fs::remove when possible.Rafael Espindola2014-01-101-2/+1
| | | | llvm-svn: 198958
* Remove several unused variables.Rafael Espindola2013-10-011-0/+3
| | | | | | Patch by Alp Toker. llvm-svn: 191757
* Find xdot or xdot.py.Matt Arsenault2013-07-081-3/+3
| | | | | | Ubuntu installs this as xdot, so finding xdot.py would fail. llvm-svn: 185860
* Use sys::fs::createTemporaryFile.Rafael Espindola2013-07-051-2/+1
| | | | llvm-svn: 185719
* Don't use PathV1.h in GraphWriter.cpp.Rafael Espindola2013-06-141-5/+2
| | | | llvm-svn: 183988
* Convert a use of sys::Path::GetTemporaryDirectory.Rafael Espindola2013-06-141-10/+9
| | | | llvm-svn: 183987
* Avoid using PathV1.h in Program.h.Rafael Espindola2013-06-131-2/+3
| | | | llvm-svn: 183940
* Covert remaining graph viewers from sys::Path to std::string.Rafael Espindola2013-06-131-3/+3
| | | | llvm-svn: 183921
* Update code for other graph viewing programs too.Rafael Espindola2013-06-131-3/+3
| | | | llvm-svn: 183920
* Reduce usage of sys::Path in the graph writer.Rafael Espindola2013-06-131-22/+40
| | | | | | Now PathV1.h is not needed in GraphWriter.h. llvm-svn: 183919
* Remove the program class.Rafael Espindola2013-06-121-2/+2
| | | | | | | It was only used to implement ExecuteAndWait and ExecuteNoWait. Expose just those two functions and make Execute and Wait implementations details. llvm-svn: 183864
* ScheduleDAG: colorize the DOT graph and improve formatting.Andrew Trick2013-01-251-0/+11
| | | | llvm-svn: 173431
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-2/+2
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Fix -Wcovered-switch-default warning.Patrik Hägglund2012-05-241-1/+0
| | | | llvm-svn: 157381
* Silence unused function warning when graphviz is not available.Benjamin Kramer2012-03-081-5/+3
| | | | llvm-svn: 152346
* Added -view-background to avoid waiting for each GraphViz invocation.Andrew Trick2012-03-071-39/+40
| | | | | | GV and XDOT paths are untested but should work the same. llvm-svn: 152179
* Merge System into Support.Michael J. Spencer2010-11-291-2/+2
| | | | llvm-svn: 120298
* Fix these error messages to be less confusing. These errorDan Gohman2010-10-291-9/+5
| | | | | | | messages primarily indicate errors running the viewer, not errors with the graph file itself. llvm-svn: 117665
* After printing "Running 'Graphviz' program... " and running theDan Gohman2010-10-051-6/+10
| | | | | | | Graphviz program, print something with a newline, to avoid leaving the line unfinished. llvm-svn: 115620
* Delete an unused declaration.Dan Gohman2010-09-271-2/+0
| | | | llvm-svn: 114839
* Add support for viewing graphviz graphs with xdot.py.Dan Gohman2010-09-271-0/+26
| | | | llvm-svn: 114832
* reduce indentationChris Lattner2010-04-181-21/+21
| | | | llvm-svn: 101692
* Fix PR6826: GraphWriter delete the generated file before "dotty" load it,Chris Lattner2010-04-131-1/+2
| | | | | | patch by 'ether'. llvm-svn: 101116
* Fix viewCFG on Linux.Jeffrey Yasskin2010-02-231-1/+1
| | | | llvm-svn: 96834
* Unbreak the build for HAVE_GV platforms.Dan Gohman2009-08-241-2/+2
| | | | llvm-svn: 79883
OpenPOWER on IntegriCloud