[FuzzMutate] Avoid calling function with metadata/token parameter/return type for...
authorHenry Yu <hnryu@ucdavis.edu>
Thu, 1 Jun 2023 20:56:20 +0000 (13:56 -0700)
committerPeter Rong <PeterRong96@gmail.com>
Thu, 1 Jun 2023 20:59:47 +0000 (13:59 -0700)
commit6a28d3c21d3a39e5a423cf0dd578d6d7ed6b9301
treeeb46d7a8709e6f11e799ababc65ba533ec2af2e2
parentf674ddc19fee67401b78f360e530bb064aa31ed8
[FuzzMutate] Avoid calling function with metadata/token parameter/return type for `InsertFunctionStrategy`

When there is a function with metadata/token parameter/return type, `InsertFunctionStrategy` will crash.

This patch fixes the problem by falling back to create function declaration when the sampled function contains metadata/token parameter/return type.

Reviewed By: Peter

Differential Revision: https://reviews.llvm.org/D150627
llvm/lib/FuzzMutate/IRMutator.cpp
llvm/unittests/FuzzMutate/StrategiesTest.cpp