about summary refs log tree commit diff stats
path: root/011run.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-01-02 01:28:24 -0800
committerKartik Agaram <vc@akkartik.com>2020-01-02 01:28:24 -0800
commitd02aa9ac0b9e1130ffcd5a27aa1304e80eee08d9 (patch)
treebf592fba4275002cbbde420cef8c806bb9b1b45f /011run.cc
parent01013f2ad2132dd945c6ceb168b85dc52e18882c (diff)
downloadmu-d02aa9ac0b9e1130ffcd5a27aa1304e80eee08d9.tar.gz
5863
Just clarified for myself why `subx translate` and `subx run` need to share
code: emulation supports the tests first and foremost.

In the process we clean up our architecture for levels of layers. It's
a good idea but unused once we reconceive of "level 1" as just part of
the test harness.
Diffstat (limited to '011run.cc')
-rw-r--r--011run.cc20
1 files changed, 3 insertions, 17 deletions
diff --git a/011run.cc b/011run.cc
index 585f9930..e4194687 100644
--- a/011run.cc
+++ b/011run.cc
@@ -78,15 +78,14 @@ void test_copy_imm32_to_EAX() {
   );
 }
 
-// top-level helper for scenarios: parse the input, transform any macros, load
-// the final hex bytes into memory, run it
+// top-level helper for tests: parse the input, load the hex bytes into memory, run
 void run(const string& text_bytes) {
   program p;
   istringstream in(text_bytes);
+  // Loading Test Program
   parse(in, p);
   if (trace_contains_errors()) return;  // if any stage raises errors, stop immediately
-  transform(p);
-  if (trace_contains_errors()) return;
+  // Running Test Program
   load(p);
   if (trace_contains_errors()) return;
   // convenience to keep tests concise: 'Entry' label need not be provided
@@ -244,19 +243,6 @@ void test_detect_duplicate_segments() {
   );
 }
 
-//:: transform
-
-:(before "End Types")
-typedef void (*transform_fn)(program&);
-:(before "End Globals")
-vector<transform_fn> Transform;
-
-:(code)
-void transform(program& p) {
-  for (int t = 0;  t < SIZE(Transform);  ++t)
-    (*Transform.at(t))(p);
-}
-
 //:: load
 
 void load(const program& p) {