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

Last change on this file since 5235 was 5234, checked in by nmedfort, 3 years ago

Modified memory alignment mechanism for GetPropertyValueGrepString? + misc. changes.

File size: 1.7 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#include <grep_type.h>
14
15
16namespace llvm { class raw_ostream; }
17
18
19
20class GrepEngine {
21    typedef void (*GrepFunctionType)(char * byte_data, size_t filesize, const int fileIdx);
22    typedef uint64_t (*GrepFunctionType_CountOnly)(char * byte_data, size_t filesize, const int fileIdx);
23    typedef void (*GrepFunctionType_CPU)(char * rslt, char * byte_data, size_t filesize, const int fileIdx);
24public:
25
26    GrepEngine() {}
27
28    ~GrepEngine();
29 
30    void grepCodeGen(std::string moduleName, re::RE * re_ast, bool CountOnly, bool UTF_16 = false, GrepType grepType = GrepType::Normal);
31   
32    void doGrep(const std::string & fileName, const int fileIdx, bool CountOnly, std::vector<size_t> &total_CountOnly, bool UTF_16);
33   
34    re::CC *  grepCodepoints();
35    const std::vector<std::string> & grepPropertyValues(const std::string& propertyName);
36   
37private:
38   
39    GrepFunctionType mGrepFunction;
40    GrepFunctionType_CountOnly mGrepFunction_CountOnly;
41    GrepFunctionType_CPU mGrepFunction_CPU;
42
43    GrepType mGrepType;
44    llvm::ExecutionEngine * mEngine;
45};
46
47void icgrep_Linking(Module * m, ExecutionEngine * e);
48
49
50re::CC * getParsedCodePointSet();
51void setParsedCodePointSet();
52
53const std::vector<std::string>& getParsedPropertyValues();
54void setParsedPropertyValues();
55
56
57void initResult(std::vector<std::string> filenames);
58void PrintResult(bool CountOnly, std::vector<size_t> & total_CountOnly);
59
60#endif
Note: See TracBrowser for help on using the repository browser.