Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • F Frama Clang
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • pub
  • Frama Clang
  • Merge requests
  • !5

Add support for C++14 generic lambdas

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Stefan Gränitz requested to merge weliveindetail/frama-clang:cxx14-generic-lambda into master Aug 19, 2021
  • Overview 2
  • Commits 0
  • Changes 0

Generic lambdas are a C++14 language feature: https://isocpp.org/wiki/faq/cpp14-language#generic-lambdas

This patch proposes an implementation for feature request frama-c#2561 (closed) . It's a major overhaul of the lambda processing infrastructure in the plugin. That's necessary because C++14 generic lambdas extend the C++11 lambda concept fundamentally: Not only can function parameter types now be declared as auto and deduced at compile time, they can also be deduced to different types for different invocations. Conceptually this means that the compiler-generated entity that represents a lambda can now have multiple overloaded call operators. This has wide-ranging implications:

  • Lambda nodes in the intermediate AST convey a list signatures of now
  • LambdaExpr nodes define a list of overloads now and each of them has a unique identifier (IDs)
  • Lambda_call nodes store the IDs for their respective overload
  • Mangling for Lambda types accounts for all overloaded signatures now
  • All function names emitted during code generation encode the IDs in order to prevent collisions
  • Code generation for initialization tasks is split into:
    • inits that happen once: instantiate a local helper variable and initialize captures in the struct
    • inits that happen for each overload: generate the body and assign the matching function pointer in the struct
Edited Aug 20, 2021 by Stefan Gränitz
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: cxx14-generic-lambda