source: icGREP/icgrep-devel/icgrep/grep_engine.h @ 5179

Last change on this file since 5179 was 5151, checked in by lindanl, 3 years ago

Add NVPTX Arch to the framework. Fix directory bug in make check.

File size: 1.5 KB
Line 
1#ifndef DO_GREP_H
2#define DO_GREP_H
3/*
4 *  Copyright (c) 2016 International Characters.
5 *  This software is licensed to the public under the Open Software License 3.0.
6 *  icgrep is a trademark of International Characters.
7 */
8
9#include <string>
10#include <stdint.h>
11#include <re/re_re.h>
12#include <llvm/ExecutionEngine/ExecutionEngine.h>
13
14
15namespace llvm { class raw_ostream; }
16
17
18
19class GrepEngine {
20    typedef void (*GrepFunctionType)(char * byte_data, size_t filesize, const int fileIdx);
21    typedef uint64_t (*GrepFunctionType_CountOnly)(char * byte_data, size_t filesize, const int fileIdx);
22    typedef void (*GrepFunctionType_CPU)(char * rslt, char * byte_data, size_t filesize, const int fileIdx);
23public:
24
25    GrepEngine() {}
26
27    ~GrepEngine();
28 
29    void grepCodeGen(std::string moduleName, re::RE * re_ast, bool CountOnly, bool UTF_16 = false, bool isNameExpression = false);
30   
31    void doGrep(const std::string & fileName, const int fileIdx, bool CountOnly, std::vector<size_t> &total_CountOnly, bool UTF_16);
32   
33    re::CC *  grepCodepoints();
34   
35private:
36   
37    GrepFunctionType mGrepFunction;
38    GrepFunctionType_CountOnly mGrepFunction_CountOnly;
39    GrepFunctionType_CPU mGrepFunction_CPU;
40
41    bool mIsNameExpression;
42    llvm::ExecutionEngine * mEngine;
43};
44
45void icgrep_Linking(Module * m, ExecutionEngine * e);
46
47
48re::CC * getParsedCodePointSet();
49void setParsedCodePointSet();
50
51void initResult(std::vector<std::string> filenames);
52void PrintResult(bool CountOnly, std::vector<size_t> & total_CountOnly);
53
54#endif
Note: See TracBrowser for help on using the repository browser.