Logo ROOT  
Reference Guide
TClingRdictModuleFileExtension.h
Go to the documentation of this file.
1 /// \file TClingRdictModuleFileExtension.h
2 ///
3 /// \brief The file contains facilities to work with C++ module files extensions
4 /// used to store rdict files.
5 ///
6 /// \author Vassil Vassilev <vvasilev@cern.ch>
7 ///
8 /// \date May, 2019
9 ///
10 /*************************************************************************
11  * Copyright (C) 1995-2018, Rene Brun and Fons Rademakers. *
12  * All rights reserved. *
13  * *
14  * For the licensing terms see $ROOTSYS/LICENSE. *
15  * For the list of contributors see $ROOTSYS/README/CREDITS. *
16  *************************************************************************/
17 
18 #ifndef ROOT_CLING_RDICT_MODULE_FILE_EXTENSION_H
19 #define ROOT_CLING_RDICT_MODULE_FILE_EXTENSION_H
20 
21 #include "clang/Serialization/ModuleFileExtension.h"
22 
23 #include "llvm/Bitcode/BitstreamReader.h"
24 
25 /// A module file extension used for testing purposes.
26 class TClingRdictModuleFileExtension : public clang::ModuleFileExtension {
27 
28  class Writer : public clang::ModuleFileExtensionWriter {
29  public:
30  Writer(ModuleFileExtension *Ext) : ModuleFileExtensionWriter(Ext) {}
31  ~Writer() override;
32 
33  void writeExtensionContents(clang::Sema &SemaRef, llvm::BitstreamWriter &Stream) override;
34  };
35 
36  class Reader : public clang::ModuleFileExtensionReader {
37  llvm::BitstreamCursor Stream;
38 
39  public:
40  ~Reader() override;
41 
42  Reader(clang::ModuleFileExtension *Ext, clang::ASTReader &Reader, clang::serialization::ModuleFile &Mod,
43  const llvm::BitstreamCursor &InStream);
44  };
45 
46 public:
48 
50 
51  clang::ModuleFileExtensionMetadata getExtensionMetadata() const override;
52 
53  llvm::hash_code hashExtension(llvm::hash_code Code) const override;
54 
55  std::unique_ptr<clang::ModuleFileExtensionWriter> createExtensionWriter(clang::ASTWriter &Writer) override;
56 
57  std::unique_ptr<clang::ModuleFileExtensionReader>
58  createExtensionReader(const clang::ModuleFileExtensionMetadata &Metadata, clang::ASTReader &Reader,
59  clang::serialization::ModuleFile &Mod, const llvm::BitstreamCursor &Stream) override;
60 };
61 
62 #endif
TClingRdictModuleFileExtension::getExtensionMetadata
clang::ModuleFileExtensionMetadata getExtensionMetadata() const override
Definition: TClingRdictModuleFileExtension.cxx:142
TClingRdictModuleFileExtension::TClingRdictModuleFileExtension
TClingRdictModuleFileExtension()
Definition: TClingRdictModuleFileExtension.h:47
TClingRdictModuleFileExtension::~TClingRdictModuleFileExtension
~TClingRdictModuleFileExtension() override
Definition: TClingRdictModuleFileExtension.cxx:140
TClingRdictModuleFileExtension::Reader::~Reader
~Reader() override
Definition: TClingRdictModuleFileExtension.cxx:138
TClingRdictModuleFileExtension::Reader
Definition: TClingRdictModuleFileExtension.h:36
TClingRdictModuleFileExtension
A module file extension used for testing purposes.
Definition: TClingRdictModuleFileExtension.h:26
TClingRdictModuleFileExtension::Writer
Definition: TClingRdictModuleFileExtension.h:28
TClingRdictModuleFileExtension::Writer::writeExtensionContents
void writeExtensionContents(clang::Sema &SemaRef, llvm::BitstreamWriter &Stream) override
Definition: TClingRdictModuleFileExtension.cxx:50
TClingRdictModuleFileExtension::Writer::~Writer
~Writer() override
Definition: TClingRdictModuleFileExtension.cxx:48
TClingRdictModuleFileExtension::createExtensionWriter
std::unique_ptr< clang::ModuleFileExtensionWriter > createExtensionWriter(clang::ASTWriter &Writer) override
Definition: TClingRdictModuleFileExtension.cxx:158
TClingRdictModuleFileExtension::hashExtension
llvm::hash_code hashExtension(llvm::hash_code Code) const override
Definition: TClingRdictModuleFileExtension.cxx:148
TClingRdictModuleFileExtension::createExtensionReader
std::unique_ptr< clang::ModuleFileExtensionReader > createExtensionReader(const clang::ModuleFileExtensionMetadata &Metadata, clang::ASTReader &Reader, clang::serialization::ModuleFile &Mod, const llvm::BitstreamCursor &Stream) override
Definition: TClingRdictModuleFileExtension.cxx:164
TClingRdictModuleFileExtension::Writer::Writer
Writer(ModuleFileExtension *Ext)
Definition: TClingRdictModuleFileExtension.h:30
TClingRdictModuleFileExtension::Reader::Stream
llvm::BitstreamCursor Stream
Definition: TClingRdictModuleFileExtension.h:37
TClingRdictModuleFileExtension::Reader::Reader
Reader(clang::ModuleFileExtension *Ext, clang::ASTReader &Reader, clang::serialization::ModuleFile &Mod, const llvm::BitstreamCursor &InStream)
Definition: TClingRdictModuleFileExtension.cxx:97