This revision was automatically updated to reflect the committed changes.
Closed by commit rL338077: Updated llvm-proto-fuzzer to execute the compiled
code (authored by emmettneyman, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D49526?vs=157577&id=157591#toc
Repository:
emmettneyman updated this revision to Diff 157577.
emmettneyman added a comment.
Made some minor fixes
Repository:
rC Clang
https://reviews.llvm.org/D49526
Files:
clang/tools/clang-fuzzer/fuzzer-initialize/fuzzer_initialize.cpp
clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt
clang/
morehouse added inline comments.
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:152
+ typedef void (*func)(int*, int*, int*, int);
+ func f = (func) EE->getPointerToFunction(EntryFunc);
+
Can we use `reinterpret_cast` here?
Repository:
rC
morehouse added inline comments.
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:125
+ Context);
+ Module *M = Owner.get();
+ if (!M)
We should be able to get rid of this line now, and rename Owner again
emmettneyman updated this revision to Diff 157553.
emmettneyman added a comment.
Changed int to CodeGenOpt::Level and fixed unique_ptr issue
Repository:
rC Clang
https://reviews.llvm.org/D49526
Files:
clang/tools/clang-fuzzer/fuzzer-initialize/fuzzer_initialize.cpp
clang/tools/clang-fuzz
emmettneyman added a comment.
In https://reviews.llvm.org/D49526#1177208, @morehouse wrote:
> Do we need to parse the arguments for opt-level, or can we just hardcode
> `-O2` and remove the argument parsing code?
I have the argument parsing code since the original `clang-proto-fuzzer` code
ha
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
emmettneyman updated this revision to Diff 157545.
emmettneyman added a comment.
Small change to fix line length
Repository:
rC Clang
https://reviews.llvm.org/D49526
Files:
clang/tools/clang-fuzzer/fuzzer-initialize/fuzzer_initialize.cpp
clang/tools/clang-fuzzer/handle-llvm/CMakeLists.tx
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
emmettneyman updated this revision to Diff 157544.
emmettneyman added a comment.
- Code style fixes
- Removed `FPasses`
- Allowed CL Args to specify opt level for `OptLLVM()`
Repository:
rC Clang
https://reviews.llvm.org/D49526
Files:
clang/tools/clang-fuzzer/fuzzer-initialize/fuzzer_initi
pcc added inline comments.
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:147
+ builder.setUseOrcMCJITReplacement(false);
+ builder.setMCJITMemoryManager(make_unique());
+ builder.setOptLevel(OLvl);
morehouse wrote:
> This uses `llvm:make_uni
morehouse added inline comments.
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:115
+ make_unique(M.get());
+ FPasses->add(createTargetTransformInfoWrapperPass(TargetIRAnalysis()));
+
emmettneyman wrote:
> morehouse wrote:
> > morehouse wr
emmettneyman added inline comments.
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:159
+ std::unique_ptr(RTDyldMM));
+ builder.setOptLevel(OLvl);
+ builder.setTargetOptions(InitTargetOptionsFromCodeGenFlags());
emmettneyman wrote:
> moreh
emmettneyman updated this revision to Diff 157388.
emmettneyman added a comment.
Fixed some things, made code cleaner
Repository:
rC Clang
https://reviews.llvm.org/D49526
Files:
clang/tools/clang-fuzzer/fuzzer-initialize/fuzzer_initialize.cpp
clang/tools/clang-fuzzer/handle-llvm/CMakeLis
emmettneyman added inline comments.
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:89
+ Builder.Inliner = createFunctionInliningPass(OptLevel, SizeLevel, false);
+ Builder.LoopVectorize = true;
+ Builder.populateFunctionPassManager(FPM);
more
morehouse added inline comments.
Comment at: clang/tools/clang-fuzzer/fuzzer-initialize/fuzzer_initialize.cpp:44
+
+ PassRegistry &Registry = *llvm::PassRegistry::getPassRegistry();
+ initializeCore(Registry);
Unnecessary `llvm::`
Comment a
emmettneyman updated this revision to Diff 157335.
emmettneyman added a comment.
- cleaned up code and moved initialization code
- removed fake command line parsing
Repository:
rC Clang
https://reviews.llvm.org/D49526
Files:
clang/tools/clang-fuzzer/fuzzer-initialize/fuzzer_initialize.cpp
emmettneyman added inline comments.
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:208
+
+ static_cast(RTDyldMM)->invalidateInstructionCache();
+
morehouse wrote:
> This cast shouldn't be necessary.
Turns out this line is redundant anyways. `EE
morehouse added inline comments.
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:190
+ builder.setMCJITMemoryManager(
+ std::unique_ptr(RTDyldMM));
+ builder.setOptLevel(OLvl);
emmettneyman wrote:
> morehouse wrote:
> > emmettneyman wrote:
emmettneyman added inline comments.
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:190
+ builder.setMCJITMemoryManager(
+ std::unique_ptr(RTDyldMM));
+ builder.setOptLevel(OLvl);
morehouse wrote:
> emmettneyman wrote:
> > morehouse wrote:
morehouse added inline comments.
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:190
+ builder.setMCJITMemoryManager(
+ std::unique_ptr(RTDyldMM));
+ builder.setOptLevel(OLvl);
emmettneyman wrote:
> morehouse wrote:
> > emmettneyman wrote:
emmettneyman added inline comments.
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:190
+ builder.setMCJITMemoryManager(
+ std::unique_ptr(RTDyldMM));
+ builder.setOptLevel(OLvl);
morehouse wrote:
> emmettneyman wrote:
> > morehouse wrote:
morehouse added inline comments.
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:190
+ builder.setMCJITMemoryManager(
+ std::unique_ptr(RTDyldMM));
+ builder.setOptLevel(OLvl);
emmettneyman wrote:
> morehouse wrote:
> > These 3 lines can b
emmettneyman added inline comments.
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:190
+ builder.setMCJITMemoryManager(
+ std::unique_ptr(RTDyldMM));
+ builder.setOptLevel(OLvl);
morehouse wrote:
> These 3 lines can be combined to `builde
morehouse added inline comments.
Comment at: clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt:17
-# Depend on LLVM IR intrinsic generation.
+# Depend on LLVM IR instrinsic generation.
set(handle_llvm_deps intrinsics_gen)
Typo introduced here.
emmettneyman updated this revision to Diff 157138.
emmettneyman added a comment.
Cleaned up code
Tried to get rid of ParseCommandLineOptions() call but could not figure out
how to initialize a PassInfo object without it.
Repository:
rC Clang
https://reviews.llvm.org/D49526
Files:
clang/to
emmettneyman updated this revision to Diff 156862.
emmettneyman added a comment.
Made fixes to patch, rebased CMake file
Repository:
rC Clang
https://reviews.llvm.org/D49526
Files:
clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt
clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp
I
pcc added inline comments.
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:211-224
+ std::string ErrorMsg1;
+ EngineBuilder builder1(std::move(Owner1));
+ builder1.setMArch(MArch);
+ builder1.setMCPU(getCPUStr());
+ builder1.setMAttrs(getFeatureList());
+ b
morehouse added inline comments.
Comment at: clang/tools/clang-fuzzer/handle-llvm/CMakeLists.txt:21
+ set(handle_llvm_deps)
+endif()
How are you doing your diff? Some of these changes are already upstream.
Please rebase
Comment at: clang
emmettneyman updated this revision to Diff 156370.
emmettneyman added a comment.
- Fixed typo that broke build
Repository:
rC Clang
https://reviews.llvm.org/D49526
Files:
clang/tools/clang-fuzzer/CMakeLists.txt
clang/tools/clang-fuzzer/ExampleClangLLVMProtoFuzzer.cpp
clang/tools/clang-
emmettneyman updated this revision to Diff 156364.
emmettneyman added a comment.
- Cleaned up leftover code from mmap memcpy
Repository:
rC Clang
https://reviews.llvm.org/D49526
Files:
clang/tools/clang-fuzzer/CMakeLists.txt
clang/tools/clang-fuzzer/ExampleClangLLVMProtoFuzzer.cpp
clan
emmettneyman updated this revision to Diff 156362.
emmettneyman added a comment.
- Switched to JIT for compilation and execution
Repository:
rC Clang
https://reviews.llvm.org/D49526
Files:
clang/tools/clang-fuzzer/CMakeLists.txt
clang/tools/clang-fuzzer/ExampleClangLLVMProtoFuzzer.cpp
morehouse added a comment.
You can probably get rid of the llvm-objcopy code and make this a lot simpler
with something like:
1. Call `getSection()` on the Binary object to get the text section.
2. Read the `sh_offset` and `sh_size` of that section.
3. Copy `sh_size` bytes from the start of the
pcc added inline comments.
Comment at: clang/tools/clang-fuzzer/handle-llvm/handle_llvm.cpp:209
+
+// Helper function that converts ELF relocatable into raw machine code that
+// can be executed in memory. Returns size of machine code.
Did you look at using LLVM'
emmettneyman added a comment.
The files
Object.h
Object.cpp
llvm-objcopy.h
are from llvm/tools/llvm-obj-copy with only slight modifications, mostly
deleting irrelevant parts.
Repository:
rC Clang
https://reviews.llvm.org/D49526
___
cfe-c
emmettneyman created this revision.
emmettneyman added reviewers: morehouse, kcc.
Herald added subscribers: cfe-commits, mgorny.
Herald added a reviewer: alexshap.
Made changes to the llvm-proto-fuzzer
- Added loop vectorizer optimization pass in order to have two IR versions
- Updated old fuzz t
36 matches
Mail list logo