forked from OSchip/llvm-project
[NPM][opt] Disallow -analyze under NPM
-analyze does not work with the NPM. 'print<foo>' passes should be used instead.
This commit is contained in:
parent
5e2c9a05b7
commit
da43d428d0
|
@ -1,5 +1,5 @@
|
|||
;RUN: opt < %s -analyze -dot-cfg-only 2>/dev/null
|
||||
;RUN: opt < %s -analyze -passes=dot-cfg-only 2>/dev/null
|
||||
;RUN: opt < %s -passes=dot-cfg-only 2>/dev/null
|
||||
;RUN: opt < %s -analyze -dot-cfg-only \
|
||||
;RUN: -cfg-heat-colors=true -cfg-weights=true 2>/dev/null
|
||||
;RUN: opt < %s -analyze -dot-cfg-only \
|
||||
|
|
|
@ -753,9 +753,13 @@ int main(int argc, char **argv) {
|
|||
// but `-enable-new-pm -codegenprepare` will still revert to legacy PM.
|
||||
if ((EnableNewPassManager && !CodegenPassSpecifiedInPassList()) ||
|
||||
PassPipeline.getNumOccurrences() > 0) {
|
||||
if (AnalyzeOnly) {
|
||||
errs() << "Cannot specify -analyze under new pass manager\n";
|
||||
return 1;
|
||||
}
|
||||
if (PassPipeline.getNumOccurrences() > 0 && PassList.size() > 0) {
|
||||
errs()
|
||||
<< "Cannot specify passes via both -foo-pass and --passes=foo-pass";
|
||||
<< "Cannot specify passes via both -foo-pass and --passes=foo-pass\n";
|
||||
return 1;
|
||||
}
|
||||
SmallVector<StringRef, 4> Passes;
|
||||
|
|
Loading…
Reference in New Issue