[PATCH] D49526: Updated llvm-proto-fuzzer to execute the compiled code
Matt Morehouse via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 26 12:25:20 PDT 2018
morehouse added a comment.
Do we need to parse the arguments for opt-level, or can we just hardcode `-O2` and remove the argument parsing code?
================
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:144
+ Context);
+ Module *M = Owner.get();
+ if (!M)
----------------
emmettneyman wrote:
> morehouse wrote:
> > Why not just rename `Owner` to `M` and remove this line?
> Reverted it back since the change caused the fuzzer to crash.
You will need to move any uses of `M` above the call to `std::move`, since that leaves `M` in an invalid state.
================
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:90
+// Mimics the opt tool to run an optimization pass over the provided IR
+std::string OptLLVM(const std::string &IR, int OLvl) {
+ // Create a module that will run the optimization passes
----------------
Shouldn't `OLvl` be a `CodeGenOpt::Level`?
Repository:
rC Clang
https://reviews.llvm.org/D49526
More information about the llvm-commits
mailing list