Skip to content
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

Cannot reference function types from variables #90

Open
SnirkImmington opened this issue Dec 25, 2018 · 0 comments
Open

Cannot reference function types from variables #90

SnirkImmington opened this issue Dec 25, 2018 · 0 comments
Labels
area: check Code validation area: identify The "identify pass" - the ScopedId De Brujin index, or "ensure name exists in scope" area: llvm Usage of the LLVM compiler library issue: bug Bug report priority: low Consider higher priority issues first status: on-hold PR contributor away or more discussion needed

Comments

@SnirkImmington
Copy link
Collaborator

Consider the protosnirk program

fn main()
    // empty

fn foo()
    let bar = main

We emit

%load_main = load void (), void ()* @main
%bar = alloca void main

for the line let bar = main.

From an LLVM perspective, we assume all variables can have allocas created for them and that they can be loaded from them. So we would need to handle the case of variable-sized types or a routine for determining the size of an alloca.

From a usability standpoint, C is the only language that I can think of that supports function pointers but not closures, so it might be a good idea to wait until we have those first...

@SnirkImmington SnirkImmington added area: identify The "identify pass" - the ScopedId De Brujin index, or "ensure name exists in scope" area: check Code validation area: llvm Usage of the LLVM compiler library priority: low Consider higher priority issues first status: on-hold PR contributor away or more discussion needed issue: bug Bug report labels Dec 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: check Code validation area: identify The "identify pass" - the ScopedId De Brujin index, or "ensure name exists in scope" area: llvm Usage of the LLVM compiler library issue: bug Bug report priority: low Consider higher priority issues first status: on-hold PR contributor away or more discussion needed
Projects
None yet
Development

No branches or pull requests

1 participant