OmniSciDB  c1a53651b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 55 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 57 of file UdfCompiler.cpp.

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

Member Function Documentation

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

Definition at line 87 of file UdfCompiler.cpp.

87  {
88  SourceLocation spell_loc = source_manager_.getSpellingLoc(f->getLocation());
89  PresumedLoc p_loc = source_manager_.getPresumedLoc(spell_loc);
90 
91  return std::string(p_loc.getFilename());
92  }
constexpr double f
Definition: Utm.h:31
std::string anonymous_namespace{UdfCompiler.cpp}::FunctionDeclVisitor::getMainFileName ( ) const
inlineprivate

Definition at line 82 of file UdfCompiler.cpp.

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

Definition at line 64 of file UdfCompiler.cpp.

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

Member Data Documentation

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

Definition at line 95 of file UdfCompiler.cpp.

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

Definition at line 97 of file UdfCompiler.cpp.

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

Definition at line 96 of file UdfCompiler.cpp.


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