1 //==-- loop_proto_to_llvm_main.cpp - Driver for protobuf-LLVM conversion----==//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // Implements a simple driver to print a LLVM program from a protobuf with loops
11 //===----------------------------------------------------------------------===//
19 #include "loop_proto_to_llvm.h"
21 int main(int argc
, char **argv
) {
22 for (int i
= 1; i
< argc
; i
++) {
23 std::fstream
in(argv
[i
]);
24 std::string
str((std::istreambuf_iterator
<char>(in
)),
25 std::istreambuf_iterator
<char>());
26 std::cout
<< ";; " << argv
[i
] << std::endl
;
27 std::cout
<< clang_fuzzer::LoopProtoToLLVM(
28 reinterpret_cast<const uint8_t *>(str
.data()), str
.size());