[flang-commits] [flang] [FLANG][OPENMP] Fix handling of continuation lines in mixed OpenMP an… (PR #120714)
via flang-commits
flang-commits at lists.llvm.org
Thu Dec 26 04:21:33 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 a72bfc5a1e5381012213df36389524f74ef7c8a3 7cc7adfe285c66084f1110ea60dc19a1af8f54b5 --extensions cpp -- flang/lib/Parser/prescan.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/flang/lib/Parser/prescan.cpp b/flang/lib/Parser/prescan.cpp
index 21b4b82aff..d76d6dc399 100644
--- a/flang/lib/Parser/prescan.cpp
+++ b/flang/lib/Parser/prescan.cpp
@@ -1292,29 +1292,29 @@ const char *Prescanner::FreeFormContinuationLine(bool ampersand) {
if (*p == '!') {
++p;
if (InCompilerDirective()) {
-
+
for (const char *s{directiveSentinel_}; *s != '\0'; ++p, ++s) {
if (*s != ToLowerCaseLetter(*p)) {
return nullptr;
}
}
-
+
} else if (features_.IsEnabled(LanguageFeature::OpenMP)) {
++p;
} else {
return nullptr;
}
- p = SkipWhiteSpace(p);
- if (*p == '&') {
- if (!ampersand) {
- insertASpace_ = true;
- }
- return p + 1;
- } else if (ampersand) {
- return p;
- } else {
- return nullptr;
+ p = SkipWhiteSpace(p);
+ if (*p == '&') {
+ if (!ampersand) {
+ insertASpace_ = true;
}
+ return p + 1;
+ } else if (ampersand) {
+ return p;
+ } else {
+ return nullptr;
+ }
} else {
if (*p == '&') {
p = SkipWhiteSpace(p + 1);
``````````
</details>
https://github.com/llvm/llvm-project/pull/120714
More information about the flang-commits
mailing list