From c94c26cb56182bd037a6022ac78daad19089127d Mon Sep 17 00:00:00 2001 From: "Dongjia \"toka\" Zhang" Date: Sat, 7 Oct 2023 16:36:33 +0200 Subject: [PATCH] Document how to use cpp() and optimize() (#1615) --- libafl_cc/src/clang.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libafl_cc/src/clang.rs b/libafl_cc/src/clang.rs index e6b3e1494f..f81ea62582 100644 --- a/libafl_cc/src/clang.rs +++ b/libafl_cc/src/clang.rs @@ -248,8 +248,8 @@ impl ToolWrapper for ClangWrapper { self.linking = linking; self.shared = shared; + new_args.push("-g".into()); if self.optimize { - new_args.push("-g".into()); new_args.push("-O3".into()); new_args.push("-funroll-loops".into()); } @@ -585,13 +585,13 @@ impl ClangWrapper { self } - /// Disable optimizations + /// Disable optimizations, call this before calling `parse_args` pub fn dont_optimize(&mut self) -> &'_ mut Self { self.optimize = false; self } - /// Set cpp mode + /// Set cpp mode, call this before calling `parse_args` pub fn cpp(&mut self, value: bool) -> &'_ mut Self { self.is_cpp = value; self