[PATCH] Check Compile Flow Consistency tool (check_cfc.py)

Russell Gallop russell.gallop at gmail.com
Wed Apr 1 09:57:10 PDT 2015


================
Comment at: utils/check_cfc/check_cfc.py:87
@@ +86,3 @@
+    pathlist = path_var.split(os.pathsep)
+    pathlist = [a for a in pathlist if os.path.normpath(os.path.normcase(a)) != os.path.normpath(os.path.normcase(directory))]
+    return os.pathsep.join(pathlist)
----------------
rafael wrote:
> Would it be more idiomatic to use filter?
> 
I think that depends who you ask. Google style guide prefers list comprehensions.

I've tried the filter  and I think it looks clearer so I'll change it.

================
Comment at: utils/check_cfc/check_cfc.py:105
@@ +104,3 @@
+
+def is_output_specified(args):
+    """Return true is output file is specified in args."""
----------------
rafael wrote:
> This is just get_output_file != None, no?
Not quite, as get_output_file() derives something from the input file if there is no -o.

However I can see that there's some duplication here so I've refactored it so this can be done and it saves some code.

================
Comment at: utils/check_cfc/check_cfc.py:250
@@ +249,3 @@
+        # Compare disassembly (returns first diff if differs)
+        difference = obj_diff.compare_object_files(self._output_file_a, output_file_b)
+        if difference:
----------------
rafael wrote:
> This could be a bit more strict. For example, data sections should also not change.
> 
> How about comparing all sections that are present in both files?
> 
That's a good idea. I think that the obj_diff needs to provide different kinds of comparison (code, data, debug, byte for byte etc.) that a check can choose between.

Are you happy for me to treat this as an enhancement and I'll work out the best way to do this?

http://reviews.llvm.org/D8723

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list