loggerpass.h
No OneTemporary

File Metadata

Created
Thu, Jul 9, 1:11 AM

loggerpass.h

/*
* logging.h
*
* Created on: Jun 23, 2015
* Author: pgess
*/
#ifndef SRC_LOGGING_H_
#define SRC_LOGGING_H_
#include "ast.h"
#include <llvm/IR/Value.h>
#include "pass/compilepass.h"
#include "pass/abstractpass.h"
#include "clasplayer.h"
namespace xreate {
class LoggerPass:public AbstractPass<void>, public IQuery {
public:
void inject(const Symbol& symbol, const compilation::Context& context);
LoggerPass(PassManager* manager);
virtual void init(ClaspLayer* clasp);
void initDependencies(CompilePass* pass);
virtual void process(const Expression& expression, PassContext context, const std::string& varDecl="");
private:
CompilePass* compiler = nullptr;
llvm::Function* refPrintf;
void initOutput();
};
struct IsLogging{};
template<>
struct AttachmentsDict<IsLogging> {
typedef bool Data;
static const unsigned int key = 2;
};
} /* namespace xreate */
#endif /* SRC_LOGGING_H_ */

Event Timeline