[PATCH] D49526: Updated llvm-proto-fuzzer to execute the compiled code
Matt Morehouse via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 25 11:24:38 PDT 2018
morehouse added inline comments.
================
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:190
+ builder.setMCJITMemoryManager(
+ std::unique_ptr<RTDyldMemoryManager>(RTDyldMM));
+ builder.setOptLevel(OLvl);
----------------
emmettneyman wrote:
> morehouse wrote:
> > emmettneyman wrote:
> > > morehouse wrote:
> > > > emmettneyman wrote:
> > > > > morehouse wrote:
> > > > > > These 3 lines can be combined to `builder.setMCJITMemoryManager(new SectionMemoryManager())`
> > > > > I use RTDyldMM on line 208. Should I just keep these lines as they are?
> > > > Ah, missed that. In that case, you can probably simplify this line to
> > > > `builder.setMCJITMemoryManager(RTDyldMM)`.
> > > It looks like set `MCJITMemoryManager()` needs to take a `unique_ptr`. I'm not sure how to clean it up any more than it already is.
> > Does it not implicitly cast?
> No, I think it only works in the other direction.
Ok, I see. The constructor we need is marked explicit...
================
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:208
+
+ static_cast<SectionMemoryManager*>(RTDyldMM)->invalidateInstructionCache();
+
----------------
This cast shouldn't be necessary.
Repository:
rC Clang
https://reviews.llvm.org/D49526
More information about the cfe-commits
mailing list