follow up to https://reviews.llvm.org/D116633
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
this patch depends on D116633, but D116633 is useless without this one
a better patch order is :
- llvm
- clang
- compiler-rt (but if it's just test which uses clang flag it should be OK merge with no.2 )
let's do just llvm here, and move clang stuff into D116633 with the rest
we should update third_party/llvm/llvm-project/llvm/lib/Passes/PassBuilder.cpp:640
after that we can update third_party/llvm/llvm-project/llvm/test/Instrumentation/MemorySanitizer/msan_eager.ll
with additional ; RUN: line with "-passes='module(msan-module<OPTION_NAME->),function(msan<OPTION_NAME>)" instead of -msan-eager-checks
compiler-rt/test/msan/noundef_analysis.cpp | ||
---|---|---|
5 ↗ | (On Diff #397427) | we can land it with driver patch |
llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h | ||
30 | maybe we should use CheckParamRetVal something here? | |
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | ||
496 | mllvm is lower level flag, so it should be opposite with getOptOrDefault below you don't need anything here | |
676 | EagerChecks(getOptOrDefault(ClEagerChecks, EagerChecks)) |
llvm/include/llvm/Transforms/Instrumentation/MemorySanitizer.h | ||
---|---|---|
30 | How about EagerChecksRequested? | |
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp | ||
496 | I disagree. The variable ClEagerChecks is referenced in the code. If it is not configured based on EagerChecksRequested, there is no way to change the behavior based on the presence of the flag. I will admit that with the change below, it is a bit circular, because Options.EagerChecksRequested prefers the -msan-eager-checks flag, but may default to EagerChecksRequested parameter, and then here the flag variable (ClEagerChecks) is set based on Options.EagerChecksRequested. An alternative is to have a member variable of MemorySanitizer that is consulted in the code. It is configured based on Options.EagerChecksRequested. The flag (-msan-eager-checks) is only consulted below with the call to getOptOrDefault. (I coded this up: https://reviews.llvm.org/D116855) |
maybe we should use CheckParamRetVal something here?