2828
2929using namespace llvm ;
3030
31+ namespace opts {
32+ extern llvm::cl::opt<unsigned > Verbosity;
33+ } // namespace opts
34+
3135namespace llvm {
3236namespace bolt {
3337
@@ -44,9 +48,10 @@ bool PointerAuthCFIAnalyzer::runOnFunction(BinaryFunction &BF) {
4448 // we expect psign/pauth instructions to have the hasNegateRAState
4549 // annotation.
4650 BF.setIgnored ();
47- BC.outs () << " BOLT-INFO: inconsistent RAStates in function "
48- << BF.getPrintName ()
49- << " : ptr sign/auth inst without .cfi_negate_ra_state\n " ;
51+ if (opts::Verbosity >= 1 )
52+ BC.outs () << " BOLT-INFO: inconsistent RAStates in function "
53+ << BF.getPrintName ()
54+ << " : ptr sign/auth inst without .cfi_negate_ra_state\n " ;
5055 return false ;
5156 }
5257 }
@@ -64,19 +69,21 @@ bool PointerAuthCFIAnalyzer::runOnFunction(BinaryFunction &BF) {
6469 if (BC.MIB ->isPSignOnLR (Inst)) {
6570 if (RAState) {
6671 // RA signing instructions should only follow unsigned RA state.
67- BC.outs () << " BOLT-INFO: inconsistent RAStates in function "
68- << BF.getPrintName ()
69- << " : ptr signing inst encountered in Signed RA state\n " ;
72+ if (opts::Verbosity >= 1 )
73+ BC.outs () << " BOLT-INFO: inconsistent RAStates in function "
74+ << BF.getPrintName ()
75+ << " : ptr signing inst encountered in Signed RA state\n " ;
7076 BF.setIgnored ();
7177 return false ;
7278 }
7379 } else if (BC.MIB ->isPAuthOnLR (Inst)) {
7480 if (!RAState) {
7581 // RA authenticating instructions should only follow signed RA state.
76- BC.outs () << " BOLT-INFO: inconsistent RAStates in function "
77- << BF.getPrintName ()
78- << " : ptr authenticating inst encountered in Unsigned RA "
79- " state\n " ;
82+ if (opts::Verbosity >= 1 )
83+ BC.outs () << " BOLT-INFO: inconsistent RAStates in function "
84+ << BF.getPrintName ()
85+ << " : ptr authenticating inst encountered in Unsigned RA "
86+ " state\n " ;
8087 BF.setIgnored ();
8188 return false ;
8289 }
0 commit comments