Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gazelle-LLVM-prototype
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Naman Dixit
gazelle-LLVM-prototype
Commits
031ca77f
Commit
031ca77f
authored
May 20, 2022
by
Naman Dixit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed comments from old complicated interpreter
parent
8eb0ee24
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
31 deletions
+13
-31
src/main.cpp
src/main.cpp
+13
-31
No files found.
src/main.cpp
View file @
031ca77f
...
@@ -282,37 +282,19 @@ int demo (void)
...
@@ -282,37 +282,19 @@ int demo (void)
errno
=
0
;
errno
=
0
;
// llvm::FunctionCallee Exit = Mod->getOrInsertFunction("exit",
{
// Execute
// llvm::Type::getVoidTy(Context),
// Run static constructors.
// llvm::Type::getInt32Ty(Context));
EE
->
runStaticConstructorsDestructors
(
false
);
EE
->
runStaticConstructorsDestructors
(
false
);
// (void)EE->getPointerToFunction(EntryFn);
// Run main.
llvm
::
GenericValue
Result
=
EE
->
runFunction
(
EntryFn
,
llvm
::
ArrayRef
<
llvm
::
GenericValue
>
());
// Run main.
uint64_t
ResultValue
=
Result
.
IntVal
.
getZExtValue
();
llvm
::
GenericValue
Result
=
EE
->
runFunction
(
EntryFn
,
llvm
::
ArrayRef
<
llvm
::
GenericValue
>
());
uint64_t
ResultValue
=
Result
.
IntVal
.
getZExtValue
();
// Run static destructors.
EE
->
runStaticConstructorsDestructors
(
true
);
// Run static destructors.
EE
->
runStaticConstructorsDestructors
(
true
);
std
::
cout
<<
"Returns: "
<<
ResultValue
<<
std
::
endl
;
}
std
::
cout
<<
"Returns: "
<<
ResultValue
<<
std
::
endl
;
// if (llvm::Function *ExitF =
// llvm::dyn_cast<llvm::Function>(Exit.getCallee()->stripPointerCasts())) {
// if (ExitF->getFunctionType() == Exit.getFunctionType()) {
// std::vector<llvm::GenericValue> Args;
// llvm::GenericValue ResultGV;
// ResultGV.IntVal = llvm::APInt(32, static_cast<uint64_t>(Result));
// Args.push_back(ResultGV);
// EE->runFunction(ExitF, Args);
// llvm::WithColor::error(llvm::errs(), code_name.c_str())
// << "exit(" << Result << ") returned!\n";
// abort();
// }
// llvm::WithColor::error(llvm::errs(), code_name.c_str()) << "exit defined with wrong prototype!\n";
// abort();
// }
return
static_cast
<
int
>
(
ResultValue
);
return
static_cast
<
int
>
(
ResultValue
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment