diff options
author | David Neto <dneto@google.com> | 2018-01-04 12:59:50 -0500 |
---|---|---|
committer | David Neto <dneto@google.com> | 2018-01-04 18:34:18 -0500 |
commit | c32e79eeefe1554076c4e094a61aa9a98d97c540 (patch) | |
tree | 99b9e1510b43aa95764969ae1aa8deaa72613f3a /include | |
parent | 702852bd22bf2cb15ff10043eefe8ae0417f65d6 (diff) | |
download | spirv-tools-c32e79eeefe1554076c4e094a61aa9a98d97c540.tar.gz |
Add --print-all optimizer option
Adds optimizer API to write disassembly to a given output stream
before each pass, and after the last pass.
Adds spirv-opt --print-all option to write disassembly to stderr
before each pass, and after the last pass.
Diffstat (limited to 'include')
-rw-r--r-- | include/spirv-tools/optimizer.hpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/spirv-tools/optimizer.hpp b/include/spirv-tools/optimizer.hpp index afc544a5..2141bda4 100644 --- a/include/spirv-tools/optimizer.hpp +++ b/include/spirv-tools/optimizer.hpp @@ -16,6 +16,7 @@ #define SPIRV_TOOLS_OPTIMIZER_HPP_ #include <memory> +#include <ostream> #include <string> #include <unordered_map> #include <vector> @@ -113,6 +114,11 @@ class Optimizer { // pass manager is destroyed. std::vector<const char*> GetPassNames() const; + // Sets the option to print the disassembly before each pass and after the + // last pass. If |out| is null, then no output is generated. Otherwise, + // output is sent to the |out| output stream. + Optimizer& SetPrintAll(std::ostream* out); + private: struct Impl; // Opaque struct for holding internal data. std::unique_ptr<Impl> impl_; // Unique pointer to internal data. |