-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d1bba7
commit 0fc1ae8
Showing
11 changed files
with
425 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#pragma once | ||
|
||
#include <functional> | ||
#include <memory> | ||
|
||
#include <jitmap/query/compiler.h> | ||
#include <jitmap/util/exception.h> | ||
|
||
namespace jitmap { | ||
namespace query { | ||
|
||
class JitException : public Exception { | ||
public: | ||
using Exception::Exception; | ||
}; | ||
|
||
// Signature of generated functions | ||
typedef void (*DenseEvalFn)(const BitsetWordType**, BitsetWordType*); | ||
|
||
// The JitEngine class transforms IR queries into executable functions. | ||
class JitEngine { | ||
public: | ||
JitEngine(CompilerOptions options = {}); | ||
~JitEngine(); | ||
|
||
// Return the LLVM name for the host CPU. | ||
// | ||
// This is the string given to `-march/-mtune/-mcpu`. See | ||
// http:https://llvm.org/doxygen/Host_8h_source.html for more information. | ||
std::string GetTargetCPU() const; | ||
|
||
// Return the LLVM features string for the host CPU. | ||
// | ||
// An array delimited by comma of symbols referencing a specific cpu feature. | ||
// The feature supported are prefixed by `+`, and unsupported by `-`. See | ||
// http:https://llvm.org/doxygen/Host_8h_source.html for more information. | ||
std::string GetTargetFeatureString() const; | ||
|
||
// Return the LLVM target triple for the host. | ||
// | ||
// The format is ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT. See | ||
// http:https://llvm.org/doxygen/Triple_8h_source.html for more information. | ||
std::string GetTargetTriple() const; | ||
|
||
// Compile a query. | ||
void Compile(QueryIRCodeGen query); | ||
|
||
// Lookup a query | ||
DenseEvalFn LookupUserQuery(const std::string& query_name); | ||
|
||
private: | ||
class Impl; | ||
std::unique_ptr<Impl> impl_; | ||
}; | ||
|
||
} // namespace query | ||
} // namespace jitmap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.