[llvm] [llvm][Support] Support bright colors in raw_ostream (PR #80017)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 30 07:03:26 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff c61686e8abc2aee6e2e0ad09c6d1ade534e497b3 c9f1518241b27978c40b7a5fc52f2c5ad9d32604 -- llvm/include/llvm/Support/raw_ostream.h llvm/lib/Support/Process.cpp llvm/lib/Support/Unix/Process.inc llvm/lib/Support/Windows/Process.inc
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Support/Process.cpp b/llvm/lib/Support/Process.cpp
index f1ab8c7b9e..13e57dfdd4 100644
--- a/llvm/lib/Support/Process.cpp
+++ b/llvm/lib/Support/Process.cpp
@@ -70,24 +70,16 @@ Process::FindInEnvPath(StringRef EnvName, StringRef FileName,
#define COLOR(FGBG, CODE, BOLD) "\033[0;" BOLD FGBG CODE "m"
-#define ALLCOLORS(FGBG, BRIGHT, BOLD) \
- { \
- COLOR(FGBG, "0", BOLD), \
- COLOR(FGBG, "1", BOLD), \
- COLOR(FGBG, "2", BOLD), \
- COLOR(FGBG, "3", BOLD), \
- COLOR(FGBG, "4", BOLD), \
- COLOR(FGBG, "5", BOLD), \
- COLOR(FGBG, "6", BOLD), \
- COLOR(FGBG, "7", BOLD), \
- COLOR(BRIGHT, "0", BOLD), \
- COLOR(BRIGHT, "1", BOLD), \
- COLOR(BRIGHT, "2", BOLD), \
- COLOR(BRIGHT, "3", BOLD), \
- COLOR(BRIGHT, "4", BOLD), \
- COLOR(BRIGHT, "5", BOLD), \
- COLOR(BRIGHT, "6", BOLD), \
- COLOR(BRIGHT, "7", BOLD), \
+#define ALLCOLORS(FGBG, BRIGHT, BOLD) \
+ { \
+ COLOR(FGBG, "0", BOLD), COLOR(FGBG, "1", BOLD), COLOR(FGBG, "2", BOLD), \
+ COLOR(FGBG, "3", BOLD), COLOR(FGBG, "4", BOLD), \
+ COLOR(FGBG, "5", BOLD), COLOR(FGBG, "6", BOLD), \
+ COLOR(FGBG, "7", BOLD), COLOR(BRIGHT, "0", BOLD), \
+ COLOR(BRIGHT, "1", BOLD), COLOR(BRIGHT, "2", BOLD), \
+ COLOR(BRIGHT, "3", BOLD), COLOR(BRIGHT, "4", BOLD), \
+ COLOR(BRIGHT, "5", BOLD), COLOR(BRIGHT, "6", BOLD), \
+ COLOR(BRIGHT, "7", BOLD), \
}
// bg
@@ -97,9 +89,11 @@ Process::FindInEnvPath(StringRef EnvName, StringRef FileName,
// | | |
// | | |
static const char colorcodes[2][2][16][11] = {
- { ALLCOLORS("3", "9", ""), ALLCOLORS("3", "9", "1;"),},
- { ALLCOLORS("4", "10", ""), ALLCOLORS("4", "10", "1;")}
-};
+ {
+ ALLCOLORS("3", "9", ""),
+ ALLCOLORS("3", "9", "1;"),
+ },
+ {ALLCOLORS("4", "10", ""), ALLCOLORS("4", "10", "1;")}};
// A CMake option controls wheter we emit core dumps by default. An application
// may disable core dumps by calling Process::PreventCoreFiles().
``````````
</details>
https://github.com/llvm/llvm-project/pull/80017
More information about the llvm-commits
mailing list