| 1 |
//===- HeaderGenerate.hh - Output a header file for generated output. *- C++ -*-===// |
| 2 |
// |
| 3 |
// This project is licensed 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 |
| 6 |
// |
| 7 |
//===----------------------------------------------------------------------===// |
| 8 |
// |
| 9 |
/// \file |
| 10 |
/// Remove the body of all functions and only outputs the foward declaration. |
| 11 |
// |
| 12 |
//===----------------------------------------------------------------------===// |
| 13 |
|
| 14 |
/* Author: Giuliano Belinassi */ |
| 15 |
|
| 16 |
#pragma once |
| 17 |
|
| 18 |
#include "Passes.hh" |
| 19 |
#include "FunctionDepsFinder.hh" |
| 20 |
#include "SymbolExternalizer.hh" |
| 21 |
|
| 22 |
|
| 23 |
using namespace clang; |
| 24 |
|
| 25 |
/** Outputs a header file with a foward declarations of all functions in the current |
| 26 |
* AST. |
| 27 |
* |
| 28 |
* WARNING: This class modifies the AST. |
| 29 |
*/ |
| 30 |
class HeaderGeneration |
| 31 |
{ |
| 32 |
public: |
| 33 |
HeaderGeneration(PassManager::Context *); |
| 34 |
|
| 35 |
bool Run_Analysis(const std::vector<ExternalizerLogEntry> &set); |
| 36 |
|
| 37 |
void Print(void); |
| 38 |
|
| 39 |
protected: |
| 40 |
ASTUnit *AST; |
| 41 |
ClosureSet Closure; |
| 42 |
}; |