-
Notifications
You must be signed in to change notification settings - Fork 14k
CMake: Fix LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING in reentrancy situa… #144331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
endif() | ||
if( NOT ${LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING} EQUAL 0 | ||
AND NOT ${LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING} EQUAL 1 ) | ||
string(TOUPPER "${LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING}" uppercase_LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This look like redefinition from line 199.
string(TOUPPER "${LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING}" uppercase_LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING)
Can you just keep one definition ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fix!
It has been introduced in #107278 but it was passing "DISABLED" of LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING to cmakedefine01. cmakadefine01 treats non-false-like strings as 1. "DISABLED" is replaced with 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM Thanks for fixing this.
@umangyadav please let me know if you are going to merge this after the CI finishes. I can do it myself as well. |
I don't have commit access. Can you please do it ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you proceed this w/o mentioning original author(s)? @SLTozer #107278 #143590
I guess it would just work but nasty. This should be rewritten w/o modifying cache vars, finally.
I also guess this would be tolerant of cmake -DLLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING=0
. Is it intented?
If you want it to be a workaround, you may reduce affected lines, e.g.
string(TOUPPER "${LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING}" uppercase_LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING)
if( uppercase_LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING STREQUAL "0" OR uppercase_LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING STREQUAL "1")
# Do nothing.
elseif( uppercase_LLVM_ENABLE_DEBUGLOC_COVERAGE_TRACKING STREQUAL "COVERAGE" )
Good point, @chapuni! I did not realize @penguin-wwy was not the original author. Let me try to rework it. It is blocking me as well. |
Issue should be fixed by #144391, should this be closed? |
In the case of re-entrance, an error will be reported for valid values.
For example, in downstream projects:
llvm/torch-mlir#4230 (comment)