OmniSciDB  0fdbebe030
 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 47 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 49 of file UDFCompiler.cpp.

52  : ast_file_(ast_file), source_manager_(s_manager), context_(context) {
53  source_manager_.getDiagnostics().setShowColors();
54  }

Member Function Documentation

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

Definition at line 79 of file UDFCompiler.cpp.

79  {
80  SourceLocation spell_loc = source_manager_.getSpellingLoc(f->getLocation());
81  PresumedLoc p_loc = source_manager_.getPresumedLoc(spell_loc);
82 
83  return std::string(p_loc.getFilename());
84  }
std::string anonymous_namespace{UDFCompiler.cpp}::FunctionDeclVisitor::getMainFileName ( ) const
inlineprivate

Definition at line 74 of file UDFCompiler.cpp.

74  {
75  auto f_entry = source_manager_.getFileEntryForID(source_manager_.getMainFileID());
76  return f_entry->getName().str();
77  }
bool anonymous_namespace{UDFCompiler.cpp}::FunctionDeclVisitor::VisitFunctionDecl ( FunctionDecl *  f)
inline

Definition at line 56 of file UDFCompiler.cpp.

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

Member Data Documentation

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

Definition at line 87 of file UDFCompiler.cpp.

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

Definition at line 89 of file UDFCompiler.cpp.

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

Definition at line 88 of file UDFCompiler.cpp.


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