-
Notifications
You must be signed in to change notification settings - Fork 13.4k
A bunch of lexer changes #14630
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
A bunch of lexer changes #14630
Conversation
(There is no change in behavior here) |
@@ -546,8 +546,7 @@ pub fn trans_rust_fn_with_foreign_abi(ccx: &CrateContext, | |||
let t = ty::node_id_to_type(tcx, id); | |||
|
|||
let ps = ccx.tcx.map.with_path(id, |path| { | |||
let abi = Some(ast_map::PathName(special_idents::clownshoe_abi.name)); | |||
link::mangle(path.chain(abi.move_iter()), None, None) | |||
link::mangle(path, None, None) |
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.
I think this may still be necessary (for now). For example, this is the output of pub extern fn foo() {}
target datalayout = "e-i64:64-f80:128-n8:16:32:64"
target triple = "x86_64-apple-darwin"
define void @_ZN3foo20h2f9dbd5552bebf99daa4v0.0E() unnamed_addr #0 {
"the block":
call void @_ZN3foo10__rust_abiE()
ret void
}
; Function Attrs: uwtable
define internal void @_ZN3foo10__rust_abiE() unnamed_addr #1 {
entry-block:
ret void
}
attributes #0 = { "split-stack" }
attributes #1 = { uwtable "split-stack" }
You'll notice that the name of the wrapper is _ZN3foo10__rust_abiE
, and if we remove the clownshoe abi the name would be _ZN3fooE
. I believe that this would clash with any C++ function named foo
.
Until this is fixed, I don't think that we should remove the clownshoe abi (or at least not the symbol associated with it). Others may be more familiar with why this is here than I.
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.
Ok, I wasn't sure about it. At the very least we don't need to include it in tokens, we can just add the string right here, yes?
These are a pain to rebase, so I'm separating this from the rest of my work. Nothing controversial here, just some simple refactoring and removal of an unused entry in the token table. Brings the lexer into 2012 with methods!
internal: `Arc<String>` -> `Arc<str>`
These are a pain to rebase, so I'm separating this from the rest of my work.
Nothing controversial here, just some simple refactoring and removal of an
unused entry in the token table. Brings the lexer into 2012 with methods!