-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[bindings] Add OCaml binding to LLVMGlobalSetMetadata
#131583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0bf3e74
[bindings] Add `global_set_metadata` for function debuginfo
lynzrand 2d4484f
fixup! [bindings] Add `global_set_metadata`
lynzrand 4b1c337
[bindings][test] Add test for `global_set_metadata`
lynzrand 75b272b
fixup! [bindings][test] Add test for global_set_metadata
lynzrand ae10076
fixup! [bindings][test] Add test for `global_set_metadata`
lynzrand 86429bc
fixup! [bindings][test] Add test for `global_set_metadata`
lynzrand 7dcbc3d
fixup! [bindings][test] Add test for
lynzrand File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -434,8 +434,19 @@ let test_global_values () = | |||||||||||||||||
| group "dll_storage_class"; | ||||||||||||||||||
| let g = define_global "GVal06" zero32 m ++ | ||||||||||||||||||
| set_dll_storage_class DLLStorageClass.DLLExport in | ||||||||||||||||||
| insist (DLLStorageClass.DLLExport = dll_storage_class g) | ||||||||||||||||||
| insist (DLLStorageClass.DLLExport = dll_storage_class g); | ||||||||||||||||||
|
|
||||||||||||||||||
| (* CHECK: GVal07{{.*}}!test !{{.*}} | ||||||||||||||||||
| * See metadata check at the end of the file. | ||||||||||||||||||
| *) | ||||||||||||||||||
| group "metadata"; | ||||||||||||||||||
| let g = define_global "GVal07" zero32 m in | ||||||||||||||||||
| let md_string = mdstring context "global test metadata" in | ||||||||||||||||||
| let md_node = mdnode context [| zero32; md_string |] |> value_as_metadata in | ||||||||||||||||||
| let mdkind_test = mdkind_id context "test" in | ||||||||||||||||||
| global_set_metadata g mdkind_test md_node; | ||||||||||||||||||
| let md' = global_copy_all_metadata g in | ||||||||||||||||||
| insist (md' = [| mdkind_test, md_node |]) | ||||||||||||||||||
|
|
||||||||||||||||||
| (*===-- Global Variables --------------------------------------------------===*) | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -1115,8 +1126,9 @@ let test_builder () = | |||||||||||||||||
| end; | ||||||||||||||||||
|
|
||||||||||||||||||
| group "metadata"; begin | ||||||||||||||||||
| (* CHECK: %metadata = add i32 %P1, %P2, !test !1 | ||||||||||||||||||
| * !1 is metadata emitted at EOF. | ||||||||||||||||||
| (* CHECK: %metadata = add i32 %P1, %P2, !test !{{[0-9]+}} | ||||||||||||||||||
| * Number of metadata nodes is not predictable, so we just check for | ||||||||||||||||||
| * the presence of metadata here | ||||||||||||||||||
| *) | ||||||||||||||||||
| let i = build_add p1 p2 "metadata" atentry in | ||||||||||||||||||
| insist ((has_metadata i) = false); | ||||||||||||||||||
|
|
@@ -1432,9 +1444,10 @@ let test_builder () = | |||||||||||||||||
| end | ||||||||||||||||||
|
|
||||||||||||||||||
| (* End-of-file checks for things like metdata and attributes. | ||||||||||||||||||
| * CHECK: !llvm.module.flags = !{!0} | ||||||||||||||||||
| * CHECK: !0 = !{i32 1, !"Debug Info Version", i32 3} | ||||||||||||||||||
| * CHECK: !1 = !{i32 1, !"metadata test"} | ||||||||||||||||||
| * CHECK: !llvm.module.flags = !{!{{[0-9]+}}} | ||||||||||||||||||
| * CHECK: !{{[0-9]+}} = !{i32 0, !"global test metadata"} | ||||||||||||||||||
| * CHECK: !{{[0-9]+}} = !{i32 1, !"Debug Info Version", i32 3} | ||||||||||||||||||
| * CHECK: !{{[0-9]+}} = !{i32 1, !"metadata test"} | ||||||||||||||||||
|
||||||||||||||||||
| * CHECK: !llvm.module.flags = !{!{{[0-9]+}}} | |
| * CHECK: !{{[0-9]+}} = !{i32 0, !"global test metadata"} | |
| * CHECK: !{{[0-9]+}} = !{i32 1, !"Debug Info Version", i32 3} | |
| * CHECK: !{{[0-9]+}} = !{i32 1, !"metadata test"} | |
| * CHECK: !llvm.module.flags = !{!{{[0-9]+}}} | |
| * CHECK: !0 = !{i32 0, !"global test metadata"} | |
| * CHECK: !1 = !{i32 1, !"Debug Info Version", i32 3} | |
| * CHECK: !2 = !{i32 1, !"metadata test"} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if you were to prefer to check for a numeric regex instead of a precise ID, I don't like the wording of "predictable" in the comment. The tests are still deterministic, i.e. predictable.