Removing iree/base/logging.h. (#9605)
Besides a few random spots it cropped up in the runtime/python bindings
the C++ logging code was only used in tests and tools where the
features provided for verbosity control aren't meaningful. Instead of
porting it all to C I've just gone and deleted it -
`fprintf(stderr)`/`std::cerr` is almost always what's wanted instead
and is much simpler to understand. As a library we try not to have any
log spew, tests can use gtest logging, and the tools are almost all
LLVM-based and use the logging functionality already available in
that world.
Fixes #2843.
diff --git a/runtime/bindings/python/initialize_module.cc b/runtime/bindings/python/initialize_module.cc
index 4e79c99..db9d242 100644
--- a/runtime/bindings/python/initialize_module.cc
+++ b/runtime/bindings/python/initialize_module.cc
@@ -40,9 +40,9 @@
char **argv = &flag_ptrs[0];
int argc = flag_ptrs.size();
- CheckApiStatus(
- iree_flags_parse(IREE_FLAGS_PARSE_MODE_DEFAULT, &argc, &argv),
- "Error parsing flags");
+ CheckApiStatus(iree_flags_parse(IREE_FLAGS_PARSE_MODE_CONTINUE_AFTER_HELP,
+ &argc, &argv),
+ "Error parsing flags");
});
}
diff --git a/runtime/bindings/python/tests/flags_test.py b/runtime/bindings/python/tests/flags_test.py
index 886176a..56309ab 100644
--- a/runtime/bindings/python/tests/flags_test.py
+++ b/runtime/bindings/python/tests/flags_test.py
@@ -12,8 +12,8 @@
class FlagsTest(unittest.TestCase):
def testParse(self):
- # We always have the logging verbose level available so use it.
- rt.flags.parse_flags("--iree_v=1")
+ # --help is always available if flags are.
+ rt.flags.parse_flags("--help")
def testParseError(self):
with self.assertRaisesRegex(ValueError, "flag 'barbar' not recognized"):
diff --git a/runtime/bindings/python/vm.cc b/runtime/bindings/python/vm.cc
index d6a78e5..440732b 100644
--- a/runtime/bindings/python/vm.cc
+++ b/runtime/bindings/python/vm.cc
@@ -98,7 +98,7 @@
CheckApiStatus(status, "Error creating vm context with modules");
}
- IREE_CHECK(context);
+ IREE_ASSERT(context);
return VmContext::StealFromRawPtr(context);
}