summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_visualizer.h
diff options
context:
space:
mode:
authorDavid Brazdil <dbrazdil@google.com>2014-12-01 17:04:16 +0000
committerDavid Brazdil <dbrazdil@google.com>2014-12-17 15:46:21 +0000
commitee690a3dd364c025ebc1767d9f84097bb7473eec (patch)
tree9fe546eba2c7be93017188b376789281f7b32aa9 /compiler/optimizing/graph_visualizer.h
parent3fea27b5f956a08b5b01f873b807fac98a5cc1f6 (diff)
ART: Added Checker, a pattern matching test engine
This patch adds a Python script which implements a domain-specific mini-language similar to that of LLVM's FileCheck. It is primarily intended for writing tests for the optimizing compiler but could be configured for other use cases too. It is implemented from scratch in order to avoid dependency on LLVM. Checker tests are written in Java and dex2oat is invoked with a flag which dumps the CFG before and after each pass of the optimizing compiler. The output is then compared against assertions in the test's comments parsed by Checker. See comments in tools/checker.py for more details about the currently supported language features. This initial CL implements only one type of assertion - whether the output contains lines matching a desired pattern in the given order - but supports both plain text and regex matching and allows for equivalency testing by matching for the outcome of a previous match. See the tests in compiler/optimizing/test/ConstantFolding.java for examples. Change-Id: I1ad7431b399c38dc0391ccee74d2c643ba0b0675
Diffstat (limited to 'compiler/optimizing/graph_visualizer.h')
-rw-r--r--compiler/optimizing/graph_visualizer.h16
1 files changed, 3 insertions, 13 deletions
diff --git a/compiler/optimizing/graph_visualizer.h b/compiler/optimizing/graph_visualizer.h
index b5baed9c99..b90d15e1ff 100644
--- a/compiler/optimizing/graph_visualizer.h
+++ b/compiler/optimizing/graph_visualizer.h
@@ -32,28 +32,18 @@ static const char* kLivenessPassName = "liveness";
static const char* kRegisterAllocatorPassName = "register";
/**
- * If enabled, emits compilation information suitable for the c1visualizer tool
- * and IRHydra.
- * Currently only works if the compiler is single threaded.
+ * This class outputs the HGraph in the C1visualizer format.
+ * Note: Currently only works if the compiler is single threaded.
*/
class HGraphVisualizer : public ValueObject {
public:
- /**
- * If output is not null, and the method name of the dex compilation
- * unit contains `string_filter`, the compilation information will be
- * emitted.
- */
HGraphVisualizer(std::ostream* output,
HGraph* graph,
const char* string_filter,
const CodeGenerator& codegen,
const char* method_name);
- /**
- * If this visualizer is enabled, emit the compilation information
- * in `output_`.
- */
- void DumpGraph(const char* pass_name) const;
+ void DumpGraph(const char* pass_name, bool is_after_pass = true) const;
private:
std::ostream* const output_;