1 //===- ExtractAPI/ExtractAPIActionBase.h -----------------------------*- C++
2 //-*-===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// \file
11 /// This file defines the ExtractAPIActionBase class.
12 ///
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_CLANG_EXTRACTAPI_ACTION_BASE_H
16 #define LLVM_CLANG_EXTRACTAPI_ACTION_BASE_H
17 
18 #include "clang/ExtractAPI/API.h"
19 #include "clang/ExtractAPI/APIIgnoresList.h"
20 
21 namespace clang {
22 
23 /// Base class to be used by front end actions to generate ExtarctAPI info
24 ///
25 /// Deriving from this class equips an action with all the necessary tools to
26 /// generate ExractAPI information in form of symbol-graphs
27 class ExtractAPIActionBase {
28 protected:
29   /// A representation of the APIs this action extracts.
30   std::unique_ptr<extractapi::APISet> API;
31 
32   /// A stream to the output file of this action.
33   std::unique_ptr<raw_pwrite_stream> OS;
34 
35   /// The product this action is extracting API information for.
36   std::string ProductName;
37 
38   /// The synthesized input buffer that contains all the provided input header
39   /// files.
40   std::unique_ptr<llvm::MemoryBuffer> Buffer;
41 
42   /// The list of symbols to ignore during serialization
43   extractapi::APIIgnoresList IgnoresList;
44 
45   /// Implements EndSourceFileAction for Symbol-Graph generation
46   ///
47   /// Use the serializer to generate output symbol graph files from
48   /// the information gathered during the execution of Action.
49   void ImplEndSourceFileAction();
50 };
51 
52 } // namespace clang
53 
54 #endif // LLVM_CLANG_EXTRACTAPI_ACTION_BASE_H
55