[llvm] [llvm-lit] Adding -e option to lit's built-in cat command (PR #102061)

Paul Kirth via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 6 10:11:47 PDT 2024


================
@@ -69,8 +87,8 @@ def main(argv):
                 fileToCat = open(filename, "rb")
                 contents = fileToCat.read()
 
-            if show_nonprinting:
-                contents = convertToCaretAndMNotation(contents)
+            if True in fields(enabled_options):
+                contents = convertTextNotation(contents, enabled_options)
----------------
ilovepi wrote:

But that means well run the conversion code when we don't need to right? It's preferable in my opinion to avoid that work if we don't have to, specially since that routine a character by character copy.

I'm also wondering if we should have an early exit from the routine if the neither option is set. WDYT?

https://github.com/llvm/llvm-project/pull/102061


More information about the llvm-commits mailing list