Files
carbon-lang/explorer/fuzzing/fuzzer_util.h
T
Jon Meow 20728dbd3a CARBON_ header guards (#1261)
This modifies scripts/check_header_guards.py to add the CARBON_ prefix; everything else is pre-commit.
2022-05-12 17:25:43 -07:00

31 lines
985 B
C++

// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef CARBON_EXPLORER_FUZZING_FUZZER_UTIL_H_
#define CARBON_EXPLORER_FUZZING_FUZZER_UTIL_H_
#include "common/error.h"
#include "common/fuzzing/carbon.pb.h"
namespace Carbon {
// Converts `compilation_unit` to Carbon. Adds an default `Main()`
// definition if one is not present in the proto.
auto ProtoToCarbonWithMain(const Fuzzing::CompilationUnit& compilation_unit)
-> std::string;
// Parses and executes a fuzzer-generated program.
void ParseAndExecute(const Fuzzing::CompilationUnit& compilation_unit);
namespace Internal {
// Returns a full path for a file under bazel runfiles.
// Exposed for testing.
auto GetRunfilesFile(const std::string& file) -> ErrorOr<std::string>;
} // namespace Internal
} // namespace Carbon
#endif // CARBON_EXPLORER_FUZZING_FUZZER_UTIL_H_