OmniSciDB  94e8789169
 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 54 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 56 of file UDFCompiler.cpp.

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

Member Function Documentation

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

Definition at line 86 of file UDFCompiler.cpp.

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

Definition at line 81 of file UDFCompiler.cpp.

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

Definition at line 63 of file UDFCompiler.cpp.

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

Member Data Documentation

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

Definition at line 94 of file UDFCompiler.cpp.

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

Definition at line 96 of file UDFCompiler.cpp.

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

Definition at line 95 of file UDFCompiler.cpp.


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