-
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.
fix: Module.context invalid pointer error
- Loading branch information
Showing
4 changed files
with
35 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,31 @@ | ||
from llvmpym import error_handling | ||
error_handling.install_fatal_error_handler(lambda s: print(s)) | ||
from llvmpym import core, utils | ||
|
||
asm_str = r''' | ||
; ModuleID = '<string>' | ||
target triple = "unknown-unknown-unknown" | ||
%struct.glob_type = type { i64, [2 x i64] } | ||
@glob = global i32 0 | ||
@glob_b = global i8 0 | ||
@glob_f = global float 1.5 | ||
@glob_struct = global %struct.glob_type {i64 0, [2 x i64] [i64 0, i64 0]} | ||
define zeroext i32 @sum(i32 nocapture %.1, i32 %.2) cold { | ||
%.3 = add i32 %.1, %.2 | ||
%.4 = add i32 0, %.3 | ||
ret i32 %.4 | ||
} | ||
define void @foo() "frame-pointer"="all" { | ||
call void asm sideeffect "nop", ""() | ||
ret void | ||
} | ||
declare void @a_readonly_func(i8 *) readonly | ||
''' | ||
|
||
m = utils.parse_assembly(asm_str) | ||
|
||
print(m.context) # FIXME | ||
# with core.Context.get_global_context() as ctx: | ||
# print(ctx) |
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