[PATCH] D86406: Speedup llvm-dwarfdump 3.9x
Jan Kratochvil via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 26 01:30:14 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb20a4e293c3b: [Support] Speedup llvm-dwarfdump 3.9x (authored by jankratochvil).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86406/new/
https://reviews.llvm.org/D86406
Files:
llvm/include/llvm/Support/raw_ostream.h
llvm/lib/Support/raw_ostream.cpp
Index: llvm/lib/Support/raw_ostream.cpp
===================================================================
--- llvm/lib/Support/raw_ostream.cpp
+++ llvm/lib/Support/raw_ostream.cpp
@@ -858,7 +858,9 @@
}
bool raw_fd_ostream::has_colors() const {
- return sys::Process::FileDescriptorHasColors(FD);
+ if (!HasColors)
+ HasColors = sys::Process::FileDescriptorHasColors(FD);
+ return *HasColors;
}
Expected<sys::fs::FileLocker> raw_fd_ostream::lock() {
Index: llvm/include/llvm/Support/raw_ostream.h
===================================================================
--- llvm/include/llvm/Support/raw_ostream.h
+++ llvm/include/llvm/Support/raw_ostream.h
@@ -412,6 +412,7 @@
int FD;
bool ShouldClose;
bool SupportsSeeking = false;
+ mutable Optional<bool> HasColors;
#ifdef _WIN32
/// True if this fd refers to a Windows console device. Mintty and other
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86406.287861.patch
Type: text/x-patch
Size: 883 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200826/c5545dfe/attachment.bin>
More information about the llvm-commits
mailing list