Skip to content

Take advantage of LLVM range metadata for enum discriminants #4924

Closed
@sanxiyn

Description

@sanxiyn

According to LLVM Language Reference Manual, "range metadata may be attached only to loads of integer types. It expresses the possible ranges the loaded value is in".

Clang uses it to let LLVM know that even if bool is represented as i8 in LLVM, it can be only 0 or 1. See http://llvm.org/bugs/show_bug.cgi?id=12251

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-codegenArea: Code generationI-slowIssue: Problems and improvements with respect to performance of generated code.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions