OmniSciDB  340b00dbf6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{UDFCompiler.cpp}::FunctionDeclVisitor Class Reference
+ Inheritance diagram for anonymous_namespace{UDFCompiler.cpp}::FunctionDeclVisitor:
+ Collaboration diagram for anonymous_namespace{UDFCompiler.cpp}::FunctionDeclVisitor:

Public Member Functions

 FunctionDeclVisitor (llvm::raw_fd_ostream &ast_file, SourceManager &s_manager, ASTContext &context)
 
bool VisitFunctionDecl (FunctionDecl *f)
 

Private Member Functions

std::string getMainFileName () const
 
std::string getFuncDeclFileName (FunctionDecl *f) const
 

Private Attributes

llvm::raw_fd_ostream & ast_file_
 
SourceManager & source_manager_
 
ASTContext & context_
 

Detailed Description

Definition at line 53 of file UDFCompiler.cpp.

Constructor & Destructor Documentation

anonymous_namespace{UDFCompiler.cpp}::FunctionDeclVisitor::FunctionDeclVisitor ( llvm::raw_fd_ostream &  ast_file,
SourceManager &  s_manager,
ASTContext &  context 
)
inline

Definition at line 55 of file UDFCompiler.cpp.

58  : ast_file_(ast_file), source_manager_(s_manager), context_(context) {
59  source_manager_.getDiagnostics().setShowColors(false);
60  }

Member Function Documentation

std::string anonymous_namespace{UDFCompiler.cpp}::FunctionDeclVisitor::getFuncDeclFileName ( FunctionDecl *  f) const
inlineprivate

Definition at line 85 of file UDFCompiler.cpp.

85  {
86  SourceLocation spell_loc = source_manager_.getSpellingLoc(f->getLocation());
87  PresumedLoc p_loc = source_manager_.getPresumedLoc(spell_loc);
88 
89  return std::string(p_loc.getFilename());
90  }
std::string anonymous_namespace{UDFCompiler.cpp}::FunctionDeclVisitor::getMainFileName ( ) const
inlineprivate

Definition at line 80 of file UDFCompiler.cpp.

80  {
81  auto f_entry = source_manager_.getFileEntryForID(source_manager_.getMainFileID());
82  return f_entry->getName().str();
83  }
bool anonymous_namespace{UDFCompiler.cpp}::FunctionDeclVisitor::VisitFunctionDecl ( FunctionDecl *  f)
inline

Definition at line 62 of file UDFCompiler.cpp.

62  {
63  // Only function definitions (with bodies), not declarations.
64  if (f->hasBody()) {
66  auto printing_policy = context_.getPrintingPolicy();
67  printing_policy.FullyQualifiedName = 1;
68  printing_policy.UseVoidForZeroParams = 1;
69  printing_policy.PolishForDeclaration = 1;
70  printing_policy.TerseOutput = 1;
71  f->print(ast_file_, printing_policy);
72  ast_file_ << "\n";
73  }
74  }
75 
76  return true;
77  }
std::string getFuncDeclFileName(FunctionDecl *f) const
Definition: UDFCompiler.cpp:85

Member Data Documentation

llvm::raw_fd_ostream& anonymous_namespace{UDFCompiler.cpp}::FunctionDeclVisitor::ast_file_
private

Definition at line 93 of file UDFCompiler.cpp.

ASTContext& anonymous_namespace{UDFCompiler.cpp}::FunctionDeclVisitor::context_
private

Definition at line 95 of file UDFCompiler.cpp.

SourceManager& anonymous_namespace{UDFCompiler.cpp}::FunctionDeclVisitor::source_manager_
private

Definition at line 94 of file UDFCompiler.cpp.


The documentation for this class was generated from the following file: