-
Notifications
You must be signed in to change notification settings - Fork 0
Use mangled name for intrinsic symbols #85
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
Draft
ehildenb
wants to merge
12
commits into
master
Choose a base branch
from
cold-path-intrinsic
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ee6436a
src/printer: dump mangled name for json
ehildenb 1a87359
tests/integration: add test exercising cold_path
ehildenb 4dad2e5
tests/integration: update expected output
ehildenb 505e6d4
Cargo.toml, Cargo.lock: add rustc_demangle
ehildenb dcc7e36
src/printer: use demangled name
ehildenb e4eca26
tests/integration/programs: update expected output
ehildenb b83ac8a
src/printer: compute item name inside mk_item
ehildenb f7e5d62
tests/integration: update expected output
ehildenb 47009c9
Simplified mangled name functions
dkcumming e3ecb71
tests/integration: update expected output
ehildenb bbc554f
src/printer: demangle function names too
ehildenb 9f56312
tests/integration: update expected output
ehildenb 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
], | ||
[ | ||
{ | ||
"IntrinsicSym": "black_box" | ||
"IntrinsicSym": "_ZN4core10intrinsics9black_box17h422cafb34137ccebE" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the change that dumping the mangled name makes. |
||
} | ||
], | ||
[ | ||
|
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
fn main() { | ||
checked_add_i32(1,2); | ||
} | ||
|
||
/// If the precondition is not met, the program is not executed (exits cleanly, ex falso quodlibet) | ||
macro_rules! precondition { | ||
($pre:expr, $block:expr) => { | ||
if $pre { $block } | ||
}; | ||
} | ||
|
||
fn checked_add_i32(a: i32, b: i32) { | ||
|
||
precondition!( | ||
a.checked_add(b).is_some(), | ||
unsafe { | ||
let result = a.unchecked_add(b); | ||
assert!(result as i64 == a as i64 + b as i64) | ||
} | ||
); | ||
} | ||
Comment on lines
+1
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Example we are trying. |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Here we are trying to dump the mangled name of the intrinsics instead of just the short name.