source: icGREP/icgrep-devel/icgrep/kernels/scanmatchgen.h @ 5257

Last change on this file since 5257 was 5246, checked in by nmedfort, 3 years ago

Code clean up to enforce proper calling order of KernelBuilder? methods

File size: 1.2 KB
Line 
1/*
2 *  Copyright (c) 2016 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 */
5#ifndef SCANMATCHGEN_H
6#define SCANMATCHGEN_H
7
8#include "streamset.h"
9#include "kernel.h"
10#include "grep_type.h"
11#include <llvm/Support/Host.h>
12#include <llvm/ADT/Triple.h>
13
14namespace llvm { class Module; class Function;}
15
16namespace IDISA { class IDISA_Builder; }
17
18namespace kernel {
19   
20class ScanMatchKernel : public KernelBuilder {
21public:
22    ScanMatchKernel(IDISA::IDISA_Builder * iBuilder, GrepType grepType) :
23    KernelBuilder(iBuilder, "scanMatch",
24                  {Binding{iBuilder->getStreamSetTy(2, 1), "matchResults"}},
25                    {}, 
26                    {Binding{iBuilder->getInt8PtrTy(), "FileBuf"}, Binding{iBuilder->getSizeTy(), "FileSize"}, Binding{iBuilder->getSizeTy(), "FileIdx"}}, 
27                    {}, 
28                    {Binding{iBuilder->getSizeTy(), "BlockNo"}, Binding{iBuilder->getSizeTy(), "LineStart"}, Binding{iBuilder->getSizeTy(), "LineNum"}}),
29
30    mGrepType(grepType) {}
31       
32private:
33    void generateDoBlockMethod() const override;
34    llvm::Function * generateScanWordRoutine(llvm::Module * m) const;
35       
36    GrepType mGrepType;
37};
38}
39
40#endif // SCANMATCHGEN_H
Note: See TracBrowser for help on using the repository browser.