-
Notifications
You must be signed in to change notification settings - Fork 2
/
Main.cpp
39 lines (30 loc) · 1.05 KB
/
Main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//===- Main.cpp - Clang-extract entry point --*- C++ -*-===//
//
// This project is licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
/// \file
/// Clang-extract entry point.
//
//===----------------------------------------------------------------------===//
/* Author: Giuliano Belinassi */
#include "ArgvParser.hh"
#include "Passes.hh"
#include "Error.hh"
#include <iostream>
using namespace llvm;
using namespace clang;
int main(int argc, char **argv)
{
ArgvParser args(argc, argv);
auto func_extract_names = args.Get_Functions_To_Extract();
if (func_extract_names.size() == 0) {
DiagsClass::Emit_Error("No function to extract.\n"
"pass -DCE_EXTRACT_FUNCTIONS=func<1>,...,func<n> to determine which functions to extract.");
return 1;
}
return PassManager().Run_Passes(args);
}