Skip to content
Snippets Groups Projects
  • Hal Finkel's avatar
    4cdf252c
    Mark C++ reference parameters as dereferenceable · 4cdf252c
    Hal Finkel authored
    Because references must be initialized using some evaluated expression, they
    must point to something, and a callee can assume the reference parameter is
    dereferenceable. Taking advantage of a new attribute just added to LLVM, mark
    them as such.
    
    Because dereferenceability in addrspace(0) implies nonnull in the backend, we
    don't need both attributes. However, we need to know the size of the object to
    use the dereferenceable attribute, so for incomplete types we still emit only
    nonnull.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213386 91177308-0d34-0410-b5e6-96231b3b80d8
    4cdf252c
    History
    Mark C++ reference parameters as dereferenceable
    Hal Finkel authored
    Because references must be initialized using some evaluated expression, they
    must point to something, and a callee can assume the reference parameter is
    dereferenceable. Taking advantage of a new attribute just added to LLVM, mark
    them as such.
    
    Because dereferenceability in addrspace(0) implies nonnull in the backend, we
    don't need both attributes. However, we need to know the size of the object to
    use the dereferenceable attribute, so for incomplete types we still emit only
    nonnull.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213386 91177308-0d34-0410-b5e6-96231b3b80d8
Code owners
Assign users and groups as approvers for specific file changes. Learn more.