[PATCH] D89186: [lit] Avoid calling realpath() for every printed message

Alexander Richardson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 18 10:50:51 PDT 2020


arichardson updated this revision to Diff 298889.
arichardson added a comment.

drop unncessary normpath


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89186/new/

https://reviews.llvm.org/D89186

Files:
  llvm/utils/lit/lit/LitConfig.py


Index: llvm/utils/lit/lit/LitConfig.py
===================================================================
--- llvm/utils/lit/lit/LitConfig.py
+++ llvm/utils/lit/lit/LitConfig.py
@@ -165,11 +165,10 @@
         f = inspect.currentframe()
         # Step out of _write_message, and then out of wrapper.
         f = f.f_back.f_back
-        file,line,_,_,_ = inspect.getframeinfo(f)
-        location = '%s:%d' % (file, line)
-
-        sys.stderr.write('%s: %s: %s: %s\n' % (self.progname, location,
-                                               kind, message))
+        file = os.path.abspath(inspect.getsourcefile(f))
+        line = inspect.getlineno(f)
+        sys.stderr.write('%s: %s:%d: %s: %s\n' % (self.progname, file, line,
+                                                  kind, message))
 
     def note(self, message):
         if not self.quiet:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89186.298889.patch
Type: text/x-patch
Size: 863 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201018/5a3f0376/attachment.bin>


More information about the llvm-commits mailing list