[PATCH] D49526: Updated llvm-proto-fuzzer to execute the compiled code

Emmett Neyman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 26 11:48:34 PDT 2018


emmettneyman added inline comments.


================
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:144
+                                           Context);
+  Module *M = Owner.get();
+  if (!M)
----------------
morehouse wrote:
> Why not just rename `Owner` to `M` and remove this line?
Reverted it back since the change caused the fuzzer to crash.


================
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:147
+  builder.setUseOrcMCJITReplacement(false);
+  builder.setMCJITMemoryManager(make_unique<SectionMemoryManager>());
+  builder.setOptLevel(OLvl);
----------------
morehouse wrote:
> This uses `llvm:make_unique`, which was written when LLVM used C++11.  But since LLVM now uses C++14, I think we should use `std::make_unique` instead.
We talked offline, but just to put it in writing: My current LLVM build uses C++11 so I'm keeping it `llvm::make_unique`.


================
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:184
+  CodeGenOpt::Level OLvl;
+  getOptLevel(ExtraArgs, OLvl);
+  
----------------
morehouse wrote:
> We're allowing the JIT opt-level to be specified on the command line, but we're hard-coding OptLevel=3 for the optimization passes.
> 
> Do we need to allow the opt-level to be specified on the command line?
Good point. Will change to make `OptLLVM()` use the same optimization level as the JIT Engine.


Repository:
  rC Clang

https://reviews.llvm.org/D49526





More information about the cfe-commits mailing list