Skip to content

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

Closed
wants to merge 4 commits into from
Closed

A bunch of lexer changes #14630

wants to merge 4 commits into from

Conversation

emberian
Copy link
Member

@emberian emberian commented Jun 3, 2014

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!

@emberian
Copy link
Member Author

emberian commented Jun 3, 2014

(There is no change in behavior here)

@emberian
Copy link
Member Author

emberian commented Jun 3, 2014

cc @alexcrichton @brson

@@ -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)
Copy link
Member

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.

Copy link
Member Author

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?

bors added a commit that referenced this pull request Jun 4, 2014
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!
@bors bors closed this Jun 4, 2014
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2023
internal: `Arc<String>` -> `Arc<str>`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants