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

type constraint circumvention with int literals #1214

Open
ghost opened this issue May 21, 2014 · 0 comments
Open

type constraint circumvention with int literals #1214

ghost opened this issue May 21, 2014 · 0 comments

Comments

@ghost
Copy link

ghost commented May 21, 2014

This shouldn't compile

import typetraits

proc p(x: int8|int16) =
  echo x.type.name # int

p(1)
Clyybber pushed a commit to Clyybber/Nim that referenced this issue Mar 5, 2024
)

## Summary

Make routine instrumentation with `nimProfile` calls a MIR pass, moving
more logic out of the C code generator and working towards
`--profiler:on` support with all backends. `nimProfile` calls are also
no longer inserted into loops within `.asmNoStackFrame` routines.

## Details

* require a `ModuleGraph` instance for `mirpasses.applyPasses`, so that
  compilerprocs can be looked up
* add the `injectProfilerCalls` MIR pass. It injects `nimProfile` in
  the same way that `cgen` does
* remove injection of `nimProfile` calls from `cgen`
* don't instrument loops within `.asmNoStackFrame` procedures;
  injection of `nimProfile` at procedure entry was already skipped for
  these procedures
* temporarily remove the `optProfiler` option from symbols when in JIT
  mode, that code generated for compile-time execution is not
  instrumented
* add a test for the `--profiler:on` feature, to make sure it works and
  keeps working
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant