This repository has been archived by the owner on Jul 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In debug mode dump extra info when passing -debug -debug-only=jitfrom…
…scratch
- Loading branch information
1 parent
73a565a
commit 7690ac1
Showing
7 changed files
with
47 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
#include "JitFromScratch.h" | ||
|
||
#include <llvm/ExecutionEngine/Orc/ThreadSafeModule.h> | ||
#include <llvm/Support/Debug.h> | ||
|
||
#define DEBUG_TYPE "jitfromscratch" | ||
|
||
using namespace llvm; | ||
using namespace llvm::orc; | ||
|
||
JitFromScratch::JitFromScratch(ExitOnError ExitOnErr) | ||
: LLJIT(ExitOnErr(LLJITBuilder().create())) {} | ||
JitFromScratch::JitFromScratch(ExitOnError ExitOnErr) { | ||
LLJITBuilder Builder; | ||
ExitOnErr(Builder.prepareForConstruction()); | ||
TT = Builder.JTMB->getTargetTriple(); | ||
LLJIT = ExitOnErr(Builder.create()); | ||
} | ||
|
||
Error JitFromScratch::submitModule(std::unique_ptr<Module> M, | ||
std::unique_ptr<LLVMContext> C) { | ||
LLVM_DEBUG(dbgs() << "Submit IR module:\n\n" << *M << "\n\n"); | ||
return LLJIT->addIRModule(ThreadSafeModule(std::move(M), std::move(C))); | ||
} |
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
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,11 @@ | ||
# Check that output from LLVM_DEBUG is printed in Debug mode (dumps to stderr) | ||
# RUN: JitFromScratch -debug -debug-only=jitfromscratch 2>&1 | FileCheck %s | ||
|
||
# CHECK: JITing for host target: {{.*}} | ||
# CHECK-EMPTY: | ||
# CHECK-NEXT: Submit IR module: | ||
# CHECK-EMPTY: | ||
# CHECK-NEXT: ; ModuleID = 'JitFromScratch' | ||
# CHECK-NEXT: source_filename = "JitFromScratch" | ||
|
||
# CHECK: Integer Distances: 3, 0, 3 |